[Gnucash-changes] r13749 - gnucash/trunk/src - Explicitly including glib.h instead of relying on libqof to reduce dependency problems.

Neil Williams codehelp at cvs.gnucash.org
Fri Apr 7 14:51:53 EDT 2006


Author: codehelp
Date: 2006-04-07 14:51:52 -0400 (Fri, 07 Apr 2006)
New Revision: 13749
Trac: http://svn.gnucash.org/trac/changeset/13749

Modified:
   gnucash/trunk/src/backend/file/sixtp-utils.c
   gnucash/trunk/src/backend/file/test/test-load-backend.c
   gnucash/trunk/src/business/business-core/gncBusGuile.c
   gnucash/trunk/src/business/business-core/gw-business-core-spec.scm
   gnucash/trunk/src/business/dialog-tax-table/gw-dialog-tax-table-spec.scm
   gnucash/trunk/src/engine/Account.c
   gnucash/trunk/src/engine/Period.c
   gnucash/trunk/src/engine/SchedXaction.c
   gnucash/trunk/src/engine/Transaction.c
   gnucash/trunk/src/engine/engine-helpers.c
   gnucash/trunk/src/engine/gnc-associate-account.c
   gnucash/trunk/src/engine/gnc-commodity.c
   gnucash/trunk/src/engine/gnc-engine.c
   gnucash/trunk/src/engine/gnc-lot.c
   gnucash/trunk/src/engine/gnc-pricedb.c
   gnucash/trunk/src/engine/gnc-session.c
   gnucash/trunk/src/engine/gw-kvp-spec.scm
   gnucash/trunk/src/engine/kvp-scm.c
   gnucash/trunk/src/engine/test/test-load-engine.c
   gnucash/trunk/src/gnome-utils/QuickFill.c
   gnucash/trunk/src/register/ledger-core/gnc-ledger-display.c
Log:
Explicitly including glib.h instead of relying on libqof to reduce dependency problems.

Modified: gnucash/trunk/src/backend/file/sixtp-utils.c
===================================================================
--- gnucash/trunk/src/backend/file/sixtp-utils.c	2006-04-07 18:50:45 UTC (rev 13748)
+++ gnucash/trunk/src/backend/file/sixtp-utils.c	2006-04-07 18:51:52 UTC (rev 13749)
@@ -220,7 +220,7 @@
   g_return_val_if_fail(str, FALSE);
   
   /* must use "<" here because %n's effects aren't well defined */
