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 <g-wrap-wct.h>
#include "Backend.h"
#include "global-options.h"
#include "gnc-book.h"
#include "gnc-commodity.h"
#include "gnc-component-manager.h"
#include "gnc-engine-util.h"
@ -39,9 +37,11 @@
#include "gnc-file-history.h"
#include "gnc-file-p.h"
#include "gnc-gui-query.h"
#include "gnc-session.h"
#include "gnc-ui.h"
#include "gnc-ui-util.h"
#include "qofbackend.h"
#include "qofbook.h"
#include "qofsession.h"
#include "messages.h"
/** GLOBALS *********************************************************/
@ -78,11 +78,11 @@ void
gnc_file_init (void)
{
/* Make sure we have a current session. */
gnc_get_current_session ();
qof_session_get_current_session ();
}
static gboolean
show_session_error (GNCBackendError io_error, const char *newfile)
show_session_error (QofBackendError io_error, const char *newfile)
{
gboolean uh_oh = TRUE;
const char *fmt;
@ -222,7 +222,7 @@ show_session_error (GNCBackendError io_error, const char *newfile)
}
static void
gnc_add_history (GNCSession * session)
gnc_add_history (QofSession * session)
{
char *url;
char *file;
@ -230,7 +230,7 @@ gnc_add_history (GNCSession * session)
if (!session) return;
if (!history_add_file_func) return;
url = xaccResolveURL (gnc_session_get_url (session));
url = xaccResolveURL (qof_session_get_url (session));
if (!url)
return;
@ -247,7 +247,7 @@ gnc_add_history (GNCSession * session)
static 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_c_eval_string("gnc:*book-opened-hook*"),
(session ?
@ -258,14 +258,14 @@ gnc_book_opened (void)
void
gnc_file_new (void)
{
GNCSession *session;
QofSession *session;
/* If user attempts to start a new session before saving results of
* the last one, prompt them to clean up their act. */
if (!gnc_file_query_save ())
return;
session = gnc_get_current_session ();
session = qof_session_get_current_session ();
/* close any ongoing file sessions, and free the accounts.
* disable events so we don't get spammed by redraws. */
@ -278,10 +278,10 @@ gnc_file_new (void)
SCM_BOOL_F));
gnc_close_gui_component_by_session (session);
gnc_session_destroy (session);
qof_session_destroy (session);
/* 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_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;
* 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;
const char *message = _("Changes have been made since the last "
@ -333,10 +333,10 @@ gnc_file_query_save (void)
static gboolean
gnc_post_file_open (const char * filename)
{
GNCSession *current_session, *new_session;
QofSession *current_session, *new_session;
gboolean uh_oh = FALSE;
char * newfile;
GNCBackendError io_err = ERR_BACKEND_NO_ERR;
QofBackendError io_err = ERR_BACKEND_NO_ERR;
if (!filename) return FALSE;
@ -357,21 +357,21 @@ gnc_post_file_open (const char * filename)
/* -------------- BEGIN CORE SESSION CODE ------------- */
/* -- 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_c_eval_string("gnc:*book-closed-hook*"),
(current_session ?
gw_wcp_assimilate_ptr (current_session,
scm_c_eval_string("<gnc:Session*>")) :
SCM_BOOL_F));
gnc_session_destroy (current_session);
qof_session_destroy (current_session);
/* load the accounts from the users datafile */
/* 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);
io_err = gnc_session_get_error (new_session);
qof_session_begin (new_session, newfile, FALSE, FALSE);
io_err = qof_session_get_error (new_session);
/* if file appears to be locked, ask the user ... */
if (ERR_BACKEND_LOCKED == io_err)
@ -400,7 +400,7 @@ gnc_post_file_open (const char * filename)
else if (rc == 1)
{
/* 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
{
@ -419,14 +419,14 @@ gnc_post_file_open (const char * filename)
if (FALSE == show_session_error (io_err, newfile))
{
/* 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.
* If its still locked, still, doesn't exist, still too old, then
* 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) ||
(ERR_BACKEND_NO_SUCH_DB == io_err) ||
(ERR_SQL_DB_TOO_OLD == io_err))
@ -444,17 +444,17 @@ gnc_post_file_open (const char * filename)
if (file_percentage_func) {
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);
} else {
gnc_session_load (new_session, NULL);
qof_session_load (new_session, NULL);
}
/* 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);
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;
/* Umm, came up empty-handed, but no error:
@ -470,7 +470,7 @@ gnc_post_file_open (const char * filename)
/* going down -- abandon ship */
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
* 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
* topgroup, because if the user continues, then bad things will
* happen. */
gnc_get_current_session ();
qof_session_get_current_session ();
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 */
/* close up the old file session (if any) */
gnc_set_current_session(new_session);
qof_session_set_current_session(new_session);
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
* might be left with a null topgroup, which leads to nastiness when
* user goes to create their very first account. So create one. */
gnc_get_current_session ();
qof_session_get_current_session ();
return result;
}
@ -552,9 +552,9 @@ gnc_file_open_file (const char * newfile)
void
gnc_file_export_file(const char * newfile)
{
GNCSession *current_session, *new_session;
QofSession *current_session, *new_session;
gboolean ok;
GNCBackendError io_err = ERR_BACKEND_NO_ERR;
QofBackendError io_err = ERR_BACKEND_NO_ERR;
char *default_dir;
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 -- */
new_session = gnc_session_new ();
gnc_session_begin (new_session, newfile, FALSE, FALSE);
new_session = qof_session_new ();
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 (ERR_BACKEND_LOCKED == io_err)
@ -592,14 +592,14 @@ gnc_file_export_file(const char * newfile)
if (FALSE == show_session_error (io_err, newfile))
{
/* 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 -------------- */
/* 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"
"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 */
gnc_set_busy_cursor (NULL, TRUE);
current_session = gnc_get_current_session();
current_session = qof_session_get_current_session();
if (file_percentage_func) {
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(NULL, -1.0);
} 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_session_destroy (new_session);
qof_session_destroy (new_session);
gnc_engine_resume_events();
if (!ok)
@ -643,17 +643,17 @@ static gboolean been_here_before = FALSE;
void
gnc_file_save (void)
{
GNCBackendError io_err;
QofBackendError io_err;
const char * newfile;
GNCSession *session;
QofSession *session;
ENTER (" ");
/* hack alert -- Somehow make sure all in-progress edits get committed! */
/* 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 ();
return;
@ -663,17 +663,17 @@ gnc_file_save (void)
gnc_set_busy_cursor (NULL, TRUE);
if (file_percentage_func) {
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);
} else {
gnc_session_save (session, NULL);
qof_session_save (session, NULL);
}
gnc_unset_busy_cursor (NULL);
/* Make sure everything's OK - disk could be full, file could have
become read-only etc. */
newfile = gnc_session_get_file_path (session);
io_err = gnc_session_get_error (session);
newfile = qof_session_get_file_path (session);
io_err = qof_session_get_error (session);
if (ERR_BACKEND_NO_ERR != io_err)
{
show_session_error (io_err, newfile);
@ -699,14 +699,14 @@ gnc_file_save (void)
void
gnc_file_save_as (void)
{
GNCSession *new_session;
GNCSession *session;
QofSession *new_session;
QofSession *session;
const char *filename;
char *default_dir = NULL; /* Default to last open */
const char *last;
char *newfile;
const char *oldfile;
GNCBackendError io_err = ERR_BACKEND_NO_ERR;
QofBackendError io_err = ERR_BACKEND_NO_ERR;
ENTER(" ");
@ -736,8 +736,8 @@ gnc_file_save_as (void)
return;
}
session = gnc_get_current_session ();
oldfile = gnc_session_get_file_path (session);
session = qof_session_get_current_session ();
oldfile = qof_session_get_file_path (session);
if (oldfile && (strcmp(oldfile, newfile) == 0))
{
g_free (newfile);
@ -747,10 +747,10 @@ gnc_file_save_as (void)
/* -- this session code is NOT identical in FileOpen and FileSaveAs -- */
new_session = gnc_session_new ();
gnc_session_begin (new_session, newfile, FALSE, FALSE);
new_session = qof_session_new ();
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 (ERR_BACKEND_LOCKED == io_err)
@ -758,7 +758,7 @@ gnc_file_save_as (void)
if (FALSE == show_session_error (io_err, newfile))
{
/* 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))
{
/* 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)
* 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)
{
show_session_error (io_err, newfile);
gnc_session_destroy (new_session);
qof_session_destroy (new_session);
g_free (newfile);
return;
}
/* if we got to here, then we've successfully gotten a new session */
/* close up the old file session (if any) */
gnc_session_swap_data (session, new_session);
gnc_session_destroy (session);
qof_session_swap_data (session, new_session);
qof_session_destroy (session);
session = NULL;
gnc_set_current_session(new_session);
qof_session_set_current_session(new_session);
/* --------------- END CORE SESSION CODE -------------- */
/* 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"
"Are you sure you want to overwrite it?");
@ -821,9 +821,9 @@ gnc_file_save_as (void)
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
* 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*>")) :
SCM_BOOL_F));
gnc_session_destroy (session);
qof_session_destroy (session);
gnc_get_current_session ();
qof_session_get_current_session ();
gnc_engine_resume_events ();
}

View File

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

View File

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

View File

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

View File

@ -25,7 +25,7 @@ typedef enum {
} GncBillTermType;
/* Create/Destroy Functions */
GncBillTerm * gncBillTermCreate (GNCBook *book);
GncBillTerm * gncBillTermCreate (QofBook *book);
void gncBillTermDestroy (GncBillTerm *term);
/* Set Functions */
@ -45,12 +45,12 @@ void gncBillTermBeginEdit (GncBillTerm *term);
void gncBillTermCommitEdit (GncBillTerm *term);
/* Get Functions */
GncBillTerm *gncBillTermLookup (GNCBook *book, const GUID *guid);
GncBillTerm *gncBillTermLookupByName (GNCBook *book, const char *name);
GList * gncBillTermGetTerms (GNCBook *book);
GncBillTerm *gncBillTermLookup (QofBook *book, const GUID *guid);
GncBillTerm *gncBillTermLookupByName (QofBook *book, const char *name);
GList * gncBillTermGetTerms (QofBook *book);
const GUID *gncBillTermGetGUID (GncBillTerm *term);
GNCBook *gncBillTermGetBook (GncBillTerm *term);
QofBook *gncBillTermGetBook (GncBillTerm *term);
const char *gncBillTermGetName (GncBillTerm *term);
const char *gncBillTermGetDescription (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);
}
void gncBusinessForeach (GNCBook *book, GNCIdType mod_name,
void gncBusinessForeach (QofBook *book, GNCIdType mod_name,
foreachObjectCB cb, gpointer user_data)
{
GncBookInfo *bi;
@ -40,7 +40,7 @@ void gncBusinessForeach (GNCBook *book, GNCIdType mod_name,
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;
@ -51,7 +51,7 @@ void gncBusinessCreate (GNCBook *book, GNCIdType mod_name)
gnc_book_set_data (book, mod_name, bi);
}
void gncBusinessDestroy (GNCBook *book, GNCIdType mod_name)
void gncBusinessDestroy (QofBook *book, GNCIdType mod_name)
{
GncBookInfo *bi;
@ -64,7 +64,7 @@ void gncBusinessDestroy (GNCBook *book, GNCIdType mod_name)
g_free (bi);
}
gboolean gncBusinessIsDirty (GNCBook *book, GNCIdType mod_name)
gboolean gncBusinessIsDirty (QofBook *book, GNCIdType mod_name)
{
GncBookInfo *bi;
@ -74,7 +74,7 @@ gboolean gncBusinessIsDirty (GNCBook *book, GNCIdType mod_name)
return bi->is_dirty;
}
void gncBusinessSetDirtyFlag (GNCBook *book, GNCIdType mod_name,
void gncBusinessSetDirtyFlag (QofBook *book, GNCIdType mod_name,
gboolean is_dirty)
{
GncBookInfo *bi;
@ -85,7 +85,7 @@ void gncBusinessSetDirtyFlag (GNCBook *book, GNCIdType mod_name,
bi->is_dirty = is_dirty;
}
void gncBusinessAddObject (GNCBook *book, GNCIdType mod_name,
void gncBusinessAddObject (QofBook *book, GNCIdType mod_name,
gpointer obj, const GUID *guid)
{
GncBookInfo *bi;
@ -95,7 +95,7 @@ void gncBusinessAddObject (GNCBook *book, GNCIdType mod_name,
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)
{
GncBookInfo *bi;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -41,7 +41,7 @@ const char * gncTaxIncludedTypeToString (GncTaxIncluded type);
gboolean gncTaxIncludedStringToType (const char *str, GncTaxIncluded *type);
/* Create/Destroy Functions */
GncTaxTable * gncTaxTableCreate (GNCBook *book);
GncTaxTable * gncTaxTableCreate (QofBook *book);
void gncTaxTableDestroy (GncTaxTable *table);
GncTaxTableEntry * gncTaxTableEntryCreate (void);
void gncTaxTableEntryDestroy (GncTaxTableEntry *entry);
@ -63,12 +63,12 @@ void gncTaxTableBeginEdit (GncTaxTable *table);
void gncTaxTableCommitEdit (GncTaxTable *table);
/* Get Functions */
GncTaxTable *gncTaxTableLookup (GNCBook *book, const GUID *guid);
GncTaxTable *gncTaxTableLookupByName (GNCBook *book, const char *name);
GList * gncTaxTableGetTables (GNCBook *book);
GncTaxTable *gncTaxTableLookup (QofBook *book, const GUID *guid);
GncTaxTable *gncTaxTableLookupByName (QofBook *book, const char *name);
GList * gncTaxTableGetTables (QofBook *book);
const GUID *gncTaxTableGetGUID (GncTaxTable *table);
GNCBook *gncTaxTableGetBook (GncTaxTable *table);
QofBook *gncTaxTableGetBook (GncTaxTable *table);
const char *gncTaxTableGetName (GncTaxTable *table);
GncTaxTable *gncTaxTableGetParent (GncTaxTable *table);
GncTaxTable *gncTaxTableReturnChild (GncTaxTable *table, gboolean make_new);
@ -85,7 +85,7 @@ int gncTaxTableCompare (GncTaxTable *a, GncTaxTable *b);
int gncTaxTableEntryCompare (GncTaxTableEntry *a, GncTaxTableEntry *b);
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"
struct _gncVendor {
GNCBook * book;
QofBook * book;
GUID guid;
char * id;
char * name;
@ -70,7 +70,7 @@ mark_vendor (GncVendor *vendor)
/* Create/Destroy Functions */
GncVendor *gncVendorCreate (GNCBook *book)
GncVendor *gncVendorCreate (QofBook *book)
{
GncVendor *vendor;
@ -247,7 +247,7 @@ void gncVendorSetTaxTable (GncVendor *vendor, GncTaxTable *table)
/* Get Functions */
GNCBook * gncVendorGetBook (GncVendor *vendor)
QofBook * gncVendorGetBook (GncVendor *vendor)
{
if (!vendor) return NULL;
return vendor->book;
@ -355,7 +355,7 @@ void gncVendorBeginEdit (GncVendor *vendor)
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);
}
@ -409,13 +409,13 @@ GUID gncVendorRetGUID (GncVendor *vendor)
return vendor->guid;
}
GncVendor * gncVendorLookupDirect (GUID guid, GNCBook *book)
GncVendor * gncVendorLookupDirect (GUID guid, QofBook *book)
{
if (!book) return NULL;
return gncVendorLookup (book, &guid);
}
GncVendor * gncVendorLookup (GNCBook *book, const GUID *guid)
GncVendor * gncVendorLookup (QofBook *book, const GUID *guid)
{
if (!book || !guid) return NULL;
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);
}
static void _gncVendorCreate (GNCBook *book)
static void _gncVendorCreate (QofBook *book)
{
gncBusinessCreate (book, _GNC_MOD_NAME);
}
static void _gncVendorDestroy (GNCBook *book)
static void _gncVendorDestroy (QofBook *book)
{
gncBusinessDestroy (book, _GNC_MOD_NAME);
}
static gboolean _gncVendorIsDirty (GNCBook *book)
static gboolean _gncVendorIsDirty (QofBook *book)
{
return gncBusinessIsDirty (book, _GNC_MOD_NAME);
}
static void _gncVendorMarkClean (GNCBook *book)
static void _gncVendorMarkClean (QofBook *book)
{
gncBusinessSetDirtyFlag (book, _GNC_MOD_NAME, FALSE);
}
static void _gncVendorForeach (GNCBook *book, foreachObjectCB cb,
static void _gncVendorForeach (QofBook *book, foreachObjectCB cb,
gpointer user_data)
{
gncBusinessForeach (book, _GNC_MOD_NAME, cb, user_data);
@ -477,7 +477,7 @@ static const char * _gncVendorPrintable (gpointer item)
}
static GncObject_t gncVendorDesc = {
GNC_OBJECT_VERSION,
QOF_OBJECT_VERSION,
_GNC_MOD_NAME,
"Vendor",
_gncVendorCreate,
@ -505,7 +505,7 @@ gboolean gncVendorRegister (void)
return gncObjectRegister (&gncVendorDesc);
}
gint64 gncVendorNextID (GNCBook *book)
gint64 gncVendorNextID (QofBook *book)
{
return gnc_book_get_counter (book, _GNC_MOD_NAME);
}

View File

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

View File

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