port to qof

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@8766 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Linas Vepstas 2003-06-27 03:05:25 +00:00
parent 2db5c5e973
commit 31b3a0284c
30 changed files with 249 additions and 249 deletions

View File

@ -27,9 +27,7 @@
#include <string.h> #include <string.h>
#include <g-wrap-wct.h> #include <g-wrap-wct.h>
#include "Backend.h"
#include "global-options.h" #include "global-options.h"
#include "gnc-book.h"
#include "gnc-commodity.h" #include "gnc-commodity.h"
#include "gnc-component-manager.h" #include "gnc-component-manager.h"
#include "gnc-engine-util.h" #include "gnc-engine-util.h"
@ -39,9 +37,11 @@
#include "gnc-file-history.h" #include "gnc-file-history.h"
#include "gnc-file-p.h" #include "gnc-file-p.h"
#include "gnc-gui-query.h" #include "gnc-gui-query.h"
#include "gnc-session.h"
#include "gnc-ui.h" #include "gnc-ui.h"
#include "gnc-ui-util.h" #include "gnc-ui-util.h"
#include "qofbackend.h"
#include "qofbook.h"
#include "qofsession.h"
#include "messages.h" #include "messages.h"
/** GLOBALS *********************************************************/ /** GLOBALS *********************************************************/
@ -78,11 +78,11 @@ void
gnc_file_init (void) gnc_file_init (void)
{ {
/* Make sure we have a current session. */ /* Make sure we have a current session. */
gnc_get_current_session (); qof_session_get_current_session ();
} }
static gboolean static gboolean
show_session_error (GNCBackendError io_error, const char *newfile) show_session_error (QofBackendError io_error, const char *newfile)
{ {
gboolean uh_oh = TRUE; gboolean uh_oh = TRUE;
const char *fmt; const char *fmt;
@ -222,7 +222,7 @@ show_session_error (GNCBackendError io_error, const char *newfile)
} }
static void static void
gnc_add_history (GNCSession * session) gnc_add_history (QofSession * session)
{ {
char *url; char *url;
char *file; char *file;
@ -230,7 +230,7 @@ gnc_add_history (GNCSession * session)
if (!session) return; if (!session) return;
if (!history_add_file_func) return; if (!history_add_file_func) return;
url = xaccResolveURL (gnc_session_get_url (session)); url = xaccResolveURL (qof_session_get_url (session));
if (!url) if (!url)
return; return;
@ -247,7 +247,7 @@ gnc_add_history (GNCSession * session)
static void static void
gnc_book_opened (void) gnc_book_opened (void)
{ {
GNCSession *session = gnc_get_current_session(); QofSession *session = qof_session_get_current_session();
scm_call_2 (scm_c_eval_string("gnc:hook-run-danglers"), scm_call_2 (scm_c_eval_string("gnc:hook-run-danglers"),
scm_c_eval_string("gnc:*book-opened-hook*"), scm_c_eval_string("gnc:*book-opened-hook*"),
(session ? (session ?
@ -258,14 +258,14 @@ gnc_book_opened (void)
void void
gnc_file_new (void) gnc_file_new (void)
{ {
GNCSession *session; QofSession *session;
/* If user attempts to start a new session before saving results of /* If user attempts to start a new session before saving results of
* the last one, prompt them to clean up their act. */ * the last one, prompt them to clean up their act. */
if (!gnc_file_query_save ()) if (!gnc_file_query_save ())
return; return;
session = gnc_get_current_session (); session = qof_session_get_current_session ();
/* close any ongoing file sessions, and free the accounts. /* close any ongoing file sessions, and free the accounts.
* disable events so we don't get spammed by redraws. */ * disable events so we don't get spammed by redraws. */
@ -278,10 +278,10 @@ gnc_file_new (void)
SCM_BOOL_F)); SCM_BOOL_F));
gnc_close_gui_component_by_session (session); gnc_close_gui_component_by_session (session);
gnc_session_destroy (session); qof_session_destroy (session);
/* start a new book */ /* start a new book */
gnc_get_current_session (); qof_session_get_current_session ();
scm_call_1(scm_c_eval_string("gnc:hook-run-danglers"), scm_call_1(scm_c_eval_string("gnc:hook-run-danglers"),
scm_c_eval_string("gnc:*new-book-hook*")); scm_c_eval_string("gnc:*new-book-hook*"));
@ -301,7 +301,7 @@ gnc_file_query_save (void)
* up the file-selection dialog, we don't blow em out of the water; * up the file-selection dialog, we don't blow em out of the water;
* instead, give them another chance to say "no" to the verify box. * instead, give them another chance to say "no" to the verify box.
*/ */
while (gnc_book_not_saved(gnc_session_get_book (gnc_get_current_session ()))) while (qof_book_not_saved(qof_session_get_book (qof_session_get_current_session ())))
{ {
GNCVerifyResult result; GNCVerifyResult result;
const char *message = _("Changes have been made since the last " const char *message = _("Changes have been made since the last "
@ -333,10 +333,10 @@ gnc_file_query_save (void)
static gboolean static gboolean
gnc_post_file_open (const char * filename) gnc_post_file_open (const char * filename)
{ {
GNCSession *current_session, *new_session; QofSession *current_session, *new_session;
gboolean uh_oh = FALSE; gboolean uh_oh = FALSE;
char * newfile; char * newfile;
GNCBackendError io_err = ERR_BACKEND_NO_ERR; QofBackendError io_err = ERR_BACKEND_NO_ERR;
if (!filename) return FALSE; if (!filename) return FALSE;
@ -357,21 +357,21 @@ gnc_post_file_open (const char * filename)
/* -------------- BEGIN CORE SESSION CODE ------------- */ /* -------------- BEGIN CORE SESSION CODE ------------- */
/* -- this code is almost identical in FileOpen and FileSaveAs -- */ /* -- this code is almost identical in FileOpen and FileSaveAs -- */
current_session = gnc_get_current_session(); current_session = qof_session_get_current_session();
scm_call_2(scm_c_eval_string("gnc:hook-run-danglers"), scm_call_2(scm_c_eval_string("gnc:hook-run-danglers"),
scm_c_eval_string("gnc:*book-closed-hook*"), scm_c_eval_string("gnc:*book-closed-hook*"),
(current_session ? (current_session ?
gw_wcp_assimilate_ptr (current_session, gw_wcp_assimilate_ptr (current_session,
scm_c_eval_string("<gnc:Session*>")) : scm_c_eval_string("<gnc:Session*>")) :
SCM_BOOL_F)); SCM_BOOL_F));
gnc_session_destroy (current_session); qof_session_destroy (current_session);
/* load the accounts from the users datafile */ /* load the accounts from the users datafile */
/* but first, check to make sure we've got a session going. */ /* but first, check to make sure we've got a session going. */
new_session = gnc_session_new (); new_session = qof_session_new ();
gnc_session_begin (new_session, newfile, FALSE, FALSE); qof_session_begin (new_session, newfile, FALSE, FALSE);
io_err = gnc_session_get_error (new_session); io_err = qof_session_get_error (new_session);
/* if file appears to be locked, ask the user ... */ /* if file appears to be locked, ask the user ... */
if (ERR_BACKEND_LOCKED == io_err) if (ERR_BACKEND_LOCKED == io_err)
@ -400,7 +400,7 @@ gnc_post_file_open (const char * filename)
else if (rc == 1) else if (rc == 1)
{ {
/* user told us to ignore locks. So ignore them. */ /* user told us to ignore locks. So ignore them. */
gnc_session_begin (new_session, newfile, TRUE, FALSE); qof_session_begin (new_session, newfile, TRUE, FALSE);
} }
else else
{ {
@ -419,14 +419,14 @@ gnc_post_file_open (const char * filename)
if (FALSE == show_session_error (io_err, newfile)) if (FALSE == show_session_error (io_err, newfile))
{ {
/* user told us to create a new database. Do it. */ /* user told us to create a new database. Do it. */
gnc_session_begin (new_session, newfile, FALSE, TRUE); qof_session_begin (new_session, newfile, FALSE, TRUE);
} }
} }
/* Check for errors again, since above may have cleared the lock. /* Check for errors again, since above may have cleared the lock.
* If its still locked, still, doesn't exist, still too old, then * If its still locked, still, doesn't exist, still too old, then
* don't bother with the message, just die. */ * don't bother with the message, just die. */
io_err = gnc_session_get_error (new_session); io_err = qof_session_get_error (new_session);
if ((ERR_BACKEND_LOCKED == io_err) || if ((ERR_BACKEND_LOCKED == io_err) ||
(ERR_BACKEND_NO_SUCH_DB == io_err) || (ERR_BACKEND_NO_SUCH_DB == io_err) ||
(ERR_SQL_DB_TOO_OLD == io_err)) (ERR_SQL_DB_TOO_OLD == io_err))
@ -444,17 +444,17 @@ gnc_post_file_open (const char * filename)
if (file_percentage_func) { if (file_percentage_func) {
file_percentage_func(_("Reading file..."), 0.0); file_percentage_func(_("Reading file..."), 0.0);
gnc_session_load (new_session, file_percentage_func); qof_session_load (new_session, file_percentage_func);
file_percentage_func(NULL, -1.0); file_percentage_func(NULL, -1.0);
} else { } else {
gnc_session_load (new_session, NULL); qof_session_load (new_session, NULL);
} }
/* check for i/o error, put up appropriate error dialog */ /* check for i/o error, put up appropriate error dialog */
io_err = gnc_session_get_error (new_session); io_err = qof_session_get_error (new_session);
uh_oh = show_session_error (io_err, newfile); uh_oh = show_session_error (io_err, newfile);
new_group = gnc_book_get_group (gnc_session_get_book (new_session)); new_group = gnc_book_get_group (qof_session_get_book (new_session));
if (uh_oh) new_group = NULL; if (uh_oh) new_group = NULL;
/* Umm, came up empty-handed, but no error: /* Umm, came up empty-handed, but no error:
@ -470,7 +470,7 @@ gnc_post_file_open (const char * filename)
/* going down -- abandon ship */ /* going down -- abandon ship */
if (uh_oh) if (uh_oh)
{ {
gnc_session_destroy (new_session); qof_session_destroy (new_session);
/* well, no matter what, I think it's a good idea to have a /* well, no matter what, I think it's a good idea to have a
* topgroup around. For example, early in the gnucash startup * topgroup around. For example, early in the gnucash startup
@ -478,7 +478,7 @@ gnc_post_file_open (const char * filename)
* reason, we don't want to leave them high & dry without a * reason, we don't want to leave them high & dry without a
* topgroup, because if the user continues, then bad things will * topgroup, because if the user continues, then bad things will
* happen. */ * happen. */
gnc_get_current_session (); qof_session_get_current_session ();
g_free (newfile); g_free (newfile);
@ -492,7 +492,7 @@ gnc_post_file_open (const char * filename)
/* if we got to here, then we've successfully gotten a new session */ /* if we got to here, then we've successfully gotten a new session */
/* close up the old file session (if any) */ /* close up the old file session (if any) */
gnc_set_current_session(new_session); qof_session_set_current_session(new_session);
gnc_book_opened (); gnc_book_opened ();
@ -533,7 +533,7 @@ gnc_file_open (void)
* user fails to pick a file (by e.g. hitting the cancel button), we * user fails to pick a file (by e.g. hitting the cancel button), we
* might be left with a null topgroup, which leads to nastiness when * might be left with a null topgroup, which leads to nastiness when
* user goes to create their very first account. So create one. */ * user goes to create their very first account. So create one. */
gnc_get_current_session (); qof_session_get_current_session ();
return result; return result;
} }
@ -552,9 +552,9 @@ gnc_file_open_file (const char * newfile)
void void
gnc_file_export_file(const char * newfile) gnc_file_export_file(const char * newfile)
{ {
GNCSession *current_session, *new_session; QofSession *current_session, *new_session;
gboolean ok; gboolean ok;
GNCBackendError io_err = ERR_BACKEND_NO_ERR; QofBackendError io_err = ERR_BACKEND_NO_ERR;
char *default_dir; char *default_dir;
default_dir = gnc_lookup_string_option("__paths", "Export Accounts", NULL); default_dir = gnc_lookup_string_option("__paths", "Export Accounts", NULL);
@ -581,10 +581,10 @@ gnc_file_export_file(const char * newfile)
/* -- this session code is NOT identical in FileOpen and FileSaveAs -- */ /* -- this session code is NOT identical in FileOpen and FileSaveAs -- */
new_session = gnc_session_new (); new_session = qof_session_new ();
gnc_session_begin (new_session, newfile, FALSE, FALSE); qof_session_begin (new_session, newfile, FALSE, FALSE);
io_err = gnc_session_get_error (new_session); io_err = qof_session_get_error (new_session);
/* if file appears to be locked, ask the user ... */ /* if file appears to be locked, ask the user ... */
if (ERR_BACKEND_LOCKED == io_err) if (ERR_BACKEND_LOCKED == io_err)
@ -592,14 +592,14 @@ gnc_file_export_file(const char * newfile)
if (FALSE == show_session_error (io_err, newfile)) if (FALSE == show_session_error (io_err, newfile))
{ {
/* user told us to ignore locks. So ignore them. */ /* user told us to ignore locks. So ignore them. */
gnc_session_begin (new_session, newfile, TRUE, FALSE); qof_session_begin (new_session, newfile, TRUE, FALSE);
} }
} }
/* --------------- END CORE SESSION CODE -------------- */ /* --------------- END CORE SESSION CODE -------------- */
/* oops ... file already exists ... ask user what to do... */ /* oops ... file already exists ... ask user what to do... */
if (gnc_session_save_may_clobber_data (new_session)) if (qof_session_save_may_clobber_data (new_session))
{ {
const char *format = _("The file \n %s\n already exists.\n" const char *format = _("The file \n %s\n already exists.\n"
"Are you sure you want to overwrite it?"); "Are you sure you want to overwrite it?");
@ -615,17 +615,17 @@ gnc_file_export_file(const char * newfile)
/* use the current session to save to file */ /* use the current session to save to file */
gnc_set_busy_cursor (NULL, TRUE); gnc_set_busy_cursor (NULL, TRUE);
current_session = gnc_get_current_session(); current_session = qof_session_get_current_session();
if (file_percentage_func) { if (file_percentage_func) {
file_percentage_func(_("Exporting file..."), 0.0); file_percentage_func(_("Exporting file..."), 0.0);
ok = gnc_session_export (new_session, current_session, ok = qof_session_export (new_session, current_session,
file_percentage_func); file_percentage_func);
file_percentage_func(NULL, -1.0); file_percentage_func(NULL, -1.0);
} else { } else {
ok = gnc_session_export (new_session, current_session, NULL); ok = qof_session_export (new_session, current_session, NULL);
} }
gnc_unset_busy_cursor (NULL); gnc_unset_busy_cursor (NULL);
gnc_session_destroy (new_session); qof_session_destroy (new_session);
gnc_engine_resume_events(); gnc_engine_resume_events();
if (!ok) if (!ok)
@ -643,17 +643,17 @@ static gboolean been_here_before = FALSE;
void void
gnc_file_save (void) gnc_file_save (void)
{ {
GNCBackendError io_err; QofBackendError io_err;
const char * newfile; const char * newfile;
GNCSession *session; QofSession *session;
ENTER (" "); ENTER (" ");
/* hack alert -- Somehow make sure all in-progress edits get committed! */ /* hack alert -- Somehow make sure all in-progress edits get committed! */
/* If we don't have a filename/path to save to get one. */ /* If we don't have a filename/path to save to get one. */
session = gnc_get_current_session (); session = qof_session_get_current_session ();
if (!gnc_session_get_file_path (session)) if (!qof_session_get_file_path (session))
{ {
gnc_file_save_as (); gnc_file_save_as ();
return; return;
@ -663,17 +663,17 @@ gnc_file_save (void)
gnc_set_busy_cursor (NULL, TRUE); gnc_set_busy_cursor (NULL, TRUE);
if (file_percentage_func) { if (file_percentage_func) {
file_percentage_func(_("Writing file..."), 0.0); file_percentage_func(_("Writing file..."), 0.0);
gnc_session_save (session, file_percentage_func); qof_session_save (session, file_percentage_func);
file_percentage_func(NULL, -1.0); file_percentage_func(NULL, -1.0);
} else { } else {
gnc_session_save (session, NULL); qof_session_save (session, NULL);
} }
gnc_unset_busy_cursor (NULL); gnc_unset_busy_cursor (NULL);
/* Make sure everything's OK - disk could be full, file could have /* Make sure everything's OK - disk could be full, file could have
become read-only etc. */ become read-only etc. */
newfile = gnc_session_get_file_path (session); newfile = qof_session_get_file_path (session);
io_err = gnc_session_get_error (session); io_err = qof_session_get_error (session);
if (ERR_BACKEND_NO_ERR != io_err) if (ERR_BACKEND_NO_ERR != io_err)
{ {
show_session_error (io_err, newfile); show_session_error (io_err, newfile);
@ -699,14 +699,14 @@ gnc_file_save (void)
void void
gnc_file_save_as (void) gnc_file_save_as (void)
{ {
GNCSession *new_session; QofSession *new_session;
GNCSession *session; QofSession *session;
const char *filename; const char *filename;
char *default_dir = NULL; /* Default to last open */ char *default_dir = NULL; /* Default to last open */
const char *last; const char *last;
char *newfile; char *newfile;
const char *oldfile; const char *oldfile;
GNCBackendError io_err = ERR_BACKEND_NO_ERR; QofBackendError io_err = ERR_BACKEND_NO_ERR;
ENTER(" "); ENTER(" ");
@ -736,8 +736,8 @@ gnc_file_save_as (void)
return; return;
} }
session = gnc_get_current_session (); session = qof_session_get_current_session ();
oldfile = gnc_session_get_file_path (session); oldfile = qof_session_get_file_path (session);
if (oldfile && (strcmp(oldfile, newfile) == 0)) if (oldfile && (strcmp(oldfile, newfile) == 0))
{ {
g_free (newfile); g_free (newfile);
@ -747,10 +747,10 @@ gnc_file_save_as (void)
/* -- this session code is NOT identical in FileOpen and FileSaveAs -- */ /* -- this session code is NOT identical in FileOpen and FileSaveAs -- */
new_session = gnc_session_new (); new_session = qof_session_new ();
gnc_session_begin (new_session, newfile, FALSE, FALSE); qof_session_begin (new_session, newfile, FALSE, FALSE);
io_err = gnc_session_get_error (new_session); io_err = qof_session_get_error (new_session);
/* if file appears to be locked, ask the user ... */ /* if file appears to be locked, ask the user ... */
if (ERR_BACKEND_LOCKED == io_err) if (ERR_BACKEND_LOCKED == io_err)
@ -758,7 +758,7 @@ gnc_file_save_as (void)
if (FALSE == show_session_error (io_err, newfile)) if (FALSE == show_session_error (io_err, newfile))
{ {
/* user told us to ignore locks. So ignore them. */ /* user told us to ignore locks. So ignore them. */
gnc_session_begin (new_session, newfile, TRUE, FALSE); qof_session_begin (new_session, newfile, TRUE, FALSE);
} }
} }
@ -769,7 +769,7 @@ gnc_file_save_as (void)
if (FALSE == show_session_error (io_err, newfile)) if (FALSE == show_session_error (io_err, newfile))
{ {
/* user told us to create a new database. Do it. */ /* user told us to create a new database. Do it. */
gnc_session_begin (new_session, newfile, FALSE, TRUE); qof_session_begin (new_session, newfile, FALSE, TRUE);
} }
} }
@ -777,27 +777,27 @@ gnc_file_save_as (void)
* cleared a file lock & moved things forward some more) * cleared a file lock & moved things forward some more)
* This time, errors will be fatal. * This time, errors will be fatal.
*/ */
io_err = gnc_session_get_error (new_session); io_err = qof_session_get_error (new_session);
if (ERR_BACKEND_NO_ERR != io_err) if (ERR_BACKEND_NO_ERR != io_err)
{ {
show_session_error (io_err, newfile); show_session_error (io_err, newfile);
gnc_session_destroy (new_session); qof_session_destroy (new_session);
g_free (newfile); g_free (newfile);
return; return;
} }
/* if we got to here, then we've successfully gotten a new session */ /* if we got to here, then we've successfully gotten a new session */
/* close up the old file session (if any) */ /* close up the old file session (if any) */
gnc_session_swap_data (session, new_session); qof_session_swap_data (session, new_session);
gnc_session_destroy (session); qof_session_destroy (session);
session = NULL; session = NULL;
gnc_set_current_session(new_session); qof_session_set_current_session(new_session);
/* --------------- END CORE SESSION CODE -------------- */ /* --------------- END CORE SESSION CODE -------------- */
/* oops ... file already exists ... ask user what to do... */ /* oops ... file already exists ... ask user what to do... */
if (gnc_session_save_may_clobber_data (new_session)) if (qof_session_save_may_clobber_data (new_session))
{ {
const char *format = _("The file \n %s\n already exists.\n" const char *format = _("The file \n %s\n already exists.\n"
"Are you sure you want to overwrite it?"); "Are you sure you want to overwrite it?");
@ -821,9 +821,9 @@ gnc_file_save_as (void)
void void
gnc_file_quit (void) gnc_file_quit (void)
{ {
GNCSession *session; QofSession *session;
session = gnc_get_current_session (); session = qof_session_get_current_session ();
/* disable events; otherwise the mass deletetion of accounts and /* disable events; otherwise the mass deletetion of accounts and
* transactions during shutdown would cause massive redraws */ * transactions during shutdown would cause massive redraws */
@ -835,9 +835,9 @@ gnc_file_quit (void)
gw_wcp_assimilate_ptr (session, scm_c_eval_string("<gnc:Session*>")) : gw_wcp_assimilate_ptr (session, scm_c_eval_string("<gnc:Session*>")) :
SCM_BOOL_F)); SCM_BOOL_F));
gnc_session_destroy (session); qof_session_destroy (session);
gnc_get_current_session (); qof_session_get_current_session ();
gnc_engine_resume_events (); gnc_engine_resume_events ();
} }

View File

@ -18,7 +18,7 @@
#include "gncAddressP.h" #include "gncAddressP.h"
struct _gncAddress { struct _gncAddress {
GNCBook * book; QofBook * book;
const GUID * parent_guid; const GUID * parent_guid;
gboolean dirty; gboolean dirty;
char * name; char * name;
@ -48,7 +48,7 @@ mark_address (GncAddress *address)
/* Create/Destroy functions */ /* Create/Destroy functions */
GncAddress * gncAddressCreate (GNCBook *book, const GUID *parent) GncAddress * gncAddressCreate (QofBook *book, const GUID *parent)
{ {
GncAddress *addr; GncAddress *addr;

View File

@ -16,7 +16,7 @@ typedef struct _gncAddress GncAddress;
/* Create/Destroy functions */ /* Create/Destroy functions */
GncAddress * gncAddressCreate (GNCBook *book, const GUID *parent); GncAddress * gncAddressCreate (QofBook *book, const GUID *parent);
void gncAddressDestroy (GncAddress *addr); void gncAddressDestroy (GncAddress *addr);
/* Set functions */ /* Set functions */

View File

@ -36,7 +36,7 @@ struct _gncBillTerm {
gint cutoff; gint cutoff;
gint64 refcount; gint64 refcount;
GNCBook * book; QofBook * book;
GncBillTerm * parent; /* if non-null, we are an immutable child */ GncBillTerm * parent; /* if non-null, we are an immutable child */
GncBillTerm * child; /* if non-null, we have not changed */ GncBillTerm * child; /* if non-null, we have not changed */
gboolean invisible; gboolean invisible;
@ -87,7 +87,7 @@ mark_term (GncBillTerm *term)
} }
/* Create/Destroy Functions */ /* Create/Destroy Functions */
GncBillTerm * gncBillTermCreate (GNCBook *book) GncBillTerm * gncBillTermCreate (QofBook *book)
{ {
GncBillTerm *term; GncBillTerm *term;
if (!book) return NULL; if (!book) return NULL;
@ -306,7 +306,7 @@ void gncBillTermBeginEdit (GncBillTerm *term)
GNC_BEGIN_EDIT (term, _GNC_MOD_NAME); GNC_BEGIN_EDIT (term, _GNC_MOD_NAME);
} }
static void gncBillTermOnError (GncBillTerm *term, GNCBackendError errcode) static void gncBillTermOnError (GncBillTerm *term, QofBackendError errcode)
{ {
PERR("BillTerm Backend Failure: %d", errcode); PERR("BillTerm Backend Failure: %d", errcode);
} }
@ -324,14 +324,14 @@ void gncBillTermCommitEdit (GncBillTerm *term)
} }
/* Get Functions */ /* Get Functions */
GncBillTerm * gncBillTermLookup (GNCBook *book, const GUID *guid) GncBillTerm * gncBillTermLookup (QofBook *book, const GUID *guid)
{ {
if (!book || !guid) return NULL; if (!book || !guid) return NULL;
return xaccLookupEntity (gnc_book_get_entity_table (book), return xaccLookupEntity (gnc_book_get_entity_table (book),
guid, _GNC_MOD_NAME); guid, _GNC_MOD_NAME);
} }
GncBillTerm *gncBillTermLookupByName (GNCBook *book, const char *name) GncBillTerm *gncBillTermLookupByName (QofBook *book, const char *name)
{ {
GList *list = gncBillTermGetTerms (book); GList *list = gncBillTermGetTerms (book);
@ -343,7 +343,7 @@ GncBillTerm *gncBillTermLookupByName (GNCBook *book, const char *name)
return NULL; return NULL;
} }
GList * gncBillTermGetTerms (GNCBook *book) GList * gncBillTermGetTerms (QofBook *book)
{ {
struct _book_info *bi; struct _book_info *bi;
if (!book) return NULL; if (!book) return NULL;
@ -359,7 +359,7 @@ const GUID *gncBillTermGetGUID (GncBillTerm *term)
return &term->guid; return &term->guid;
} }
GNCBook *gncBillTermGetBook (GncBillTerm *term) QofBook *gncBillTermGetBook (GncBillTerm *term)
{ {
if (!term) return NULL; if (!term) return NULL;
return term->book; return term->book;
@ -598,7 +598,7 @@ static void remObj (GncBillTerm *term)
add_or_rem_object (term, FALSE); add_or_rem_object (term, FALSE);
} }
static void _gncBillTermCreate (GNCBook *book) static void _gncBillTermCreate (QofBook *book)
{ {
struct _book_info *bi; struct _book_info *bi;
@ -609,7 +609,7 @@ static void _gncBillTermCreate (GNCBook *book)
gnc_book_set_data (book, _GNC_MOD_NAME, bi); gnc_book_set_data (book, _GNC_MOD_NAME, bi);
} }
static void _gncBillTermDestroy (GNCBook *book) static void _gncBillTermDestroy (QofBook *book)
{ {
struct _book_info *bi; struct _book_info *bi;
@ -623,24 +623,24 @@ static void _gncBillTermDestroy (GNCBook *book)
g_free (bi); g_free (bi);
} }
static gboolean _gncBillTermIsDirty (GNCBook *book) static gboolean _gncBillTermIsDirty (QofBook *book)
{ {
return gncBusinessIsDirty (book, _GNC_MOD_NAME); return gncBusinessIsDirty (book, _GNC_MOD_NAME);
} }
static void _gncBillTermMarkClean (GNCBook *book) static void _gncBillTermMarkClean (QofBook *book)
{ {
gncBusinessSetDirtyFlag (book, _GNC_MOD_NAME, FALSE); gncBusinessSetDirtyFlag (book, _GNC_MOD_NAME, FALSE);
} }
static void _gncBillTermForeach (GNCBook *book, foreachObjectCB cb, static void _gncBillTermForeach (QofBook *book, foreachObjectCB cb,
gpointer user_data) gpointer user_data)
{ {
gncBusinessForeach (book, _GNC_MOD_NAME, cb, user_data); gncBusinessForeach (book, _GNC_MOD_NAME, cb, user_data);
} }
static GncObject_t gncBillTermDesc = { static GncObject_t gncBillTermDesc = {
GNC_OBJECT_VERSION, QOF_OBJECT_VERSION,
_GNC_MOD_NAME, _GNC_MOD_NAME,
"Billing Term", "Billing Term",
_gncBillTermCreate, _gncBillTermCreate,

View File

@ -25,7 +25,7 @@ typedef enum {
} GncBillTermType; } GncBillTermType;
/* Create/Destroy Functions */ /* Create/Destroy Functions */
GncBillTerm * gncBillTermCreate (GNCBook *book); GncBillTerm * gncBillTermCreate (QofBook *book);
void gncBillTermDestroy (GncBillTerm *term); void gncBillTermDestroy (GncBillTerm *term);
/* Set Functions */ /* Set Functions */
@ -45,12 +45,12 @@ void gncBillTermBeginEdit (GncBillTerm *term);
void gncBillTermCommitEdit (GncBillTerm *term); void gncBillTermCommitEdit (GncBillTerm *term);
/* Get Functions */ /* Get Functions */
GncBillTerm *gncBillTermLookup (GNCBook *book, const GUID *guid); GncBillTerm *gncBillTermLookup (QofBook *book, const GUID *guid);
GncBillTerm *gncBillTermLookupByName (GNCBook *book, const char *name); GncBillTerm *gncBillTermLookupByName (QofBook *book, const char *name);
GList * gncBillTermGetTerms (GNCBook *book); GList * gncBillTermGetTerms (QofBook *book);
const GUID *gncBillTermGetGUID (GncBillTerm *term); const GUID *gncBillTermGetGUID (GncBillTerm *term);
GNCBook *gncBillTermGetBook (GncBillTerm *term); QofBook *gncBillTermGetBook (GncBillTerm *term);
const char *gncBillTermGetName (GncBillTerm *term); const char *gncBillTermGetName (GncBillTerm *term);
const char *gncBillTermGetDescription (GncBillTerm *term); const char *gncBillTermGetDescription (GncBillTerm *term);
GncBillTermType gncBillTermGetType (GncBillTerm *term); GncBillTermType gncBillTermGetType (GncBillTerm *term);

View File

@ -24,7 +24,7 @@ static void get_list (gpointer key, gpointer item, gpointer arg)
iter->cb (item, iter->user_data); iter->cb (item, iter->user_data);
} }
void gncBusinessForeach (GNCBook *book, GNCIdType mod_name, void gncBusinessForeach (QofBook *book, GNCIdType mod_name,
foreachObjectCB cb, gpointer user_data) foreachObjectCB cb, gpointer user_data)
{ {
GncBookInfo *bi; GncBookInfo *bi;
@ -40,7 +40,7 @@ void gncBusinessForeach (GNCBook *book, GNCIdType mod_name,
g_hash_table_foreach (bi->ht, get_list, &iter); g_hash_table_foreach (bi->ht, get_list, &iter);
} }
void gncBusinessCreate (GNCBook *book, GNCIdType mod_name) void gncBusinessCreate (QofBook *book, GNCIdType mod_name)
{ {
GncBookInfo *bi; GncBookInfo *bi;
@ -51,7 +51,7 @@ void gncBusinessCreate (GNCBook *book, GNCIdType mod_name)
gnc_book_set_data (book, mod_name, bi); gnc_book_set_data (book, mod_name, bi);
} }
void gncBusinessDestroy (GNCBook *book, GNCIdType mod_name) void gncBusinessDestroy (QofBook *book, GNCIdType mod_name)
{ {
GncBookInfo *bi; GncBookInfo *bi;
@ -64,7 +64,7 @@ void gncBusinessDestroy (GNCBook *book, GNCIdType mod_name)
g_free (bi); g_free (bi);
} }
gboolean gncBusinessIsDirty (GNCBook *book, GNCIdType mod_name) gboolean gncBusinessIsDirty (QofBook *book, GNCIdType mod_name)
{ {
GncBookInfo *bi; GncBookInfo *bi;
@ -74,7 +74,7 @@ gboolean gncBusinessIsDirty (GNCBook *book, GNCIdType mod_name)
return bi->is_dirty; return bi->is_dirty;
} }
void gncBusinessSetDirtyFlag (GNCBook *book, GNCIdType mod_name, void gncBusinessSetDirtyFlag (QofBook *book, GNCIdType mod_name,
gboolean is_dirty) gboolean is_dirty)
{ {
GncBookInfo *bi; GncBookInfo *bi;
@ -85,7 +85,7 @@ void gncBusinessSetDirtyFlag (GNCBook *book, GNCIdType mod_name,
bi->is_dirty = is_dirty; bi->is_dirty = is_dirty;
} }
void gncBusinessAddObject (GNCBook *book, GNCIdType mod_name, void gncBusinessAddObject (QofBook *book, GNCIdType mod_name,
gpointer obj, const GUID *guid) gpointer obj, const GUID *guid)
{ {
GncBookInfo *bi; GncBookInfo *bi;
@ -95,7 +95,7 @@ void gncBusinessAddObject (GNCBook *book, GNCIdType mod_name,
g_hash_table_insert (bi->ht, (gpointer)guid, obj); g_hash_table_insert (bi->ht, (gpointer)guid, obj);
} }
void gncBusinessRemoveObject (GNCBook *book, GNCIdType mod_name, void gncBusinessRemoveObject (QofBook *book, GNCIdType mod_name,
const GUID *guid) const GUID *guid)
{ {
GncBookInfo *bi; GncBookInfo *bi;

View File

@ -16,17 +16,17 @@ typedef struct _gncBookInfo {
gboolean is_dirty; gboolean is_dirty;
} GncBookInfo; } GncBookInfo;
void gncBusinessForeach (GNCBook *book, GNCIdType mod_name, void gncBusinessForeach (QofBook *book, GNCIdType mod_name,
foreachObjectCB cb, gpointer user_data); foreachObjectCB cb, gpointer user_data);
void gncBusinessCreate (GNCBook *book, GNCIdType mod_name); void gncBusinessCreate (QofBook *book, GNCIdType mod_name);
void gncBusinessDestroy (GNCBook *book, GNCIdType mod_name); void gncBusinessDestroy (QofBook *book, GNCIdType mod_name);
gboolean gncBusinessIsDirty (GNCBook *book, GNCIdType mod_name); gboolean gncBusinessIsDirty (QofBook *book, GNCIdType mod_name);
void gncBusinessSetDirtyFlag (GNCBook *book, GNCIdType mod_name, void gncBusinessSetDirtyFlag (QofBook *book, GNCIdType mod_name,
gboolean is_dirty); gboolean is_dirty);
void gncBusinessAddObject (GNCBook *book, GNCIdType mod_name, void gncBusinessAddObject (QofBook *book, GNCIdType mod_name,
gpointer obj, const GUID *guid); gpointer obj, const GUID *guid);
void gncBusinessRemoveObject (GNCBook *book, GNCIdType mod_name, void gncBusinessRemoveObject (QofBook *book, GNCIdType mod_name,
const GUID *guid); const GUID *guid);

View File

@ -29,7 +29,7 @@
#include "gncAddress.h" #include "gncAddress.h"
struct _gncCustomer { struct _gncCustomer {
GNCBook * book; QofBook * book;
GUID guid; GUID guid;
char * id; char * id;
char * name; char * name;
@ -74,7 +74,7 @@ mark_customer (GncCustomer *customer)
/* Create/Destroy Functions */ /* Create/Destroy Functions */
GncCustomer *gncCustomerCreate (GNCBook *book) GncCustomer *gncCustomerCreate (QofBook *book)
{ {
GncCustomer *cust; GncCustomer *cust;
@ -308,7 +308,7 @@ void gncCustomerBeginEdit (GncCustomer *cust)
GNC_BEGIN_EDIT (cust, _GNC_MOD_NAME); GNC_BEGIN_EDIT (cust, _GNC_MOD_NAME);
} }
static void gncCustomerOnError (GncCustomer *cust, GNCBackendError errcode) static void gncCustomerOnError (GncCustomer *cust, QofBackendError errcode)
{ {
PERR("Customer Backend Failure: %d", errcode); PERR("Customer Backend Failure: %d", errcode);
} }
@ -329,7 +329,7 @@ void gncCustomerCommitEdit (GncCustomer *cust)
/* Get Functions */ /* Get Functions */
GNCBook * gncCustomerGetBook (GncCustomer *cust) QofBook * gncCustomerGetBook (GncCustomer *cust)
{ {
if (!cust) return NULL; if (!cust) return NULL;
return cust->book; return cust->book;
@ -444,13 +444,13 @@ GUID gncCustomerRetGUID (GncCustomer *customer)
return customer->guid; return customer->guid;
} }
GncCustomer * gncCustomerLookupDirect (GUID guid, GNCBook *book) GncCustomer * gncCustomerLookupDirect (GUID guid, QofBook *book)
{ {
if (!book) return NULL; if (!book) return NULL;
return gncCustomerLookup (book, &guid); return gncCustomerLookup (book, &guid);
} }
GncCustomer * gncCustomerLookup (GNCBook *book, const GUID *guid) GncCustomer * gncCustomerLookup (QofBook *book, const GUID *guid)
{ {
if (!book || !guid) return NULL; if (!book || !guid) return NULL;
return xaccLookupEntity (gnc_book_get_entity_table (book), return xaccLookupEntity (gnc_book_get_entity_table (book),
@ -488,27 +488,27 @@ static void remObj (GncCustomer *cust)
gncBusinessRemoveObject (cust->book, _GNC_MOD_NAME, &cust->guid); gncBusinessRemoveObject (cust->book, _GNC_MOD_NAME, &cust->guid);
} }
static void _gncCustomerCreate (GNCBook *book) static void _gncCustomerCreate (QofBook *book)
{ {
gncBusinessCreate (book, _GNC_MOD_NAME); gncBusinessCreate (book, _GNC_MOD_NAME);
} }
static void _gncCustomerDestroy (GNCBook *book) static void _gncCustomerDestroy (QofBook *book)
{ {
return gncBusinessDestroy (book, _GNC_MOD_NAME); return gncBusinessDestroy (book, _GNC_MOD_NAME);
} }
static gboolean _gncCustomerIsDirty (GNCBook *book) static gboolean _gncCustomerIsDirty (QofBook *book)
{ {
return gncBusinessIsDirty (book, _GNC_MOD_NAME); return gncBusinessIsDirty (book, _GNC_MOD_NAME);
} }
static void _gncCustomerMarkClean (GNCBook *book) static void _gncCustomerMarkClean (QofBook *book)
{ {
gncBusinessSetDirtyFlag (book, _GNC_MOD_NAME, FALSE); gncBusinessSetDirtyFlag (book, _GNC_MOD_NAME, FALSE);
} }
static void _gncCustomerForeach (GNCBook *book, foreachObjectCB cb, static void _gncCustomerForeach (QofBook *book, foreachObjectCB cb,
gpointer user_data) gpointer user_data)
{ {
gncBusinessForeach (book, _GNC_MOD_NAME, cb, user_data); gncBusinessForeach (book, _GNC_MOD_NAME, cb, user_data);
@ -525,7 +525,7 @@ static const char * _gncCustomerPrintable (gpointer item)
} }
static GncObject_t gncCustomerDesc = { static GncObject_t gncCustomerDesc = {
GNC_OBJECT_VERSION, QOF_OBJECT_VERSION,
_GNC_MOD_NAME, _GNC_MOD_NAME,
"Customer", "Customer",
_gncCustomerCreate, _gncCustomerCreate,
@ -554,7 +554,7 @@ gboolean gncCustomerRegister (void)
return gncObjectRegister (&gncCustomerDesc); return gncObjectRegister (&gncCustomerDesc);
} }
gint64 gncCustomerNextID (GNCBook *book) gint64 gncCustomerNextID (QofBook *book)
{ {
return gnc_book_get_counter (book, _GNC_MOD_NAME); return gnc_book_get_counter (book, _GNC_MOD_NAME);
} }

View File

@ -21,7 +21,7 @@ typedef struct _gncCustomer GncCustomer;
/* Create/Destroy Functions */ /* Create/Destroy Functions */
GncCustomer *gncCustomerCreate (GNCBook *book); GncCustomer *gncCustomerCreate (QofBook *book);
void gncCustomerDestroy (GncCustomer *customer); void gncCustomerDestroy (GncCustomer *customer);
/* Set Functions */ /* Set Functions */
@ -47,7 +47,7 @@ void gncCustomerCommitEdit (GncCustomer *customer);
/* Get Functions */ /* Get Functions */
GNCBook * gncCustomerGetBook (GncCustomer *customer); QofBook * gncCustomerGetBook (GncCustomer *customer);
const GUID * gncCustomerGetGUID (GncCustomer *customer); const GUID * gncCustomerGetGUID (GncCustomer *customer);
const char * gncCustomerGetID (GncCustomer *customer); const char * gncCustomerGetID (GncCustomer *customer);
const char * gncCustomerGetName (GncCustomer *customer); const char * gncCustomerGetName (GncCustomer *customer);
@ -67,9 +67,9 @@ GncTaxTable* gncCustomerGetTaxTable (GncCustomer *customer);
GList * gncCustomerGetJoblist (GncCustomer *customer, gboolean show_all); GList * gncCustomerGetJoblist (GncCustomer *customer, gboolean show_all);
GUID gncCustomerRetGUID (GncCustomer *customer); GUID gncCustomerRetGUID (GncCustomer *customer);
GncCustomer * gncCustomerLookupDirect (GUID guid, GNCBook *book); GncCustomer * gncCustomerLookupDirect (GUID guid, QofBook *book);
GncCustomer * gncCustomerLookup (GNCBook *book, const GUID *guid); GncCustomer * gncCustomerLookup (QofBook *book, const GUID *guid);
gboolean gncCustomerIsDirty (GncCustomer *customer); gboolean gncCustomerIsDirty (GncCustomer *customer);
int gncCustomerCompare (GncCustomer *a, GncCustomer *b); int gncCustomerCompare (GncCustomer *a, GncCustomer *b);

View File

@ -10,7 +10,7 @@
#include "gncCustomer.h" #include "gncCustomer.h"
gboolean gncCustomerRegister (void); gboolean gncCustomerRegister (void);
gint64 gncCustomerNextID (GNCBook *book); gint64 gncCustomerNextID (QofBook *book);
void gncCustomerSetGUID (GncCustomer *customer, const GUID *guid); void gncCustomerSetGUID (GncCustomer *customer, const GUID *guid);
#endif /* GNC_CUSTOMERP_H_ */ #endif /* GNC_CUSTOMERP_H_ */

View File

@ -29,7 +29,7 @@
#include "gncAddress.h" #include "gncAddress.h"
struct _gncEmployee { struct _gncEmployee {
GNCBook * book; QofBook * book;
GUID guid; GUID guid;
char * id; char * id;
char * username; char * username;
@ -70,7 +70,7 @@ mark_employee (GncEmployee *employee)
/* Create/Destroy Functions */ /* Create/Destroy Functions */
GncEmployee *gncEmployeeCreate (GNCBook *book) GncEmployee *gncEmployeeCreate (QofBook *book)
{ {
GncEmployee *employee; GncEmployee *employee;
@ -233,7 +233,7 @@ void gncEmployeeSetCCard (GncEmployee *employee, Account* ccard_acc)
/* Get Functions */ /* Get Functions */
GNCBook * gncEmployeeGetBook (GncEmployee *employee) QofBook * gncEmployeeGetBook (GncEmployee *employee)
{ {
if (!employee) return NULL; if (!employee) return NULL;
return employee->book; return employee->book;
@ -305,7 +305,7 @@ Account * gncEmployeeGetCCard (GncEmployee *employee)
return employee->ccard_acc; return employee->ccard_acc;
} }
GncEmployee * gncEmployeeLookup (GNCBook *book, const GUID *guid) GncEmployee * gncEmployeeLookup (QofBook *book, const GUID *guid)
{ {
if (!book || !guid) return NULL; if (!book || !guid) return NULL;
return xaccLookupEntity (gnc_book_get_entity_table (book), return xaccLookupEntity (gnc_book_get_entity_table (book),
@ -320,7 +320,7 @@ GUID gncEmployeeRetGUID (GncEmployee *employee)
return employee->guid; return employee->guid;
} }
GncEmployee * gncEmployeeLookupDirect (GUID guid, GNCBook *book) GncEmployee * gncEmployeeLookupDirect (GUID guid, QofBook *book)
{ {
if (!book) return NULL; if (!book) return NULL;
return gncEmployeeLookup (book, &guid); return gncEmployeeLookup (book, &guid);
@ -337,7 +337,7 @@ void gncEmployeeBeginEdit (GncEmployee *employee)
GNC_BEGIN_EDIT (employee, _GNC_MOD_NAME); GNC_BEGIN_EDIT (employee, _GNC_MOD_NAME);
} }
static void gncEmployeeOnError (GncEmployee *employee, GNCBackendError errcode) static void gncEmployeeOnError (GncEmployee *employee, QofBackendError errcode)
{ {
PERR("Employee Backend Failure: %d", errcode); PERR("Employee Backend Failure: %d", errcode);
} }
@ -379,27 +379,27 @@ static void remObj (GncEmployee *employee)
gncBusinessRemoveObject (employee->book, _GNC_MOD_NAME, &employee->guid); gncBusinessRemoveObject (employee->book, _GNC_MOD_NAME, &employee->guid);
} }
static void _gncEmployeeCreate (GNCBook *book) static void _gncEmployeeCreate (QofBook *book)
{ {
gncBusinessCreate (book, _GNC_MOD_NAME); gncBusinessCreate (book, _GNC_MOD_NAME);
} }
static void _gncEmployeeDestroy (GNCBook *book) static void _gncEmployeeDestroy (QofBook *book)
{ {
gncBusinessDestroy (book, _GNC_MOD_NAME); gncBusinessDestroy (book, _GNC_MOD_NAME);
} }
static gboolean _gncEmployeeIsDirty (GNCBook *book) static gboolean _gncEmployeeIsDirty (QofBook *book)
{ {
return gncBusinessIsDirty (book, _GNC_MOD_NAME); return gncBusinessIsDirty (book, _GNC_MOD_NAME);
} }
static void _gncEmployeeMarkClean (GNCBook *book) static void _gncEmployeeMarkClean (QofBook *book)
{ {
gncBusinessSetDirtyFlag (book, _GNC_MOD_NAME, FALSE); gncBusinessSetDirtyFlag (book, _GNC_MOD_NAME, FALSE);
} }
static void _gncEmployeeForeach (GNCBook *book, foreachObjectCB cb, static void _gncEmployeeForeach (QofBook *book, foreachObjectCB cb,
gpointer user_data) gpointer user_data)
{ {
gncBusinessForeach (book, _GNC_MOD_NAME, cb, user_data); gncBusinessForeach (book, _GNC_MOD_NAME, cb, user_data);
@ -416,7 +416,7 @@ static const char * _gncEmployeePrintable (gpointer item)
} }
static GncObject_t gncEmployeeDesc = { static GncObject_t gncEmployeeDesc = {
GNC_OBJECT_VERSION, QOF_OBJECT_VERSION,
_GNC_MOD_NAME, _GNC_MOD_NAME,
"Employee", "Employee",
_gncEmployeeCreate, _gncEmployeeCreate,
@ -444,7 +444,7 @@ gboolean gncEmployeeRegister (void)
return gncObjectRegister (&gncEmployeeDesc); return gncObjectRegister (&gncEmployeeDesc);
} }
gint64 gncEmployeeNextID (GNCBook *book) gint64 gncEmployeeNextID (QofBook *book)
{ {
return gnc_book_get_counter (book, _GNC_MOD_NAME); return gnc_book_get_counter (book, _GNC_MOD_NAME);
} }

View File

@ -17,7 +17,7 @@ typedef struct _gncEmployee GncEmployee;
/* Create/Destroy Functions */ /* Create/Destroy Functions */
GncEmployee *gncEmployeeCreate (GNCBook *book); GncEmployee *gncEmployeeCreate (QofBook *book);
void gncEmployeeDestroy (GncEmployee *employee); void gncEmployeeDestroy (GncEmployee *employee);
/* Set Functions */ /* Set Functions */
@ -34,7 +34,7 @@ void gncEmployeeSetCCard (GncEmployee *employee, Account* ccard_acc);
/* Get Functions */ /* Get Functions */
GNCBook * gncEmployeeGetBook (GncEmployee *employee); QofBook * gncEmployeeGetBook (GncEmployee *employee);
const GUID * gncEmployeeGetGUID (GncEmployee *employee); const GUID * gncEmployeeGetGUID (GncEmployee *employee);
const char * gncEmployeeGetID (GncEmployee *employee); const char * gncEmployeeGetID (GncEmployee *employee);
const char * gncEmployeeGetUsername (GncEmployee *employee); const char * gncEmployeeGetUsername (GncEmployee *employee);
@ -47,11 +47,11 @@ gnc_commodity * gncEmployeeGetCurrency (GncEmployee *employee);
gboolean gncEmployeeGetActive (GncEmployee *employee); gboolean gncEmployeeGetActive (GncEmployee *employee);
Account * gncEmployeeGetCCard (GncEmployee *employee); Account * gncEmployeeGetCCard (GncEmployee *employee);
GncEmployee * gncEmployeeLookup (GNCBook *book, const GUID *guid); GncEmployee * gncEmployeeLookup (QofBook *book, const GUID *guid);
gboolean gncEmployeeIsDirty (GncEmployee *employee); gboolean gncEmployeeIsDirty (GncEmployee *employee);
GUID gncEmployeeRetGUID (GncEmployee *employee); GUID gncEmployeeRetGUID (GncEmployee *employee);
GncEmployee * gncEmployeeLookupDirect (GUID guid, GNCBook *book); GncEmployee * gncEmployeeLookupDirect (GUID guid, QofBook *book);
void gncEmployeeBeginEdit (GncEmployee *employee); void gncEmployeeBeginEdit (GncEmployee *employee);
void gncEmployeeCommitEdit (GncEmployee *employee); void gncEmployeeCommitEdit (GncEmployee *employee);

View File

@ -10,7 +10,7 @@
#include "gncEmployee.h" #include "gncEmployee.h"
gboolean gncEmployeeRegister (void); gboolean gncEmployeeRegister (void);
gint64 gncEmployeeNextID (GNCBook *book); gint64 gncEmployeeNextID (QofBook *book);
void gncEmployeeSetGUID (GncEmployee *employee, const GUID *guid); void gncEmployeeSetGUID (GncEmployee *employee, const GUID *guid);
#endif /* GNC_EMPLOYEEP_H_ */ #endif /* GNC_EMPLOYEEP_H_ */

View File

@ -28,7 +28,7 @@
#include "gncOrder.h" #include "gncOrder.h"
struct _gncEntry { struct _gncEntry {
GNCBook * book; QofBook * book;
GUID guid; GUID guid;
Timespec date; Timespec date;
@ -179,7 +179,7 @@ mark_entry (GncEntry *entry)
/* Create/Destroy Functions */ /* Create/Destroy Functions */
GncEntry *gncEntryCreate (GNCBook *book) GncEntry *gncEntryCreate (QofBook *book)
{ {
GncEntry *entry; GncEntry *entry;
gnc_numeric zero = gnc_numeric_zero (); gnc_numeric zero = gnc_numeric_zero ();
@ -592,7 +592,7 @@ void gncEntryCopy (const GncEntry *src, GncEntry *dest)
/* Get Functions */ /* Get Functions */
GNCBook * gncEntryGetBook (GncEntry *entry) QofBook * gncEntryGetBook (GncEntry *entry)
{ {
if (!entry) return NULL; if (!entry) return NULL;
return entry->book; return entry->book;
@ -760,7 +760,7 @@ GncOrder * gncEntryGetOrder (GncEntry *entry)
return entry->order; return entry->order;
} }
GncEntry * gncEntryLookup (GNCBook *book, const GUID *guid) GncEntry * gncEntryLookup (QofBook *book, const GUID *guid)
{ {
if (!book || !guid) return NULL; if (!book || !guid) return NULL;
return xaccLookupEntity (gnc_book_get_entity_table (book), return xaccLookupEntity (gnc_book_get_entity_table (book),
@ -1110,7 +1110,7 @@ void gncEntryBeginEdit (GncEntry *entry)
GNC_BEGIN_EDIT (entry, _GNC_MOD_NAME); GNC_BEGIN_EDIT (entry, _GNC_MOD_NAME);
} }
static void gncEntryOnError (GncEntry *entry, GNCBackendError errcode) static void gncEntryOnError (GncEntry *entry, QofBackendError errcode)
{ {
PERR("Entry Backend Failure: %d", errcode); PERR("Entry Backend Failure: %d", errcode);
} }
@ -1162,34 +1162,34 @@ static void remObj (GncEntry *entry)
gncBusinessRemoveObject (entry->book, _GNC_MOD_NAME, &entry->guid); gncBusinessRemoveObject (entry->book, _GNC_MOD_NAME, &entry->guid);
} }
static void _gncEntryCreate (GNCBook *book) static void _gncEntryCreate (QofBook *book)
{ {
gncBusinessCreate (book, _GNC_MOD_NAME); gncBusinessCreate (book, _GNC_MOD_NAME);
} }
static void _gncEntryDestroy (GNCBook *book) static void _gncEntryDestroy (QofBook *book)
{ {
gncBusinessDestroy (book, _GNC_MOD_NAME); gncBusinessDestroy (book, _GNC_MOD_NAME);
} }
static gboolean _gncEntryIsDirty (GNCBook *book) static gboolean _gncEntryIsDirty (QofBook *book)
{ {
return gncBusinessIsDirty (book, _GNC_MOD_NAME); return gncBusinessIsDirty (book, _GNC_MOD_NAME);
} }
static void _gncEntryMarkClean (GNCBook *book) static void _gncEntryMarkClean (QofBook *book)
{ {
gncBusinessSetDirtyFlag (book, _GNC_MOD_NAME, FALSE); gncBusinessSetDirtyFlag (book, _GNC_MOD_NAME, FALSE);
} }
static void _gncEntryForeach (GNCBook *book, foreachObjectCB cb, static void _gncEntryForeach (QofBook *book, foreachObjectCB cb,
gpointer user_data) gpointer user_data)
{ {
gncBusinessForeach (book, _GNC_MOD_NAME, cb, user_data); gncBusinessForeach (book, _GNC_MOD_NAME, cb, user_data);
} }
static GncObject_t gncEntryDesc = { static GncObject_t gncEntryDesc = {
GNC_OBJECT_VERSION, QOF_OBJECT_VERSION,
_GNC_MOD_NAME, _GNC_MOD_NAME,
"Order/Invoice/Bill Entry", "Order/Invoice/Bill Entry",
_gncEntryCreate, _gncEntryCreate,

View File

@ -45,7 +45,7 @@ gboolean gncEntryPaymentStringToType (const char *str, GncEntryPaymentType *type
/* Create/Destroy Functions */ /* Create/Destroy Functions */
GncEntry *gncEntryCreate (GNCBook *book); GncEntry *gncEntryCreate (QofBook *book);
void gncEntryDestroy (GncEntry *entry); void gncEntryDestroy (GncEntry *entry);
/* SET FUNCTIONS */ /* SET FUNCTIONS */
@ -82,7 +82,7 @@ void gncEntrySetBillPayment (GncEntry *entry, GncEntryPaymentType type);
/* GET FUNCTIONS */ /* GET FUNCTIONS */
/* Generic (shared) data */ /* Generic (shared) data */
GNCBook * gncEntryGetBook (GncEntry *entry); QofBook * gncEntryGetBook (GncEntry *entry);
const GUID * gncEntryGetGUID (GncEntry *entry); const GUID * gncEntryGetGUID (GncEntry *entry);
Timespec gncEntryGetDate (GncEntry *entry); Timespec gncEntryGetDate (GncEntry *entry);
Timespec gncEntryGetDateEntered (GncEntry *entry); Timespec gncEntryGetDateEntered (GncEntry *entry);
@ -148,7 +148,7 @@ GncOrder * gncEntryGetOrder (GncEntry *entry);
GncInvoice * gncEntryGetInvoice (GncEntry *entry); GncInvoice * gncEntryGetInvoice (GncEntry *entry);
GncInvoice * gncEntryGetBill (GncEntry *entry); GncInvoice * gncEntryGetBill (GncEntry *entry);
GncEntry * gncEntryLookup (GNCBook *book, const GUID *guid); GncEntry * gncEntryLookup (QofBook *book, const GUID *guid);
gboolean gncEntryIsOpen (GncEntry *entry); gboolean gncEntryIsOpen (GncEntry *entry);
void gncEntryBeginEdit (GncEntry *entry); void gncEntryBeginEdit (GncEntry *entry);

View File

@ -32,7 +32,7 @@
#include "gncOwner.h" #include "gncOwner.h"
struct _gncInvoice { struct _gncInvoice {
GNCBook *book; QofBook *book;
GUID guid; GUID guid;
char * id; char * id;
@ -98,7 +98,7 @@ mark_invoice (GncInvoice *invoice)
/* Create/Destroy Functions */ /* Create/Destroy Functions */
GncInvoice *gncInvoiceCreate (GNCBook *book) GncInvoice *gncInvoiceCreate (QofBook *book)
{ {
GncInvoice *invoice; GncInvoice *invoice;
@ -367,7 +367,7 @@ void gncBillRemoveEntry (GncInvoice *bill, GncEntry *entry)
/* Get Functions */ /* Get Functions */
GNCBook * gncInvoiceGetBook (GncInvoice *invoice) QofBook * gncInvoiceGetBook (GncInvoice *invoice)
{ {
if (!invoice) return NULL; if (!invoice) return NULL;
return invoice->book; return invoice->book;
@ -607,7 +607,7 @@ GncInvoice * gncInvoiceGetInvoiceFromLot (GNCLot *lot)
kvp_frame *kvp; kvp_frame *kvp;
kvp_value *value; kvp_value *value;
GUID *guid; GUID *guid;
GNCBook *book; QofBook *book;
if (!lot) return NULL; if (!lot) return NULL;
@ -648,7 +648,7 @@ GncInvoice * gncInvoiceGetInvoiceFromTxn (Transaction *txn)
kvp_frame *kvp; kvp_frame *kvp;
kvp_value *value; kvp_value *value;
GUID *guid; GUID *guid;
GNCBook *book; QofBook *book;
if (!txn) return NULL; if (!txn) return NULL;
@ -1081,7 +1081,7 @@ gncOwnerApplyPayment (GncOwner *owner, Account *posted_acc, Account *xfer_acc,
gnc_numeric amount, Timespec date, gnc_numeric amount, Timespec date,
const char *memo, const char *num) const char *memo, const char *num)
{ {
GNCBook *book; QofBook *book;
Transaction *txn; Transaction *txn;
Split *split; Split *split;
GList *lot_list, *fifo = NULL; GList *lot_list, *fifo = NULL;
@ -1247,13 +1247,13 @@ GUID gncInvoiceRetGUID (GncInvoice *invoice)
return invoice->guid; return invoice->guid;
} }
GncInvoice * gncInvoiceLookupDirect (GUID guid, GNCBook *book) GncInvoice * gncInvoiceLookupDirect (GUID guid, QofBook *book)
{ {
if (!book) return NULL; if (!book) return NULL;
return gncInvoiceLookup (book, &guid); return gncInvoiceLookup (book, &guid);
} }
GncInvoice * gncInvoiceLookup (GNCBook *book, const GUID *guid) GncInvoice * gncInvoiceLookup (QofBook *book, const GUID *guid)
{ {
if (!book || !guid) return NULL; if (!book || !guid) return NULL;
return xaccLookupEntity (gnc_book_get_entity_table (book), return xaccLookupEntity (gnc_book_get_entity_table (book),
@ -1265,7 +1265,7 @@ void gncInvoiceBeginEdit (GncInvoice *invoice)
GNC_BEGIN_EDIT (invoice, _GNC_MOD_NAME); GNC_BEGIN_EDIT (invoice, _GNC_MOD_NAME);
} }
static void gncInvoiceOnError (GncInvoice *invoice, GNCBackendError errcode) static void gncInvoiceOnError (GncInvoice *invoice, QofBackendError errcode)
{ {
PERR("Invoice Backend Failure: %d", errcode); PERR("Invoice Backend Failure: %d", errcode);
} }
@ -1314,27 +1314,27 @@ static void remObj (GncInvoice *invoice)
gncBusinessRemoveObject (invoice->book, _GNC_MOD_NAME, &invoice->guid); gncBusinessRemoveObject (invoice->book, _GNC_MOD_NAME, &invoice->guid);
} }
static void _gncInvoiceCreate (GNCBook *book) static void _gncInvoiceCreate (QofBook *book)
{ {
gncBusinessCreate (book, _GNC_MOD_NAME); gncBusinessCreate (book, _GNC_MOD_NAME);
} }
static void _gncInvoiceDestroy (GNCBook *book) static void _gncInvoiceDestroy (QofBook *book)
{ {
gncBusinessDestroy (book, _GNC_MOD_NAME); gncBusinessDestroy (book, _GNC_MOD_NAME);
} }
static gboolean _gncInvoiceIsDirty (GNCBook *book) static gboolean _gncInvoiceIsDirty (QofBook *book)
{ {
return gncBusinessIsDirty (book, _GNC_MOD_NAME); return gncBusinessIsDirty (book, _GNC_MOD_NAME);
} }
static void _gncInvoiceMarkClean (GNCBook *book) static void _gncInvoiceMarkClean (QofBook *book)
{ {
gncBusinessSetDirtyFlag (book, _GNC_MOD_NAME, FALSE); gncBusinessSetDirtyFlag (book, _GNC_MOD_NAME, FALSE);
} }
static void _gncInvoiceForeach (GNCBook *book, foreachObjectCB cb, static void _gncInvoiceForeach (QofBook *book, foreachObjectCB cb,
gpointer user_data) gpointer user_data)
{ {
gncBusinessForeach (book, _GNC_MOD_NAME, cb, user_data); gncBusinessForeach (book, _GNC_MOD_NAME, cb, user_data);
@ -1358,7 +1358,7 @@ static const char * _gncInvoicePrintable (gpointer obj)
} }
static GncObject_t gncInvoiceDesc = { static GncObject_t gncInvoiceDesc = {
GNC_OBJECT_VERSION, QOF_OBJECT_VERSION,
_GNC_MOD_NAME, _GNC_MOD_NAME,
"Invoice", "Invoice",
_gncInvoiceCreate, _gncInvoiceCreate,
@ -1424,7 +1424,7 @@ gboolean gncInvoiceRegister (void)
return gncObjectRegister (&gncInvoiceDesc); return gncObjectRegister (&gncInvoiceDesc);
} }
gint64 gncInvoiceNextID (GNCBook *book) gint64 gncInvoiceNextID (QofBook *book)
{ {
return gnc_book_get_counter (book, _GNC_MOD_NAME); return gnc_book_get_counter (book, _GNC_MOD_NAME);
} }

View File

@ -19,7 +19,7 @@ typedef struct _gncInvoice GncInvoice;
/* Create/Destroy Functions */ /* Create/Destroy Functions */
GncInvoice *gncInvoiceCreate (GNCBook *book); GncInvoice *gncInvoiceCreate (QofBook *book);
void gncInvoiceDestroy (GncInvoice *invoice); void gncInvoiceDestroy (GncInvoice *invoice);
/* Set Functions */ /* Set Functions */
@ -45,7 +45,7 @@ void gncBillRemoveEntry (GncInvoice *bill, GncEntry *entry);
/* Get Functions */ /* Get Functions */
GNCBook * gncInvoiceGetBook (GncInvoice *invoice); QofBook * gncInvoiceGetBook (GncInvoice *invoice);
const GUID * gncInvoiceGetGUID (GncInvoice *invoice); const GUID * gncInvoiceGetGUID (GncInvoice *invoice);
const char * gncInvoiceGetID (GncInvoice *invoice); const char * gncInvoiceGetID (GncInvoice *invoice);
GncOwner * gncInvoiceGetOwner (GncInvoice *invoice); GncOwner * gncInvoiceGetOwner (GncInvoice *invoice);
@ -116,9 +116,9 @@ GncInvoice * gncInvoiceGetInvoiceFromTxn (Transaction *txn);
GncInvoice * gncInvoiceGetInvoiceFromLot (GNCLot *lot); GncInvoice * gncInvoiceGetInvoiceFromLot (GNCLot *lot);
GUID gncInvoiceRetGUID (GncInvoice *invoice); GUID gncInvoiceRetGUID (GncInvoice *invoice);
GncInvoice * gncInvoiceLookupDirect (GUID guid, GNCBook *book); GncInvoice * gncInvoiceLookupDirect (GUID guid, QofBook *book);
GncInvoice * gncInvoiceLookup (GNCBook *book, const GUID *guid); GncInvoice * gncInvoiceLookup (QofBook *book, const GUID *guid);
gboolean gncInvoiceIsDirty (GncInvoice *invoice); gboolean gncInvoiceIsDirty (GncInvoice *invoice);
void gncInvoiceBeginEdit (GncInvoice *invoice); void gncInvoiceBeginEdit (GncInvoice *invoice);
void gncInvoiceCommitEdit (GncInvoice *invoice); void gncInvoiceCommitEdit (GncInvoice *invoice);

View File

@ -13,7 +13,7 @@
#include "gnc-lot.h" #include "gnc-lot.h"
gboolean gncInvoiceRegister (void); gboolean gncInvoiceRegister (void);
gint64 gncInvoiceNextID (GNCBook *book); gint64 gncInvoiceNextID (QofBook *book);
void gncInvoiceSetGUID (GncInvoice *invoice, const GUID *guid); void gncInvoiceSetGUID (GncInvoice *invoice, const GUID *guid);
void gncInvoiceSetDirty (GncInvoice *invoice, gboolean dirty); void gncInvoiceSetDirty (GncInvoice *invoice, gboolean dirty);
void gncInvoiceSetPostedAcc (GncInvoice *invoice, Account *acc); void gncInvoiceSetPostedAcc (GncInvoice *invoice, Account *acc);

View File

@ -27,7 +27,7 @@
#include "gncJobP.h" #include "gncJobP.h"
struct _gncJob { struct _gncJob {
GNCBook * book; QofBook * book;
GUID guid; GUID guid;
char * id; char * id;
char * name; char * name;
@ -62,7 +62,7 @@ mark_job (GncJob *job)
/* Create/Destroy Functions */ /* Create/Destroy Functions */
GncJob *gncJobCreate (GNCBook *book) GncJob *gncJobCreate (QofBook *book)
{ {
GncJob *job; GncJob *job;
@ -221,7 +221,7 @@ void gncJobBeginEdit (GncJob *job)
GNC_BEGIN_EDIT (job, _GNC_MOD_NAME); GNC_BEGIN_EDIT (job, _GNC_MOD_NAME);
} }
static void gncJobOnError (GncJob *job, GNCBackendError errcode) static void gncJobOnError (GncJob *job, QofBackendError errcode)
{ {
PERR("Job Backend Failure: %d", errcode); PERR("Job Backend Failure: %d", errcode);
} }
@ -240,7 +240,7 @@ void gncJobCommitEdit (GncJob *job)
/* Get Functions */ /* Get Functions */
GNCBook * gncJobGetBook (GncJob *job) QofBook * gncJobGetBook (GncJob *job)
{ {
if (!job) return NULL; if (!job) return NULL;
return job->book; return job->book;
@ -290,14 +290,14 @@ gboolean gncJobGetActive (GncJob *job)
return job->active; return job->active;
} }
GncJob * gncJobLookup (GNCBook *book, const GUID *guid) GncJob * gncJobLookup (QofBook *book, const GUID *guid)
{ {
if (!book || !guid) return NULL; if (!book || !guid) return NULL;
return xaccLookupEntity (gnc_book_get_entity_table (book), return xaccLookupEntity (gnc_book_get_entity_table (book),
guid, _GNC_MOD_NAME); guid, _GNC_MOD_NAME);
} }
GncJob * gncJobLookupDirect (GUID guid, GNCBook *book) GncJob * gncJobLookupDirect (GUID guid, QofBook *book)
{ {
if (!book) return NULL; if (!book) return NULL;
return gncJobLookup (book, &guid); return gncJobLookup (book, &guid);
@ -332,27 +332,27 @@ static void remObj (GncJob *job)
gncBusinessRemoveObject (job->book, _GNC_MOD_NAME, &job->guid); gncBusinessRemoveObject (job->book, _GNC_MOD_NAME, &job->guid);
} }
static void _gncJobCreate (GNCBook *book) static void _gncJobCreate (QofBook *book)
{ {
gncBusinessCreate (book, _GNC_MOD_NAME); gncBusinessCreate (book, _GNC_MOD_NAME);
} }
static void _gncJobDestroy (GNCBook *book) static void _gncJobDestroy (QofBook *book)
{ {
gncBusinessDestroy (book, _GNC_MOD_NAME); gncBusinessDestroy (book, _GNC_MOD_NAME);
} }
static gboolean _gncJobIsDirty (GNCBook *book) static gboolean _gncJobIsDirty (QofBook *book)
{ {
return gncBusinessIsDirty (book, _GNC_MOD_NAME); return gncBusinessIsDirty (book, _GNC_MOD_NAME);
} }
static void _gncJobMarkClean (GNCBook *book) static void _gncJobMarkClean (QofBook *book)
{ {
gncBusinessSetDirtyFlag (book, _GNC_MOD_NAME, FALSE); gncBusinessSetDirtyFlag (book, _GNC_MOD_NAME, FALSE);
} }
static void _gncJobForeach (GNCBook *book, foreachObjectCB cb, static void _gncJobForeach (QofBook *book, foreachObjectCB cb,
gpointer user_data) gpointer user_data)
{ {
gncBusinessForeach (book, _GNC_MOD_NAME, cb, user_data); gncBusinessForeach (book, _GNC_MOD_NAME, cb, user_data);
@ -369,7 +369,7 @@ static const char * _gncJobPrintable (gpointer item)
} }
static GncObject_t gncJobDesc = { static GncObject_t gncJobDesc = {
GNC_OBJECT_VERSION, QOF_OBJECT_VERSION,
_GNC_MOD_NAME, _GNC_MOD_NAME,
"Job", "Job",
_gncJobCreate, _gncJobCreate,
@ -399,7 +399,7 @@ gboolean gncJobRegister (void)
return gncObjectRegister (&gncJobDesc); return gncObjectRegister (&gncJobDesc);
} }
gint64 gncJobNextID (GNCBook *book) gint64 gncJobNextID (QofBook *book)
{ {
return gnc_book_get_counter (book, _GNC_MOD_NAME); return gnc_book_get_counter (book, _GNC_MOD_NAME);
} }

View File

@ -16,7 +16,7 @@ typedef struct _gncJob GncJob;
/* Create/Destroy Functions */ /* Create/Destroy Functions */
GncJob *gncJobCreate (GNCBook *book); GncJob *gncJobCreate (QofBook *book);
void gncJobDestroy (GncJob *job); void gncJobDestroy (GncJob *job);
/* Set Functions */ /* Set Functions */
@ -32,7 +32,7 @@ void gncJobCommitEdit (GncJob *job);
/* Get Functions */ /* Get Functions */
GNCBook * gncJobGetBook (GncJob *job); QofBook * gncJobGetBook (GncJob *job);
const GUID * gncJobGetGUID (GncJob *job); const GUID * gncJobGetGUID (GncJob *job);
const char * gncJobGetID (GncJob *job); const char * gncJobGetID (GncJob *job);
const char * gncJobGetName (GncJob *job); const char * gncJobGetName (GncJob *job);
@ -41,9 +41,9 @@ GncOwner * gncJobGetOwner (GncJob *job);
gboolean gncJobGetActive (GncJob *job); gboolean gncJobGetActive (GncJob *job);
GUID gncJobRetGUID (GncJob *job); GUID gncJobRetGUID (GncJob *job);
GncJob *gncJobLookupDirect (GUID guid, GNCBook *book); GncJob *gncJobLookupDirect (GUID guid, QofBook *book);
GncJob * gncJobLookup (GNCBook *book, const GUID *guid); GncJob * gncJobLookup (QofBook *book, const GUID *guid);
gboolean gncJobIsDirty (GncJob *job); gboolean gncJobIsDirty (GncJob *job);
/* Other functions */ /* Other functions */

View File

@ -10,7 +10,7 @@
#include "gncJob.h" #include "gncJob.h"
gboolean gncJobRegister (void); gboolean gncJobRegister (void);
gint64 gncJobNextID (GNCBook *book); gint64 gncJobNextID (QofBook *book);
void gncJobSetGUID (GncJob *job, const GUID *guid); void gncJobSetGUID (GncJob *job, const GUID *guid);
#endif /* GNC_JOBP_H_ */ #endif /* GNC_JOBP_H_ */

View File

@ -29,7 +29,7 @@
#include "gncOwner.h" #include "gncOwner.h"
struct _gncOrder { struct _gncOrder {
GNCBook *book; QofBook *book;
GUID guid; GUID guid;
char * id; char * id;
@ -80,7 +80,7 @@ mark_order (GncOrder *order)
/* Create/Destroy Functions */ /* Create/Destroy Functions */
GncOrder *gncOrderCreate (GNCBook *book) GncOrder *gncOrderCreate (QofBook *book)
{ {
GncOrder *order; GncOrder *order;
@ -242,7 +242,7 @@ void gncOrderRemoveEntry (GncOrder *order, GncEntry *entry)
/* Get Functions */ /* Get Functions */
GNCBook * gncOrderGetBook (GncOrder *order) QofBook * gncOrderGetBook (GncOrder *order)
{ {
if (!order) return NULL; if (!order) return NULL;
return order->book; return order->book;
@ -305,7 +305,7 @@ GList * gncOrderGetEntries (GncOrder *order)
return order->entries; return order->entries;
} }
GncOrder * gncOrderLookup (GNCBook *book, const GUID *guid) GncOrder * gncOrderLookup (QofBook *book, const GUID *guid)
{ {
if (!book || !guid) return NULL; if (!book || !guid) return NULL;
return xaccLookupEntity (gnc_book_get_entity_table (book), return xaccLookupEntity (gnc_book_get_entity_table (book),
@ -330,7 +330,7 @@ void gncOrderBeginEdit (GncOrder *order)
GNC_BEGIN_EDIT (order, _GNC_MOD_NAME); GNC_BEGIN_EDIT (order, _GNC_MOD_NAME);
} }
static void gncOrderOnError (GncOrder *order, GNCBackendError errcode) static void gncOrderOnError (GncOrder *order, QofBackendError errcode)
{ {
PERR("Order Backend Failure: %d", errcode); PERR("Order Backend Failure: %d", errcode);
} }
@ -379,27 +379,27 @@ static void remObj (GncOrder *order)
gncBusinessRemoveObject (order->book, _GNC_MOD_NAME, &order->guid); gncBusinessRemoveObject (order->book, _GNC_MOD_NAME, &order->guid);
} }
static void _gncOrderCreate (GNCBook *book) static void _gncOrderCreate (QofBook *book)
{ {
gncBusinessCreate (book, _GNC_MOD_NAME); gncBusinessCreate (book, _GNC_MOD_NAME);
} }
static void _gncOrderDestroy (GNCBook *book) static void _gncOrderDestroy (QofBook *book)
{ {
gncBusinessDestroy (book, _GNC_MOD_NAME); gncBusinessDestroy (book, _GNC_MOD_NAME);
} }
static gboolean _gncOrderIsDirty (GNCBook *book) static gboolean _gncOrderIsDirty (QofBook *book)
{ {
return gncBusinessIsDirty (book, _GNC_MOD_NAME); return gncBusinessIsDirty (book, _GNC_MOD_NAME);
} }
static void _gncOrderMarkClean (GNCBook *book) static void _gncOrderMarkClean (QofBook *book)
{ {
gncBusinessSetDirtyFlag (book, _GNC_MOD_NAME, FALSE); gncBusinessSetDirtyFlag (book, _GNC_MOD_NAME, FALSE);
} }
static void _gncOrderForeach (GNCBook *book, foreachObjectCB cb, static void _gncOrderForeach (QofBook *book, foreachObjectCB cb,
gpointer user_data) gpointer user_data)
{ {
gncBusinessForeach (book, _GNC_MOD_NAME, cb, user_data); gncBusinessForeach (book, _GNC_MOD_NAME, cb, user_data);
@ -423,7 +423,7 @@ static const char * _gncOrderPrintable (gpointer obj)
} }
static GncObject_t gncOrderDesc = { static GncObject_t gncOrderDesc = {
GNC_OBJECT_VERSION, QOF_OBJECT_VERSION,
_GNC_MOD_NAME, _GNC_MOD_NAME,
"Order", "Order",
_gncOrderCreate, _gncOrderCreate,
@ -455,7 +455,7 @@ gboolean gncOrderRegister (void)
return gncObjectRegister (&gncOrderDesc); return gncObjectRegister (&gncOrderDesc);
} }
gint64 gncOrderNextID (GNCBook *book) gint64 gncOrderNextID (QofBook *book)
{ {
return gnc_book_get_counter (book, _GNC_MOD_NAME); return gnc_book_get_counter (book, _GNC_MOD_NAME);
} }

View File

@ -17,7 +17,7 @@ typedef struct _gncOrder GncOrder;
/* Create/Destroy Functions */ /* Create/Destroy Functions */
GncOrder *gncOrderCreate (GNCBook *book); GncOrder *gncOrderCreate (QofBook *book);
void gncOrderDestroy (GncOrder *order); void gncOrderDestroy (GncOrder *order);
/* Set Functions */ /* Set Functions */
@ -36,7 +36,7 @@ void gncOrderRemoveEntry (GncOrder *order, GncEntry *entry);
/* Get Functions */ /* Get Functions */
GNCBook * gncOrderGetBook (GncOrder *order); QofBook * gncOrderGetBook (GncOrder *order);
const GUID * gncOrderGetGUID (GncOrder *order); const GUID * gncOrderGetGUID (GncOrder *order);
const char * gncOrderGetID (GncOrder *order); const char * gncOrderGetID (GncOrder *order);
GncOwner * gncOrderGetOwner (GncOrder *order); GncOwner * gncOrderGetOwner (GncOrder *order);
@ -49,7 +49,7 @@ gboolean gncOrderGetActive (GncOrder *order);
/* Get the list Entries */ /* Get the list Entries */
GList * gncOrderGetEntries (GncOrder *order); GList * gncOrderGetEntries (GncOrder *order);
GncOrder * gncOrderLookup (GNCBook *book, const GUID *guid); GncOrder * gncOrderLookup (QofBook *book, const GUID *guid);
gboolean gncOrderIsDirty (GncOrder *order); gboolean gncOrderIsDirty (GncOrder *order);
void gncOrderBeginEdit (GncOrder *order); void gncOrderBeginEdit (GncOrder *order);
void gncOrderCommitEdit (GncOrder *order); void gncOrderCommitEdit (GncOrder *order);

View File

@ -10,7 +10,7 @@
#include "gncOrder.h" #include "gncOrder.h"
gboolean gncOrderRegister (void); gboolean gncOrderRegister (void);
gint64 gncOrderNextID (GNCBook *book); gint64 gncOrderNextID (QofBook *book);
void gncOrderSetGUID (GncOrder *order, const GUID *guid); void gncOrderSetGUID (GncOrder *order, const GUID *guid);
void gncOrderSetDirty (GncOrder *order, gboolean dirty); void gncOrderSetDirty (GncOrder *order, gboolean dirty);

View File

@ -265,7 +265,7 @@ gboolean gncOwnerGetOwnerFromLot (GNCLot *lot, GncOwner *owner)
kvp_frame *kvp; kvp_frame *kvp;
kvp_value *value; kvp_value *value;
GUID *guid; GUID *guid;
GNCBook *book; QofBook *book;
GncOwnerType type; GncOwnerType type;
if (!lot || !owner) return FALSE; if (!lot || !owner) return FALSE;

View File

@ -31,7 +31,7 @@ struct _gncTaxTable {
Timespec modtime; /* internal date of last modtime */ Timespec modtime; /* internal date of last modtime */
gint64 refcount; gint64 refcount;
GNCBook * book; QofBook * book;
GncTaxTable * parent; /* if non-null, we are an immutable child */ GncTaxTable * parent; /* if non-null, we are an immutable child */
GncTaxTable * child; /* if non-null, we have not changed */ GncTaxTable * child; /* if non-null, we have not changed */
gboolean invisible; gboolean invisible;
@ -154,7 +154,7 @@ mod_table (GncTaxTable *table)
} }
/* Create/Destroy Functions */ /* Create/Destroy Functions */
GncTaxTable * gncTaxTableCreate (GNCBook *book) GncTaxTable * gncTaxTableCreate (QofBook *book)
{ {
GncTaxTable *table; GncTaxTable *table;
if (!book) return NULL; if (!book) return NULL;
@ -394,7 +394,7 @@ void gncTaxTableBeginEdit (GncTaxTable *table)
GNC_BEGIN_EDIT (table, _GNC_MOD_NAME); GNC_BEGIN_EDIT (table, _GNC_MOD_NAME);
} }
static void gncTaxTableOnError (GncTaxTable *table, GNCBackendError errcode) static void gncTaxTableOnError (GncTaxTable *table, QofBackendError errcode)
{ {
PERR("TaxTable Backend Failure: %d", errcode); PERR("TaxTable Backend Failure: %d", errcode);
} }
@ -413,14 +413,14 @@ void gncTaxTableCommitEdit (GncTaxTable *table)
/* Get Functions */ /* Get Functions */
GncTaxTable * gncTaxTableLookup (GNCBook *book, const GUID *guid) GncTaxTable * gncTaxTableLookup (QofBook *book, const GUID *guid)
{ {
if (!book || !guid) return NULL; if (!book || !guid) return NULL;
return xaccLookupEntity (gnc_book_get_entity_table (book), return xaccLookupEntity (gnc_book_get_entity_table (book),
guid, _GNC_MOD_NAME); guid, _GNC_MOD_NAME);
} }
GncTaxTable *gncTaxTableLookupByName (GNCBook *book, const char *name) GncTaxTable *gncTaxTableLookupByName (QofBook *book, const char *name)
{ {
GList *list = gncTaxTableGetTables (book); GList *list = gncTaxTableGetTables (book);
@ -432,7 +432,7 @@ GncTaxTable *gncTaxTableLookupByName (GNCBook *book, const char *name)
return NULL; return NULL;
} }
GList * gncTaxTableGetTables (GNCBook *book) GList * gncTaxTableGetTables (QofBook *book)
{ {
struct _book_info *bi; struct _book_info *bi;
if (!book) return NULL; if (!book) return NULL;
@ -448,7 +448,7 @@ const GUID *gncTaxTableGetGUID (GncTaxTable *table)
return &table->guid; return &table->guid;
} }
GNCBook *gncTaxTableGetBook (GncTaxTable *table) QofBook *gncTaxTableGetBook (GncTaxTable *table)
{ {
if (!table) return NULL; if (!table) return NULL;
return table->book; return table->book;
@ -657,7 +657,7 @@ GUID gncTaxTableRetGUID (GncTaxTable *table)
return table->guid; return table->guid;
} }
GncTaxTable *gncTaxTableLookupDirect (GUID guid, GNCBook *book) GncTaxTable *gncTaxTableLookupDirect (GUID guid, QofBook *book)
{ {
if (!book) return NULL; if (!book) return NULL;
return gncTaxTableLookup (book, &guid); return gncTaxTableLookup (book, &guid);
@ -700,7 +700,7 @@ static void remObj (GncTaxTable *table)
add_or_rem_object (table, FALSE); add_or_rem_object (table, FALSE);
} }
static void _gncTaxTableCreate (GNCBook *book) static void _gncTaxTableCreate (QofBook *book)
{ {
struct _book_info *bi; struct _book_info *bi;
@ -711,7 +711,7 @@ static void _gncTaxTableCreate (GNCBook *book)
gnc_book_set_data (book, _GNC_MOD_NAME, bi); gnc_book_set_data (book, _GNC_MOD_NAME, bi);
} }
static void _gncTaxTableDestroy (GNCBook *book) static void _gncTaxTableDestroy (QofBook *book)
{ {
struct _book_info *bi; struct _book_info *bi;
@ -725,24 +725,24 @@ static void _gncTaxTableDestroy (GNCBook *book)
g_free (bi); g_free (bi);
} }
static gboolean _gncTaxTableIsDirty (GNCBook *book) static gboolean _gncTaxTableIsDirty (QofBook *book)
{ {
return gncBusinessIsDirty (book, _GNC_MOD_NAME); return gncBusinessIsDirty (book, _GNC_MOD_NAME);
} }
static void _gncTaxTableMarkClean (GNCBook *book) static void _gncTaxTableMarkClean (QofBook *book)
{ {
gncBusinessSetDirtyFlag (book, _GNC_MOD_NAME, FALSE); gncBusinessSetDirtyFlag (book, _GNC_MOD_NAME, FALSE);
} }
static void _gncTaxTableForeach (GNCBook *book, foreachObjectCB cb, static void _gncTaxTableForeach (QofBook *book, foreachObjectCB cb,
gpointer user_data) gpointer user_data)
{ {
gncBusinessForeach (book, _GNC_MOD_NAME, cb, user_data); gncBusinessForeach (book, _GNC_MOD_NAME, cb, user_data);
} }
static GncObject_t gncTaxTableDesc = { static GncObject_t gncTaxTableDesc = {
GNC_OBJECT_VERSION, QOF_OBJECT_VERSION,
_GNC_MOD_NAME, _GNC_MOD_NAME,
"Tax Table", "Tax Table",
_gncTaxTableCreate, _gncTaxTableCreate,

View File

@ -41,7 +41,7 @@ const char * gncTaxIncludedTypeToString (GncTaxIncluded type);
gboolean gncTaxIncludedStringToType (const char *str, GncTaxIncluded *type); gboolean gncTaxIncludedStringToType (const char *str, GncTaxIncluded *type);
/* Create/Destroy Functions */ /* Create/Destroy Functions */
GncTaxTable * gncTaxTableCreate (GNCBook *book); GncTaxTable * gncTaxTableCreate (QofBook *book);
void gncTaxTableDestroy (GncTaxTable *table); void gncTaxTableDestroy (GncTaxTable *table);
GncTaxTableEntry * gncTaxTableEntryCreate (void); GncTaxTableEntry * gncTaxTableEntryCreate (void);
void gncTaxTableEntryDestroy (GncTaxTableEntry *entry); void gncTaxTableEntryDestroy (GncTaxTableEntry *entry);
@ -63,12 +63,12 @@ void gncTaxTableBeginEdit (GncTaxTable *table);
void gncTaxTableCommitEdit (GncTaxTable *table); void gncTaxTableCommitEdit (GncTaxTable *table);
/* Get Functions */ /* Get Functions */
GncTaxTable *gncTaxTableLookup (GNCBook *book, const GUID *guid); GncTaxTable *gncTaxTableLookup (QofBook *book, const GUID *guid);
GncTaxTable *gncTaxTableLookupByName (GNCBook *book, const char *name); GncTaxTable *gncTaxTableLookupByName (QofBook *book, const char *name);
GList * gncTaxTableGetTables (GNCBook *book); GList * gncTaxTableGetTables (QofBook *book);
const GUID *gncTaxTableGetGUID (GncTaxTable *table); const GUID *gncTaxTableGetGUID (GncTaxTable *table);
GNCBook *gncTaxTableGetBook (GncTaxTable *table); QofBook *gncTaxTableGetBook (GncTaxTable *table);
const char *gncTaxTableGetName (GncTaxTable *table); const char *gncTaxTableGetName (GncTaxTable *table);
GncTaxTable *gncTaxTableGetParent (GncTaxTable *table); GncTaxTable *gncTaxTableGetParent (GncTaxTable *table);
GncTaxTable *gncTaxTableReturnChild (GncTaxTable *table, gboolean make_new); GncTaxTable *gncTaxTableReturnChild (GncTaxTable *table, gboolean make_new);
@ -85,7 +85,7 @@ int gncTaxTableCompare (GncTaxTable *a, GncTaxTable *b);
int gncTaxTableEntryCompare (GncTaxTableEntry *a, GncTaxTableEntry *b); int gncTaxTableEntryCompare (GncTaxTableEntry *a, GncTaxTableEntry *b);
GUID gncTaxTableRetGUID (GncTaxTable *table); GUID gncTaxTableRetGUID (GncTaxTable *table);
GncTaxTable *gncTaxTableLookupDirect (GUID guid, GNCBook *book); GncTaxTable *gncTaxTableLookupDirect (GUID guid, QofBook *book);
/************************************************/ /************************************************/

View File

@ -28,7 +28,7 @@
#include "gncAddress.h" #include "gncAddress.h"
struct _gncVendor { struct _gncVendor {
GNCBook * book; QofBook * book;
GUID guid; GUID guid;
char * id; char * id;
char * name; char * name;
@ -70,7 +70,7 @@ mark_vendor (GncVendor *vendor)
/* Create/Destroy Functions */ /* Create/Destroy Functions */
GncVendor *gncVendorCreate (GNCBook *book) GncVendor *gncVendorCreate (QofBook *book)
{ {
GncVendor *vendor; GncVendor *vendor;
@ -247,7 +247,7 @@ void gncVendorSetTaxTable (GncVendor *vendor, GncTaxTable *table)
/* Get Functions */ /* Get Functions */
GNCBook * gncVendorGetBook (GncVendor *vendor) QofBook * gncVendorGetBook (GncVendor *vendor)
{ {
if (!vendor) return NULL; if (!vendor) return NULL;
return vendor->book; return vendor->book;
@ -355,7 +355,7 @@ void gncVendorBeginEdit (GncVendor *vendor)
GNC_BEGIN_EDIT (vendor, _GNC_MOD_NAME); GNC_BEGIN_EDIT (vendor, _GNC_MOD_NAME);
} }
static void gncVendorOnError (GncVendor *vendor, GNCBackendError errcode) static void gncVendorOnError (GncVendor *vendor, QofBackendError errcode)
{ {
PERR("Vendor Backend Failure: %d", errcode); PERR("Vendor Backend Failure: %d", errcode);
} }
@ -409,13 +409,13 @@ GUID gncVendorRetGUID (GncVendor *vendor)
return vendor->guid; return vendor->guid;
} }
GncVendor * gncVendorLookupDirect (GUID guid, GNCBook *book) GncVendor * gncVendorLookupDirect (GUID guid, QofBook *book)
{ {
if (!book) return NULL; if (!book) return NULL;
return gncVendorLookup (book, &guid); return gncVendorLookup (book, &guid);
} }
GncVendor * gncVendorLookup (GNCBook *book, const GUID *guid) GncVendor * gncVendorLookup (QofBook *book, const GUID *guid)
{ {
if (!book || !guid) return NULL; if (!book || !guid) return NULL;
return xaccLookupEntity (gnc_book_get_entity_table (book), return xaccLookupEntity (gnc_book_get_entity_table (book),
@ -440,27 +440,27 @@ static void remObj (GncVendor *vendor)
gncBusinessRemoveObject (vendor->book, _GNC_MOD_NAME, &vendor->guid); gncBusinessRemoveObject (vendor->book, _GNC_MOD_NAME, &vendor->guid);
} }
static void _gncVendorCreate (GNCBook *book) static void _gncVendorCreate (QofBook *book)
{ {
gncBusinessCreate (book, _GNC_MOD_NAME); gncBusinessCreate (book, _GNC_MOD_NAME);
} }
static void _gncVendorDestroy (GNCBook *book) static void _gncVendorDestroy (QofBook *book)
{ {
gncBusinessDestroy (book, _GNC_MOD_NAME); gncBusinessDestroy (book, _GNC_MOD_NAME);
} }
static gboolean _gncVendorIsDirty (GNCBook *book) static gboolean _gncVendorIsDirty (QofBook *book)
{ {
return gncBusinessIsDirty (book, _GNC_MOD_NAME); return gncBusinessIsDirty (book, _GNC_MOD_NAME);
} }
static void _gncVendorMarkClean (GNCBook *book) static void _gncVendorMarkClean (QofBook *book)
{ {
gncBusinessSetDirtyFlag (book, _GNC_MOD_NAME, FALSE); gncBusinessSetDirtyFlag (book, _GNC_MOD_NAME, FALSE);
} }
static void _gncVendorForeach (GNCBook *book, foreachObjectCB cb, static void _gncVendorForeach (QofBook *book, foreachObjectCB cb,
gpointer user_data) gpointer user_data)
{ {
gncBusinessForeach (book, _GNC_MOD_NAME, cb, user_data); gncBusinessForeach (book, _GNC_MOD_NAME, cb, user_data);
@ -477,7 +477,7 @@ static const char * _gncVendorPrintable (gpointer item)
} }
static GncObject_t gncVendorDesc = { static GncObject_t gncVendorDesc = {
GNC_OBJECT_VERSION, QOF_OBJECT_VERSION,
_GNC_MOD_NAME, _GNC_MOD_NAME,
"Vendor", "Vendor",
_gncVendorCreate, _gncVendorCreate,
@ -505,7 +505,7 @@ gboolean gncVendorRegister (void)
return gncObjectRegister (&gncVendorDesc); return gncObjectRegister (&gncVendorDesc);
} }
gint64 gncVendorNextID (GNCBook *book) gint64 gncVendorNextID (QofBook *book)
{ {
return gnc_book_get_counter (book, _GNC_MOD_NAME); return gnc_book_get_counter (book, _GNC_MOD_NAME);
} }

View File

@ -19,7 +19,7 @@ typedef struct _gncVendor GncVendor;
/* Create/Destroy Functions */ /* Create/Destroy Functions */
GncVendor *gncVendorCreate (GNCBook *book); GncVendor *gncVendorCreate (QofBook *book);
void gncVendorDestroy (GncVendor *vendor); void gncVendorDestroy (GncVendor *vendor);
/* Set Functions */ /* Set Functions */
@ -43,7 +43,7 @@ void gncVendorCommitEdit (GncVendor *vendor);
/* Get Functions */ /* Get Functions */
GNCBook * gncVendorGetBook (GncVendor *vendor); QofBook * gncVendorGetBook (GncVendor *vendor);
const GUID * gncVendorGetGUID (GncVendor *vendor); const GUID * gncVendorGetGUID (GncVendor *vendor);
const char * gncVendorGetID (GncVendor *vendor); const char * gncVendorGetID (GncVendor *vendor);
const char * gncVendorGetName (GncVendor *vendor); const char * gncVendorGetName (GncVendor *vendor);
@ -60,9 +60,9 @@ GncTaxTable* gncVendorGetTaxTable (GncVendor *vendor);
GList * gncVendorGetJoblist (GncVendor *vendor, gboolean show_all); GList * gncVendorGetJoblist (GncVendor *vendor, gboolean show_all);
GUID gncVendorRetGUID (GncVendor *vendor); GUID gncVendorRetGUID (GncVendor *vendor);
GncVendor * gncVendorLookupDirect (GUID guid, GNCBook *book); GncVendor * gncVendorLookupDirect (GUID guid, QofBook *book);
GncVendor * gncVendorLookup (GNCBook *book, const GUID *guid); GncVendor * gncVendorLookup (QofBook *book, const GUID *guid);
gboolean gncVendorIsDirty (GncVendor *vendor); gboolean gncVendorIsDirty (GncVendor *vendor);
int gncVendorCompare (GncVendor *a, GncVendor *b); int gncVendorCompare (GncVendor *a, GncVendor *b);

View File

@ -10,7 +10,7 @@
#include "gncVendor.h" #include "gncVendor.h"
gboolean gncVendorRegister (void); gboolean gncVendorRegister (void);
gint64 gncVendorNextID (GNCBook *book); gint64 gncVendorNextID (QofBook *book);
void gncVendorSetGUID (GncVendor *vendor, const GUID *guid); void gncVendorSetGUID (GncVendor *vendor, const GUID *guid);
#endif /* GNC_VENDORP_H_ */ #endif /* GNC_VENDORP_H_ */