-  if(sscanf(str, " " GNC_SCANF_LLD "%n", &v_in, &num_read) < 1) {
+  if(sscanf(str, " %" G_GINT64_FORMAT "%n", &v_in, &num_read) < 1) {
     return(FALSE);
   }
 

Modified: gnucash/trunk/src/backend/file/test/test-load-backend.c
===================================================================
--- gnucash/trunk/src/backend/file/test/test-load-backend.c	2006-04-07 18:50:45 UTC (rev 13748)
+++ gnucash/trunk/src/backend/file/test/test-load-backend.c	2006-04-07 18:51:52 UTC (rev 13749)
@@ -25,6 +25,7 @@
  *  02110-1301, USA.
  */
  
+#include <glib.h>
 #include "qof.h"
 #include "cashobjects.h"
 #include "test-stuff.h"

Modified: gnucash/trunk/src/business/business-core/gncBusGuile.c
===================================================================
--- gnucash/trunk/src/business/business-core/gncBusGuile.c	2006-04-07 18:50:45 UTC (rev 13748)
+++ gnucash/trunk/src/business/business-core/gncBusGuile.c	2006-04-07 18:51:52 UTC (rev 13749)
@@ -22,7 +22,7 @@
  */
 
 #include "config.h"
-
+#include <glib.h>
 #include "gncBusGuile.h"
 #include "engine-helpers.h"
 #include <g-wrap-wct.h>

Modified: gnucash/trunk/src/business/business-core/gw-business-core-spec.scm
===================================================================
--- gnucash/trunk/src/business/business-core/gw-business-core-spec.scm	2006-04-07 18:50:45 UTC (rev 13748)
+++ gnucash/trunk/src/business/business-core/gw-business-core-spec.scm	2006-04-07 18:51:52 UTC (rev 13749)
@@ -34,6 +34,7 @@
    ws
    (lambda (wrapset client-wrapset)
      (list
+      "#include <glib.h>\n"
       "#include <gncAddress.h>\n"
       "#include <gncBillTerm.h>\n"
       "#include <gncCustomer.h>\n"

Modified: gnucash/trunk/src/business/dialog-tax-table/gw-dialog-tax-table-spec.scm
===================================================================
--- gnucash/trunk/src/business/dialog-tax-table/gw-dialog-tax-table-spec.scm	2006-04-07 18:50:45 UTC (rev 13748)
+++ gnucash/trunk/src/business/dialog-tax-table/gw-dialog-tax-table-spec.scm	2006-04-07 18:51:52 UTC (rev 13749)
@@ -33,6 +33,7 @@
    (lambda (wrapset client-wrapset)
      (list
       "#include <config.h>\n"
+      "#include <glib.h>\n"
       "#include <dialog-tax-table.h>\n"
       )))
 

Modified: gnucash/trunk/src/engine/Account.c
===================================================================
--- gnucash/trunk/src/engine/Account.c	2006-04-07 18:50:45 UTC (rev 13748)
+++ gnucash/trunk/src/engine/Account.c	2006-04-07 18:51:52 UTC (rev 13749)
@@ -126,9 +126,9 @@
 
   acc->type = NO_TYPE;
 
-  acc->accountName = CACHE_INSERT("");
-  acc->accountCode = CACHE_INSERT("");
-  acc->description = CACHE_INSERT("");
+  acc->accountName = QOF_CACHE_NEW();
+  acc->accountCode = QOF_CACHE_NEW();
+  acc->description = QOF_CACHE_NEW();
 
   acc->idata = 0;
 
@@ -999,7 +999,8 @@
   }
 
   /* Otherwise do a string sort */
-  SAFE_STRCMP (da, db);
+  safe_strcmp (da, db);
+/*  SAFE_STRCMP (da, db);*/
 
   /* if acccount-type-order array not initialized, initialize it */
   /* this will happen at most once during program invocation */

Modified: gnucash/trunk/src/engine/Period.c
===================================================================
--- gnucash/trunk/src/engine/Period.c	2006-04-07 18:50:45 UTC (rev 13748)
+++ gnucash/trunk/src/engine/Period.c	2006-04-07 18:51:52 UTC (rev 13749)
@@ -33,6 +33,7 @@
  * Copyright (c) 2001-2003 Linas Vepstas <linas at linas.org>
  */
 
+#include <glib.h>
 #include "AccountP.h"
 #include "qof.h"
 #include "gnc-lot.h"

Modified: gnucash/trunk/src/engine/SchedXaction.c
===================================================================
--- gnucash/trunk/src/engine/SchedXaction.c	2006-04-07 18:50:45 UTC (rev 13748)
+++ gnucash/trunk/src/engine/SchedXaction.c	2006-04-07 18:51:52 UTC (rev 13749)
@@ -31,7 +31,6 @@
 
 #include "FreqSpec.h"
 #include "Account.h"
-#include "gnc-book.h"
 #include "Group.h"
 #include "GroupP.h"
 #include "SX-book.h"

Modified: gnucash/trunk/src/engine/Transaction.c
===================================================================
--- gnucash/trunk/src/engine/Transaction.c	2006-04-07 18:50:45 UTC (rev 13748)
+++ gnucash/trunk/src/engine/Transaction.c	2006-04-07 18:51:52 UTC (rev 13749)
@@ -242,8 +242,8 @@
 {
   ENTER ("trans=%p", trans);
   /* Fill in some sane defaults */
-  trans->num         = gnc_string_cache_insert("");
-  trans->description = gnc_string_cache_insert("");
+  trans->num         = QOF_CACHE_NEW();
+  trans->description = QOF_CACHE_NEW();
 
   trans->common_currency = NULL;
   trans->splits = NULL;
@@ -358,8 +358,8 @@
 
   trans = g_new0 (Transaction, 1);
 
-  trans->num         = gnc_string_cache_insert (t->num);
-  trans->description = gnc_string_cache_insert (t->description);
+  trans->num         = qof_util_string_cache_insert (t->num);
+  trans->description = qof_util_string_cache_insert (t->description);
 
   trans->splits = g_list_copy (t->splits);
   for (node = trans->splits; node; node = node->next)
@@ -405,8 +405,8 @@
 
   trans->date_entered    = t->date_entered;
   trans->date_posted     = t->date_posted;
-  trans->num             = gnc_string_cache_insert (t->num);
-  trans->description     = gnc_string_cache_insert (t->description);
+  trans->num             = qof_util_string_cache_insert (t->num);
+  trans->description     = qof_util_string_cache_insert (t->description);
   trans->common_currency = t->common_currency;
   trans->version         = t->version;
   trans->version_check   = t->version_check;
@@ -458,8 +458,8 @@
   trans->splits = NULL;
 
   /* free up transaction strings */
-  gnc_string_cache_remove(trans->num);
-  gnc_string_cache_remove(trans->description);
+  qof_util_string_cache_remove(trans->num);
+  qof_util_string_cache_remove(trans->description);
 
   /* Just in case someone looks up freed memory ... */
   trans->num         = (char *) 1;

Modified: gnucash/trunk/src/engine/engine-helpers.c
===================================================================
--- gnucash/trunk/src/engine/engine-helpers.c	2006-04-07 18:50:45 UTC (rev 13748)
+++ gnucash/trunk/src/engine/engine-helpers.c	2006-04-07 18:51:52 UTC (rev 13749)
@@ -27,7 +27,7 @@
 #include <g-wrap-wct.h>
 #include <libguile.h>
 #include <string.h>
-
+#include <glib.h>
 #include "Account.h"
 #include "Group.h"
 #include "engine-helpers.h"

Modified: gnucash/trunk/src/engine/gnc-associate-account.c
===================================================================
--- gnucash/trunk/src/engine/gnc-associate-account.c	2006-04-07 18:50:45 UTC (rev 13748)
+++ gnucash/trunk/src/engine/gnc-associate-account.c	2006-04-07 18:51:52 UTC (rev 13749)
@@ -27,7 +27,7 @@
 \********************************************************************/
 
 #include "config.h"
-
+#include <glib.h>
 #include "AccountP.h"
 #include "gnc-associate-account.h"
 #include "gnc-engine.h"

Modified: gnucash/trunk/src/engine/gnc-commodity.c
===================================================================
--- gnucash/trunk/src/engine/gnc-commodity.c	2006-04-07 18:50:45 UTC (rev 13748)
+++ gnucash/trunk/src/engine/gnc-commodity.c	2006-04-07 18:51:52 UTC (rev 13749)
@@ -1239,7 +1239,7 @@
   PINFO ("insert %p %s into nsp=%p %s", comm->mnemonic, comm->mnemonic,
          nsp->cm_table, nsp->name);
   g_hash_table_insert(nsp->cm_table, 
-                      gnc_string_cache_insert(comm->mnemonic),
+                      qof_util_string_cache_insert(comm->mnemonic),
                       (gpointer)comm);
   nsp->cm_list = g_list_append(nsp->cm_list, comm);
 
@@ -1482,7 +1482,7 @@
   {
     ns = g_new0(gnc_commodity_namespace, 1);
     ns->cm_table = g_hash_table_new(g_str_hash, g_str_equal);
-    ns->name = gnc_string_cache_insert((gpointer)namespace);
+    ns->name = qof_util_string_cache_insert((gpointer)namespace);
     ns->iso4217 = gnc_commodity_namespace_is_iso(namespace);
     qof_instance_init (&ns->inst, GNC_ID_COMMODITY_NAMESPACE, book);
     qof_event_gen (&ns->inst.entity, QOF_EVENT_CREATE, NULL);
@@ -1539,7 +1539,7 @@
 {
   gnc_commodity * c = value;
   gnc_commodity_destroy(c);
-  gnc_string_cache_remove(key);  /* key is commodity mnemonic */
+  qof_util_string_cache_remove(key);  /* key is commodity mnemonic */
   return TRUE;
 }
 
@@ -1564,7 +1564,7 @@
 
   g_hash_table_foreach_remove(ns->cm_table, ns_helper, NULL);
   g_hash_table_destroy(ns->cm_table);
-  gnc_string_cache_remove(ns->name);
+  qof_util_string_cache_remove(ns->name);
 
   qof_event_gen (&ns->inst.entity, QOF_EVENT_DESTROY, NULL);
   qof_instance_release(&ns->inst);

Modified: gnucash/trunk/src/engine/gnc-engine.c
===================================================================
--- gnucash/trunk/src/engine/gnc-engine.c	2006-04-07 18:50:45 UTC (rev 13748)
+++ gnucash/trunk/src/engine/gnc-engine.c	2006-04-07 18:51:52 UTC (rev 13749)
@@ -119,11 +119,8 @@
 void
 gnc_engine_shutdown (void)
 {
-  qof_query_shutdown ();
-  qof_object_shutdown ();
-  guid_shutdown();
-  gnc_engine_string_cache_destroy ();
   qof_log_shutdown();
+  qof_close();
   engine_is_initialized = 0;
 }
 

Modified: gnucash/trunk/src/engine/gnc-lot.c
===================================================================
--- gnucash/trunk/src/engine/gnc-lot.c	2006-04-07 18:50:45 UTC (rev 13748)
+++ gnucash/trunk/src/engine/gnc-lot.c	2006-04-07 18:51:52 UTC (rev 13749)
@@ -39,6 +39,7 @@
  * Copyright (c) 2002,2003 Linas Vepstas <linas at linas.org>
  */
 
+#include <glib.h>
 #include "Account.h"
 #include "gnc-lot.h"
 #include "gnc-lot-p.h"

Modified: gnucash/trunk/src/engine/gnc-pricedb.c
===================================================================
--- gnucash/trunk/src/engine/gnc-pricedb.c	2006-04-07 18:50:45 UTC (rev 13748)
+++ gnucash/trunk/src/engine/gnc-pricedb.c	2006-04-07 18:51:52 UTC (rev 13749)
@@ -67,8 +67,8 @@
   ENTER(" ");
   qof_event_gen (&p->inst.entity, QOF_EVENT_DESTROY, NULL);
 
-  if(p->type) gnc_string_cache_remove(p->type);
-  if(p->source) gnc_string_cache_remove(p->source);
+  if(p->type) qof_util_string_cache_remove(p->type);
+  if(p->source) qof_util_string_cache_remove(p->source);
 
   qof_instance_release (&p->inst);
   memset(p, 0, sizeof(GNCPrice));
@@ -260,8 +260,8 @@
     char *tmp;
 
     gnc_price_begin_edit (p);
-    tmp = gnc_string_cache_insert((gpointer) s);
-    if(p->source) gnc_string_cache_remove(p->source);
+    tmp = qof_util_string_cache_insert((gpointer) s);
+    if(p->source) qof_util_string_cache_remove(p->source);
     p->source = tmp;
     gnc_price_set_dirty(p);
     gnc_price_commit_edit (p);
@@ -277,8 +277,8 @@
     gchar *tmp;
 
     gnc_price_begin_edit (p);
-    tmp = gnc_string_cache_insert((gpointer) type);
-    if(p->type) gnc_string_cache_remove(p->type);
+    tmp = qof_util_string_cache_insert((gpointer) type);
+    if(p->type) qof_util_string_cache_remove(p->type);
     p->type = tmp;
     gnc_price_set_dirty(p);
     gnc_price_commit_edit (p);

Modified: gnucash/trunk/src/engine/gnc-session.c
===================================================================
--- gnucash/trunk/src/engine/gnc-session.c	2006-04-07 18:50:45 UTC (rev 13748)
+++ gnucash/trunk/src/engine/gnc-session.c	2006-04-07 18:51:52 UTC (rev 13749)
@@ -22,6 +22,7 @@
  */
 
 #include "config.h"
+#include <glib.h>
 #include "qof.h"
 #include "gnc-session.h"
 #include "gnc-engine.h"

Modified: gnucash/trunk/src/engine/gw-kvp-spec.scm
===================================================================
--- gnucash/trunk/src/engine/gw-kvp-spec.scm	2006-04-07 18:50:45 UTC (rev 13748)
+++ gnucash/trunk/src/engine/gw-kvp-spec.scm	2006-04-07 18:51:52 UTC (rev 13749)
@@ -26,6 +26,7 @@
    ws
    (lambda (wrapset client-wrapset)
      (list
+      "#include <glib.h>\n"
       "#include <qof.h>\n"
       "#include <kvp-scm.h>\n"
       "#include <Transaction.h>\n")))

Modified: gnucash/trunk/src/engine/kvp-scm.c
===================================================================
--- gnucash/trunk/src/engine/kvp-scm.c	2006-04-07 18:50:45 UTC (rev 13748)
+++ gnucash/trunk/src/engine/kvp-scm.c	2006-04-07 18:51:52 UTC (rev 13749)
@@ -1,5 +1,5 @@
 #include "config.h"
-
+#include <glib.h>
 #include <kvp_frame.h>
 #include <g-wrap-wct.h>
 #include <libguile.h>

Modified: gnucash/trunk/src/engine/test/test-load-engine.c
===================================================================
--- gnucash/trunk/src/engine/test/test-load-engine.c	2006-04-07 18:50:45 UTC (rev 13748)
+++ gnucash/trunk/src/engine/test/test-load-engine.c	2006-04-07 18:51:52 UTC (rev 13749)
@@ -23,6 +23,7 @@
  
 #include <stdio.h>
 #include <stdlib.h>
+#include <glib.h>
 #include "qof.h"
 #include "cashobjects.h"
 #include "test-stuff.h"

Modified: gnucash/trunk/src/gnome-utils/QuickFill.c
===================================================================
--- gnucash/trunk/src/gnome-utils/QuickFill.c	2006-04-07 18:50:45 UTC (rev 13748)
+++ gnucash/trunk/src/gnome-utils/QuickFill.c	2006-04-07 18:51:52 UTC (rev 13749)
@@ -111,7 +111,7 @@
   qf->matches = NULL;
 
   if (qf->text)
-    gnc_string_cache_remove(qf->text);
+    qof_util_string_cache_remove(qf->text);
   qf->text = NULL;
   qf->len = 0;
 
@@ -127,7 +127,7 @@
   g_hash_table_foreach_remove (qf->matches, destroy_helper, NULL);
 
   if (qf->text)
-    gnc_string_cache_remove (qf->text);
+    qof_util_string_cache_remove (qf->text);
   qf->text = NULL;
   qf->len = 0;
 }
@@ -302,7 +302,7 @@
       /* If there's no string there already, just put the new one in. */
       if (old_text == NULL)
       {
-        match_qf->text = gnc_string_cache_insert((gpointer) text);
+        match_qf->text = qof_util_string_cache_insert((gpointer) text);
         match_qf->len = len;
         break;
       }
@@ -312,8 +312,8 @@
           (strncmp(text, old_text, strlen(old_text)) == 0))
         break;
 
-      gnc_string_cache_remove(old_text);
-      match_qf->text = gnc_string_cache_insert((gpointer) text);
+      qof_util_string_cache_remove(old_text);
+      match_qf->text = qof_util_string_cache_insert((gpointer) text);
       match_qf->len = len;
       break;
   }

Modified: gnucash/trunk/src/register/ledger-core/gnc-ledger-display.c
===================================================================
--- gnucash/trunk/src/register/ledger-core/gnc-ledger-display.c	2006-04-07 18:50:45 UTC (rev 13748)
+++ gnucash/trunk/src/register/ledger-core/gnc-ledger-display.c	2006-04-07 18:51:52 UTC (rev 13749)
@@ -24,7 +24,7 @@
 #include "config.h"
 
 #include <time.h>
-
+#include <glib.h>
 #include "Account.h"
 #include "Group.h"
 #include "Query.h"



More information about the gnucash-changes mailing list