Explicitly including glib.h instead of relying on libqof to reduce dependency problems.

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13749 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Neil Williams
2006-04-07 18:51:52 +00:00
parent 26a4051c70
commit 66a9c0b6ac
21 changed files with 43 additions and 38 deletions

View File

@@ -220,7 +220,7 @@ string_to_gint64(const gchar *str, gint64 *v)
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);
}

View File

@@ -25,6 +25,7 @@
* 02110-1301, USA.
*/
#include <glib.h>
#include "qof.h"
#include "cashobjects.h"
#include "test-stuff.h"

View File

@@ -22,7 +22,7 @@
*/
#include "config.h"
#include <glib.h>
#include "gncBusGuile.h"
#include "engine-helpers.h"
#include <g-wrap-wct.h>

View File

@@ -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"

View File

@@ -33,6 +33,7 @@
(lambda (wrapset client-wrapset)
(list
"#include <config.h>\n"
"#include <glib.h>\n"
"#include <dialog-tax-table.h>\n"
)))

View File

@@ -126,9 +126,9 @@ xaccInitAccount (Account * acc, QofBook *book)
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 @@ xaccAccountOrder (const Account **aa, const Account **ab)
}
/* 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 */

View File

@@ -33,6 +33,7 @@
* Copyright (c) 2001-2003 Linas Vepstas <linas@linas.org>
*/
#include <glib.h>
#include "AccountP.h"
#include "qof.h"
#include "gnc-lot.h"

View File

@@ -31,7 +31,6 @@
#include "FreqSpec.h"
#include "Account.h"
#include "gnc-book.h"
#include "Group.h"
#include "GroupP.h"
#include "SX-book.h"

View File

@@ -242,8 +242,8 @@ xaccInitTransaction (Transaction * trans, QofBook *book)
{
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 @@ xaccDupeTransaction (const Transaction *t)
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 @@ xaccTransClone (const Transaction *t)
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 @@ xaccFreeTransaction (Transaction *trans)
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;

View File

@@ -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"

View File

@@ -27,7 +27,7 @@
\********************************************************************/
#include "config.h"
#include <glib.h>
#include "AccountP.h"
#include "gnc-associate-account.h"
#include "gnc-engine.h"

View File

@@ -1239,7 +1239,7 @@ gnc_commodity_table_insert(gnc_commodity_table * table,
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 @@ gnc_commodity_table_add_namespace(gnc_commodity_table * table,
{
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 @@ ns_helper(gpointer key, gpointer value, gpointer user_data)
{
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 @@ gnc_commodity_table_delete_namespace(gnc_commodity_table * table,
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);

View File

@@ -119,11 +119,8 @@ gnc_engine_init(int argc, char ** argv)
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;
}

View File

@@ -39,6 +39,7 @@
* Copyright (c) 2002,2003 Linas Vepstas <linas@linas.org>
*/
#include <glib.h>
#include "Account.h"
#include "gnc-lot.h"
#include "gnc-lot-p.h"

View File

@@ -67,8 +67,8 @@ gnc_price_destroy (GNCPrice *p)
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 @@ gnc_price_set_source(GNCPrice *p, const char *s)
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 @@ gnc_price_set_type(GNCPrice *p, const char* type)
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);

View File

@@ -22,6 +22,7 @@
*/
#include "config.h"
#include <glib.h>
#include "qof.h"
#include "gnc-session.h"
#include "gnc-engine.h"

View File

@@ -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")))

View File

@@ -1,5 +1,5 @@
#include "config.h"
#include <glib.h>
#include <kvp_frame.h>
#include <g-wrap-wct.h>
#include <libguile.h>

View File

@@ -23,6 +23,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <glib.h>
#include "qof.h"
#include "cashobjects.h"
#include "test-stuff.h"

View File

@@ -111,7 +111,7 @@ gnc_quickfill_destroy (QuickFill *qf)
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 @@ gnc_quickfill_purge (QuickFill *qf)
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 @@ quickfill_insert_recursive (QuickFill *qf, const char *text, int depth,
/* 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 @@ quickfill_insert_recursive (QuickFill *qf, const char *text, int depth,
(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;
}

View File

@@ -24,7 +24,7 @@
#include "config.h"
#include <time.h>
#include <glib.h>
#include "Account.h"
#include "Group.h"
#include "Query.h"