diff --git a/src/business/business-core/file/gnc-customer-xml-v2.c b/src/business/business-core/file/gnc-customer-xml-v2.c index b0703c9b54..52b1bd5b32 100644 --- a/src/business/business-core/file/gnc-customer-xml-v2.c +++ b/src/business/business-core/file/gnc-customer-xml-v2.c @@ -138,7 +138,7 @@ customer_dom_tree_create (GncCustomer *cust) taxtable = gncCustomerGetTaxTable (cust); if (taxtable) xmlAddChild (ret, guid_to_dom_tree (cust_taxtable_string, - gncTaxTableGetGUID (taxtable))); + qof_instance_get_guid(QOF_INSTANCE(taxtable)))); kvpnode = kvp_frame_to_dom_tree (cust_slots_string, qof_instance_get_slots (QOF_INSTANCE(cust))); diff --git a/src/business/business-core/file/gnc-entry-xml-v2.c b/src/business/business-core/file/gnc-entry-xml-v2.c index c2cb703e15..c33442d9fb 100644 --- a/src/business/business-core/file/gnc-entry-xml-v2.c +++ b/src/business/business-core/file/gnc-entry-xml-v2.c @@ -49,7 +49,8 @@ #include "gnc-owner-xml-v2.h" #include "gnc-engine-util.h" -#include "gncObject.h" +#include "qofinstance.h" +#include "qofobject.h" #define _GNC_MOD_NAME GNC_ENTRY_MODULE_NAME @@ -170,7 +171,7 @@ entry_dom_tree_create (GncEntry *entry) taxtable = gncEntryGetInvTaxTable (entry); if (taxtable) xmlAddChild (ret, guid_to_dom_tree (entry_itaxtable_string, - gncTaxTableGetGUID (taxtable))); + qof_instance_get_guid (QOF_INSTANCE(taxtable)))); /* vendor bills */ @@ -203,7 +204,7 @@ entry_dom_tree_create (GncEntry *entry) taxtable = gncEntryGetBillTaxTable (entry); if (taxtable) xmlAddChild (ret, guid_to_dom_tree (entry_btaxtable_string, - gncTaxTableGetGUID (taxtable))); + qof_instance_get_guid (QOF_INSTANCE(taxtable)))); /* Other stuff */ @@ -794,7 +795,7 @@ static int entry_get_count (GNCBook *book) { int count = 0; - gncObjectForeach (_GNC_MOD_NAME, book, do_count, (gpointer) &count); + qof_object_foreach (_GNC_MOD_NAME, book, do_count, (gpointer) &count); return count; } @@ -819,7 +820,7 @@ xml_add_entry (gpointer entry_p, gpointer out_p) static void entry_write (FILE *out, GNCBook *book) { - gncObjectForeach (_GNC_MOD_NAME, book, xml_add_entry, (gpointer) out); + qof_object_foreach (_GNC_MOD_NAME, book, xml_add_entry, (gpointer) out); } void @@ -835,7 +836,7 @@ gnc_entry_xml_initialize (void) NULL, /* scrub */ }; - gncObjectRegisterBackend (_GNC_MOD_NAME, + qof_object_register_backend (_GNC_MOD_NAME, GNC_FILE_BACKEND, &be_data); } diff --git a/src/business/business-core/file/gnc-tax-table-xml-v2.c b/src/business/business-core/file/gnc-tax-table-xml-v2.c index f5b3c8a7ba..6d9a760f99 100644 --- a/src/business/business-core/file/gnc-tax-table-xml-v2.c +++ b/src/business/business-core/file/gnc-tax-table-xml-v2.c @@ -41,12 +41,13 @@ #include "io-gncxml-gen.h" #include "io-gncxml-v2.h" +#include "gncEntry.h" #include "gncTaxTableP.h" #include "gnc-tax-table-xml-v2.h" #include "gnc-engine-util.h" -#include "gncObject.h" -#include "gncEntry.h" +#include "qofobject.h" +#include "qofinstance.h" #define _GNC_MOD_NAME GNC_TAXTABLE_MODULE_NAME @@ -74,7 +75,8 @@ static void maybe_add_guid (xmlNodePtr ptr, const char *tag, GncTaxTable *table) { if (table) - xmlAddChild (ptr, guid_to_dom_tree (tag, gncTaxTableGetGUID (table))); + xmlAddChild (ptr, guid_to_dom_tree (tag, + qof_instance_get_guid(QOF_INSTANCE(table)))); } static xmlNodePtr @@ -457,7 +459,7 @@ static int taxtable_get_count (GNCBook *book) { int count = 0; - gncObjectForeach (_GNC_MOD_NAME, book, do_count, (gpointer) &count); + qof_object_foreach (_GNC_MOD_NAME, book, do_count, (gpointer) &count); return count; } @@ -477,7 +479,7 @@ xml_add_taxtable (gpointer table_p, gpointer out_p) static void taxtable_write (FILE *out, GNCBook *book) { - gncObjectForeach (_GNC_MOD_NAME, book, xml_add_taxtable, (gpointer) out); + qof_object_foreach (_GNC_MOD_NAME, book, xml_add_taxtable, (gpointer) out); } @@ -619,7 +621,7 @@ taxtable_reset_refcount (gpointer key, gpointer value, gpointer notused) if (count != gncTaxTableGetRefcount(table) && !gncTaxTableGetInvisible(table)) { PWARN("Fixing refcount on taxtable %s (%lld -> %d)\n", - guid_to_string(gncTaxTableGetGUID(table)), + guid_to_string(qof_instance_get_guid(QOF_INSTANCE(table))), gncTaxTableGetRefcount(table), count) gncTaxTableSetRefcount(table, count); } @@ -633,17 +635,17 @@ taxtable_scrub (GNCBook *book) GncTaxTable *parent, *table; GHashTable *ht = g_hash_table_new(g_direct_hash, g_direct_equal); - gncObjectForeach (GNC_ENTRY_MODULE_NAME, book, taxtable_scrub_entries, ht); - gncObjectForeach (GNC_CUSTOMER_MODULE_NAME, book, taxtable_scrub_cust, ht); - gncObjectForeach (GNC_VENDOR_MODULE_NAME, book, taxtable_scrub_vendor, ht); - gncObjectForeach (_GNC_MOD_NAME, book, taxtable_scrub_cb, &list); + qof_object_foreach (GNC_ENTRY_MODULE_NAME, book, taxtable_scrub_entries, ht); + qof_object_foreach (GNC_CUSTOMER_MODULE_NAME, book, taxtable_scrub_cust, ht); + qof_object_foreach (GNC_VENDOR_MODULE_NAME, book, taxtable_scrub_vendor, ht); + qof_object_foreach (_GNC_MOD_NAME, book, taxtable_scrub_cb, &list); /* destroy the list of "grandchildren" tax tables */ for (node = list; node; node = node->next) { table = node->data; PINFO ("deleting grandchild taxtable: %s\n", - guid_to_string(gncTaxTableGetGUID(table))); + guid_to_string(qof_instance_get_guid(QOF_INSTANCE(table)))); /* Make sure the parent has no children */ parent = gncTaxTableGetParent(table); @@ -674,7 +676,7 @@ gnc_taxtable_xml_initialize (void) taxtable_scrub, }; - gncObjectRegisterBackend (_GNC_MOD_NAME, + qof_object_register_backend (_GNC_MOD_NAME, GNC_FILE_BACKEND, &be_data); } diff --git a/src/business/business-core/file/gnc-vendor-xml-v2.c b/src/business/business-core/file/gnc-vendor-xml-v2.c index 642f5f2e84..e3d130a392 100644 --- a/src/business/business-core/file/gnc-vendor-xml-v2.c +++ b/src/business/business-core/file/gnc-vendor-xml-v2.c @@ -48,7 +48,8 @@ #include "gnc-address-xml-v2.h" #include "gnc-engine-util.h" -#include "gncObject.h" +#include "qofinstance.h" +#include "qofobject.h" #define _GNC_MOD_NAME GNC_VENDOR_MODULE_NAME @@ -124,7 +125,7 @@ vendor_dom_tree_create (GncVendor *vendor) taxtable = gncVendorGetTaxTable (vendor); if (taxtable) xmlAddChild (ret, guid_to_dom_tree (vendor_taxtable_string, - gncTaxTableGetGUID (taxtable))); + qof_instance_get_guid(QOF_INSTANCE(taxtable)))); return ret; } @@ -433,7 +434,7 @@ static int vendor_get_count (GNCBook *book) { int count = 0; - gncObjectForeach (_GNC_MOD_NAME, book, do_count, (gpointer) &count); + qof_object_foreach (_GNC_MOD_NAME, book, do_count, (gpointer) &count); return count; } @@ -456,7 +457,7 @@ xml_add_vendor (gpointer vendor_p, gpointer out_p) static void vendor_write (FILE *out, GNCBook *book) { - gncObjectForeach (_GNC_MOD_NAME, book, xml_add_vendor, (gpointer) out); + qof_object_foreach (_GNC_MOD_NAME, book, xml_add_vendor, (gpointer) out); } void @@ -472,7 +473,7 @@ gnc_vendor_xml_initialize (void) NULL, /* scrub */ }; - gncObjectRegisterBackend (_GNC_MOD_NAME, + qof_object_register_backend (_GNC_MOD_NAME, GNC_FILE_BACKEND, &be_data); } diff --git a/src/business/business-core/gncCustomer.c b/src/business/business-core/gncCustomer.c index 6f758e654b..30c66d04ab 100644 --- a/src/business/business-core/gncCustomer.c +++ b/src/business/business-core/gncCustomer.c @@ -153,6 +153,7 @@ void gncCustomerDestroy (GncCustomer *cust) { if (!cust) return; cust->inst.do_free = TRUE; + // ??? why not?? gncBusinessSetDirtyFlag (table->book, _GNC_MOD_NAME, TRUE); gncCustomerCommitEdit (cust); } @@ -168,7 +169,6 @@ static void gncCustomerFree (GncCustomer *cust) gncAddressDestroy (cust->addr); gncAddressDestroy (cust->shipaddr); g_list_free (cust->jobs); - qof_instance_release (&cust->inst); remObj (cust); @@ -177,6 +177,7 @@ static void gncCustomerFree (GncCustomer *cust) if (cust->taxtable) gncTaxTableDecRef (cust->taxtable); + qof_instance_release (&cust->inst); g_free (cust); } diff --git a/src/business/business-core/gncTaxTable.c b/src/business/business-core/gncTaxTable.c index 7460396cd3..d32ffd63a9 100644 --- a/src/business/business-core/gncTaxTable.c +++ b/src/business/business-core/gncTaxTable.c @@ -11,51 +11,50 @@ #include "messages.h" #include "gnc-numeric.h" #include "gnc-engine-util.h" -#include "gnc-book.h" -#include "qofid.h" -#include "qofquerycore.h" -#include "qofquery.h" -#include "qofclass.h" #include "gnc-event-p.h" #include "gnc-be-utils.h" + +#include "qofbook.h" +#include "qofclass.h" +#include "qofid.h" #include "qofid-p.h" +#include "qofinstance.h" +#include "qofquery.h" +#include "qofquerycore.h" #include "gncBusiness.h" #include "gncTaxTableP.h" -struct _gncTaxTable { - GUID guid; - char * name; - GList * entries; - - Timespec modtime; /* internal date of last modtime */ - gint64 refcount; - QofBook * book; - GncTaxTable * parent; /* if non-null, we are an immutable child */ - GncTaxTable * child; /* if non-null, we have not changed */ - gboolean invisible; +struct _gncTaxTable +{ + QofInstance inst; + char * name; + GList * entries; - GList * children; /* A list of children */ + Timespec modtime; /* internal date of last modtime */ + gint64 refcount; + GncTaxTable * parent; /* if non-null, we are an immutable child */ + GncTaxTable * child; /* if non-null, we have not changed */ + gboolean invisible; - int editlevel; - gboolean do_free; - gboolean dirty; + GList * children; /* A list of children */ }; -struct _gncTaxTableEntry { - GncTaxTable * table; - Account * account; - GncAmountType type; - gnc_numeric amount; +struct _gncTaxTableEntry +{ + GncTaxTable * table; + Account * account; + GncAmountType type; + gnc_numeric amount; }; struct _book_info { - GncBookInfo bi; - GList * tables; /* visible tables */ + GncBookInfo bi; + GList * tables; /* visible tables */ }; -static short module = MOD_BUSINESS; +static short module = MOD_BUSINESS; /* You must edit the functions in this block in tandem. KEEP THEM IN SYNC! */ @@ -116,20 +115,20 @@ gncTaxIncludedStringToType (const char *str, GncTaxIncluded *type) } #undef GNC_RETURN_ON_MATCH -#define _GNC_MOD_NAME GNC_TAXTABLE_MODULE_NAME +#define _GNC_MOD_NAME GNC_TAXTABLE_MODULE_NAME #define CACHE_INSERT(str) g_cache_insert(gnc_engine_get_string_cache(), (gpointer)(str)); #define CACHE_REMOVE(str) g_cache_remove(gnc_engine_get_string_cache(), (str)); #define SET_STR(obj, member, str) { \ - char * tmp; \ - \ - if (!safe_strcmp (member, str)) return; \ - gncTaxTableBeginEdit (obj); \ - tmp = CACHE_INSERT (str); \ - CACHE_REMOVE (member); \ - member = tmp; \ - } + char * tmp; \ + \ + if (!safe_strcmp (member, str)) return; \ + gncTaxTableBeginEdit (obj); \ + tmp = CACHE_INSERT (str); \ + CACHE_REMOVE (member); \ + member = tmp; \ + } static void add_or_rem_object (GncTaxTable *table, gboolean add); static void addObj (GncTaxTable *table); @@ -142,10 +141,10 @@ G_INLINE_FUNC void mark_table (GncTaxTable *table); G_INLINE_FUNC void mark_table (GncTaxTable *table) { - table->dirty = TRUE; - gncBusinessSetDirtyFlag (table->book, _GNC_MOD_NAME, TRUE); + table->inst.dirty = TRUE; + gncBusinessSetDirtyFlag (table->inst.book, _GNC_MOD_NAME, TRUE); - gnc_engine_generate_event (&table->guid, _GNC_MOD_NAME, GNC_EVENT_MODIFY); + gnc_engine_generate_event (&table->inst.guid, _GNC_MOD_NAME, GNC_EVENT_MODIFY); } G_INLINE_FUNC void mod_table (GncTaxTable *table); @@ -162,19 +161,18 @@ GncTaxTable * gncTaxTableCreate (QofBook *book) if (!book) return NULL; table = g_new0 (GncTaxTable, 1); - table->book = book; + qof_instance_init (&table->inst, book); table->name = CACHE_INSERT (""); - qof_entity_guid_new (qof_book_get_entity_table (book), &table->guid); addObj (table); - gnc_engine_generate_event (&table->guid, _GNC_MOD_NAME, GNC_EVENT_CREATE); + gnc_engine_generate_event (&table->inst.guid, _GNC_MOD_NAME, GNC_EVENT_CREATE); return table; } void gncTaxTableDestroy (GncTaxTable *table) { if (!table) return; - table->do_free = TRUE; - gncBusinessSetDirtyFlag (table->book, _GNC_MOD_NAME, TRUE); + table->inst.do_free = TRUE; + gncBusinessSetDirtyFlag (table->inst.book, _GNC_MOD_NAME, TRUE); gncTaxTableCommitEdit (table); } @@ -185,7 +183,7 @@ static void gncTaxTableFree (GncTaxTable *table) if (!table) return; - gnc_engine_generate_event (&table->guid, _GNC_MOD_NAME, GNC_EVENT_DESTROY); + gnc_engine_generate_event (&table->inst.guid, _GNC_MOD_NAME, GNC_EVENT_DESTROY); CACHE_REMOVE (table->name); remObj (table); @@ -194,7 +192,7 @@ static void gncTaxTableFree (GncTaxTable *table) gncTaxTableEntryDestroy (list->data); g_list_free (table->entries); - if (!table->do_free) + if (!table->inst.do_free) PERR("free a taxtable without do_free set!"); /* disconnect from parent */ @@ -208,6 +206,7 @@ static void gncTaxTableFree (GncTaxTable *table) } g_list_free(table->children); + qof_instance_release (&table->inst); g_free (table); } @@ -216,7 +215,7 @@ gncTaxTableAddChild (GncTaxTable *table, GncTaxTable *child) { g_return_if_fail(table); g_return_if_fail(child); - g_return_if_fail(table->do_free == FALSE); + g_return_if_fail(table->inst.do_free == FALSE); table->children = g_list_prepend(table->children, child); } @@ -227,8 +226,7 @@ gncTaxTableRemoveChild (GncTaxTable *table, GncTaxTable *child) g_return_if_fail(table); g_return_if_fail(child); - if (table->do_free) - return; + if (table->inst.do_free) return; table->children = g_list_remove(table->children, child); } @@ -252,11 +250,12 @@ void gncTaxTableEntryDestroy (GncTaxTableEntry *entry) void gncTaxTableSetGUID (GncTaxTable *table, const GUID *guid) { if (!table || !guid) return; - if (guid_equal (guid, &table->guid)) return; + if (guid_equal (guid, &table->inst.guid)) return; + /* XXX this looks fishy to me ... guid is deep not shallow */ gncTaxTableBeginEdit (table); remObj (table); - table->guid = *guid; + table->inst.guid = *guid; addObj (table); gncTaxTableCommitEdit (table); } @@ -295,7 +294,7 @@ void gncTaxTableSetChild (GncTaxTable *table, GncTaxTable *child) void gncTaxTableIncRef (GncTaxTable *table) { if (!table) return; - if (table->parent || table->invisible) return; /* children dont need refcounts */ + if (table->parent || table->invisible) return; /* children dont need refcounts */ gncTaxTableBeginEdit (table); table->refcount++; gncTaxTableCommitEdit (table); @@ -304,7 +303,7 @@ void gncTaxTableIncRef (GncTaxTable *table) void gncTaxTableDecRef (GncTaxTable *table) { if (!table) return; - if (table->parent || table->invisible) return; /* children dont need refcounts */ + if (table->parent || table->invisible) return; /* children dont need refcounts */ gncTaxTableBeginEdit (table); table->refcount--; g_return_if_fail (table->refcount >= 0); @@ -370,7 +369,7 @@ void gncTaxTableAddEntry (GncTaxTable *table, GncTaxTableEntry *entry) entry->table = table; table->entries = g_list_insert_sorted (table->entries, entry, - (GCompareFunc)gncTaxTableEntryCompare); + (GCompareFunc)gncTaxTableEntryCompare); mark_table (table); mod_table (table); gncTaxTableCommitEdit (table); @@ -397,24 +396,30 @@ void gncTaxTableChanged (GncTaxTable *table) void gncTaxTableBeginEdit (GncTaxTable *table) { - GNC_BEGIN_EDIT (table, _GNC_MOD_NAME); + GNC_BEGIN_EDIT (&table->inst, _GNC_MOD_NAME); } -static void gncTaxTableOnError (GncTaxTable *table, QofBackendError errcode) +static void gncTaxTableOnError (QofInstance *inst, QofBackendError errcode) { PERR("TaxTable QofBackend Failure: %d", errcode); } -static void gncTaxTableOnDone (GncTaxTable *table) +static void gncTaxTableOnDone (QofInstance *inst) { - table->dirty = FALSE; + inst->dirty = FALSE; +} + +static void table_free (QofInstance *inst) +{ + GncTaxTable *table = (GncTaxTable *) inst; + gncTaxTableFree (table); } void gncTaxTableCommitEdit (GncTaxTable *table) { - GNC_COMMIT_EDIT_PART1 (table); - GNC_COMMIT_EDIT_PART2 (table, _GNC_MOD_NAME, gncTaxTableOnError, - gncTaxTableOnDone, gncTaxTableFree); + GNC_COMMIT_EDIT_PART1 (&table->inst); + GNC_COMMIT_EDIT_PART2 (&table->inst, _GNC_MOD_NAME, gncTaxTableOnError, + gncTaxTableOnDone, table_free); } @@ -423,7 +428,7 @@ GncTaxTable * gncTaxTableLookup (QofBook *book, const GUID *guid) { if (!book || !guid) return NULL; return qof_entity_lookup (gnc_book_get_entity_table (book), - guid, _GNC_MOD_NAME); + guid, _GNC_MOD_NAME); } GncTaxTable *gncTaxTableLookupByName (QofBook *book, const char *name) @@ -447,19 +452,6 @@ GList * gncTaxTableGetTables (QofBook *book) return bi->tables; } - -const GUID *gncTaxTableGetGUID (GncTaxTable *table) -{ - if (!table) return NULL; - return &table->guid; -} - -QofBook *gncTaxTableGetBook (GncTaxTable *table) -{ - if (!table) return NULL; - return table->book; -} - const char *gncTaxTableGetName (GncTaxTable *table) { if (!table) return NULL; @@ -485,7 +477,7 @@ static GncTaxTable *gncTaxTableCopy (GncTaxTable *table) GList *list; if (!table) return NULL; - t = gncTaxTableCreate (table->book); + t = gncTaxTableCreate (table->inst.book); gncTaxTableSetName (t, table->name); for (list = table->entries; list; list=list->next) { GncTaxTableEntry *entry, *e; @@ -608,7 +600,7 @@ GList *gncAccountValueAdd (GList *list, Account *acc, gnc_numeric value) res = li->data; if (res->account == acc) { res->value = gnc_numeric_add (res->value, value, GNC_DENOM_AUTO, - GNC_DENOM_LCD); + GNC_DENOM_LCD); return list; } } @@ -660,7 +652,7 @@ GUID gncTaxTableRetGUID (GncTaxTable *table) if (!table) return *guid_null(); - return table->guid; + return table->inst.guid; } GncTaxTable *gncTaxTableLookupDirect (GUID guid, QofBook *book) @@ -676,7 +668,7 @@ static void maybe_resort_list (GncTaxTable *table) struct _book_info *bi; if (table->parent || table->invisible) return; - bi = gnc_book_get_data (table->book, _GNC_MOD_NAME); + bi = gnc_book_get_data (table->inst.book, _GNC_MOD_NAME); bi->tables = g_list_sort (bi->tables, (GCompareFunc)gncTaxTableCompare); } @@ -685,24 +677,24 @@ static void add_or_rem_object (GncTaxTable *table, gboolean add) struct _book_info *bi; if (!table) return; - bi = gnc_book_get_data (table->book, _GNC_MOD_NAME); + bi = gnc_book_get_data (table->inst.book, _GNC_MOD_NAME); if (add) bi->tables = g_list_insert_sorted (bi->tables, table, - (GCompareFunc)gncTaxTableCompare); + (GCompareFunc)gncTaxTableCompare); else bi->tables = g_list_remove (bi->tables, table); } static void addObj (GncTaxTable *table) { - gncBusinessAddObject (table->book, _GNC_MOD_NAME, table, &table->guid); + gncBusinessAddObject (table->inst.book, _GNC_MOD_NAME, table, &table->inst.guid); add_or_rem_object (table, TRUE); } static void remObj (GncTaxTable *table) { - gncBusinessRemoveObject (table->book, _GNC_MOD_NAME, &table->guid); + gncBusinessRemoveObject (table->inst.book, _GNC_MOD_NAME, &table->inst.guid); add_or_rem_object (table, FALSE); } @@ -742,28 +734,29 @@ static void _gncTaxTableMarkClean (QofBook *book) } static void _gncTaxTableForeach (QofBook *book, QofEntityForeachCB cb, - gpointer user_data) + gpointer user_data) { gncBusinessForeach (book, _GNC_MOD_NAME, cb, user_data); } -static QofObject gncTaxTableDesc = { - QOF_OBJECT_VERSION, - _GNC_MOD_NAME, - "Tax Table", - _gncTaxTableCreate, - _gncTaxTableDestroy, - _gncTaxTableIsDirty, - _gncTaxTableMarkClean, - _gncTaxTableForeach, - NULL /* printable */ +static QofObject gncTaxTableDesc = +{ + interface_version: QOF_OBJECT_VERSION, + name: _GNC_MOD_NAME, + type_label: "Tax Table", + book_begin: _gncTaxTableCreate, + book_end: _gncTaxTableDestroy, + is_dirty: _gncTaxTableIsDirty, + mark_clean: _gncTaxTableMarkClean, + foreach: _gncTaxTableForeach, + printable: NULL }; gboolean gncTaxTableRegister (void) { static QofParam params[] = { - { QOF_QUERY_PARAM_BOOK, QOF_ID_BOOK, (QofAccessFunc)gncTaxTableGetBook, NULL }, - { QOF_QUERY_PARAM_GUID, QOF_TYPE_GUID, (QofAccessFunc)gncTaxTableGetGUID, NULL }, + { QOF_QUERY_PARAM_BOOK, QOF_ID_BOOK, (QofAccessFunc)qof_instance_get_book, NULL }, + { QOF_QUERY_PARAM_GUID, QOF_TYPE_GUID, (QofAccessFunc)qof_instance_get_guid, NULL }, { NULL }, }; diff --git a/src/business/business-core/gncTaxTable.h b/src/business/business-core/gncTaxTable.h index a454192b3b..2a2592c5fd 100644 --- a/src/business/business-core/gncTaxTable.h +++ b/src/business/business-core/gncTaxTable.h @@ -11,10 +11,12 @@ typedef struct _gncTaxTable GncTaxTable; typedef struct _gncTaxTableEntry GncTaxTableEntry; typedef struct _gncAccountValue GncAccountValue; -#include "gnc-numeric.h" -#include "gnc-book.h" -#include "gnc-date.h" #include "Account.h" +#include "gnc-date.h" +#include "gnc-numeric.h" + +#include "qofbook.h" +#include "qofinstance.h" #define GNC_TAXTABLE_MODULE_NAME "gncTaxTable" @@ -67,8 +69,6 @@ GncTaxTable *gncTaxTableLookup (QofBook *book, const GUID *guid); GncTaxTable *gncTaxTableLookupByName (QofBook *book, const char *name); GList * gncTaxTableGetTables (QofBook *book); -const GUID *gncTaxTableGetGUID (GncTaxTable *table); -QofBook *gncTaxTableGetBook (GncTaxTable *table); const char *gncTaxTableGetName (GncTaxTable *table); GncTaxTable *gncTaxTableGetParent (GncTaxTable *table); GncTaxTable *gncTaxTableReturnChild (GncTaxTable *table, gboolean make_new); @@ -110,4 +110,7 @@ gnc_numeric gncAccountValueTotal (GList *list); void gncAccountValueDestroy (GList *list); +/** deprecated routine */ +#define gncTaxTableGetGUID(x) qof_instance_get_guid(QOF_INSTANCE(x)) + #endif /* GNC_TAXTABLE_H_ */