|
GnuCash 2.4.99
|
00001 /* 00002 * qif-objects.h -- QIF objects for the QIF importer 00003 * 00004 * Written By: Derek Atkins <derek@ihtfp.com> 00005 * Copyright (c) 2003 Derek Atkins <warlord@MIT.EDU> 00006 * 00007 * This program is free software; you can redistribute it and/or 00008 * modify it under the terms of the GNU General Public License as 00009 * published by the Free Software Foundation; either version 2 of 00010 * the License, or (at your option) any later version. 00011 * 00012 * This program is distributed in the hope that it will be useful, 00013 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 * GNU General Public License for more details. 00016 * 00017 * You should have received a copy of the GNU General Public License 00018 * along with this program; if not, contact: 00019 * 00020 * Free Software Foundation Voice: +1-617-542-5942 00021 * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 00022 * Boston, MA 02110-1301, USA gnu@gnu.org 00023 */ 00024 00025 #ifndef QIF_OBJECTS_H 00026 #define QIF_OBJECTS_H 00027 00028 typedef struct _QifObject *QifObject; 00029 typedef struct _QifData *QifData; 00030 00031 struct _QifObject 00032 { 00033 const char* type; 00034 void (*destroy)(QifObject); 00035 00036 /* QIF Objects contain data beyond this point.. */ 00037 }; 00038 00039 #define QIF_O_ACCOUNT "qif-acct" 00040 typedef struct _QifAccount *QifAccount; 00041 00042 #define QIF_O_CATEGORY "qif-cat" 00043 typedef struct _QifCategory *QifCategory; 00044 00045 #define QIF_O_CLASS "qif-class" 00046 typedef struct _QifClass *QifClass; 00047 00048 #define QIF_O_SECURITY "qif-security" 00049 typedef struct _QifSecurity *QifSecurity; 00050 00051 #define QIF_O_TXN "qif-txn" 00052 typedef struct _QifTxn *QifTxn; 00053 typedef struct _QifSplit *QifSplit; 00054 typedef struct _QifInvstTxn *QifInvstTxn; 00055 00056 void qif_object_init(void); 00057 00058 QifAccount find_or_make_acct(QifContext ctx, char *name, GList *types); 00059 QifCategory find_or_make_cat(QifContext ctx, char *name); 00060 QifClass find_or_make_class(QifContext ctx, char *name); 00061 00062 /* merge the object into the context. Returns the object that's in 00063 * the context, which is either the supplied object or the 00064 * already-existing object. 00065 */ 00066 QifAccount qif_account_merge(QifContext ctx, QifAccount acct); 00067 QifCategory qif_cat_merge(QifContext ctx, QifCategory cat); 00068 QifClass qif_class_merge(QifContext ctx, QifClass qclass); 00069 QifSecurity qif_security_merge(QifContext ctx, QifSecurity security); 00070 00071 #endif /* QIF_OBJECTS_H */
1.7.4