GnuCash  2.6.99
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
qif-objects.h
1 /*
2  * qif-objects.h -- QIF objects for the QIF importer
3  *
4  * Written By: Derek Atkins <[email protected]>
5  * Copyright (c) 2003 Derek Atkins <[email protected]>
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License as
9  * published by the Free Software Foundation; either version 2 of
10  * the License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, contact:
19  *
20  * Free Software Foundation Voice: +1-617-542-5942
21  * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652
22  * Boston, MA 02110-1301, USA [email protected]
23  */
24 
25 #ifndef QIF_OBJECTS_H
26 #define QIF_OBJECTS_H
27 
28 typedef struct _QifObject *QifObject;
29 typedef struct _QifData *QifData;
30 
31 struct _QifObject
32 {
33  const char* type;
34  void (*destroy)(QifObject);
35 
36  /* QIF Objects contain data beyond this point.. */
37 };
38 
39 #define QIF_O_ACCOUNT "qif-acct"
40 typedef struct _QifAccount *QifAccount;
41 
42 #define QIF_O_CATEGORY "qif-cat"
43 typedef struct _QifCategory *QifCategory;
44 
45 #define QIF_O_CLASS "qif-class"
46 typedef struct _QifClass *QifClass;
47 
48 #define QIF_O_SECURITY "qif-security"
49 typedef struct _QifSecurity *QifSecurity;
50 
51 #define QIF_O_TXN "qif-txn"
52 typedef struct _QifTxn *QifTxn;
53 typedef struct _QifSplit *QifSplit;
54 typedef struct _QifInvstTxn *QifInvstTxn;
55 
56 void qif_object_init(void);
57 
58 QifAccount find_or_make_acct(QifContext ctx, char *name, GList *types);
59 QifCategory find_or_make_cat(QifContext ctx, char *name);
60 QifClass find_or_make_class(QifContext ctx, char *name);
61 
62 /* merge the object into the context. Returns the object that's in
63  * the context, which is either the supplied object or the
64  * already-existing object.
65  */
66 QifAccount qif_account_merge(QifContext ctx, QifAccount acct);
67 QifCategory qif_cat_merge(QifContext ctx, QifCategory cat);
68 QifClass qif_class_merge(QifContext ctx, QifClass qclass);
69 QifSecurity qif_security_merge(QifContext ctx, QifSecurity security);
70 
71 #endif /* QIF_OBJECTS_H */