From 8d97c8b30f45fa82eebacdad483a1dfc4ff967ab Mon Sep 17 00:00:00 2001 From: Linas Vepstas Date: Wed, 11 Jun 2003 16:42:51 +0000 Subject: [PATCH] add clarifying comments git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@8578 57a11ea4-9604-0410-9ed3-97b8803252fd --- src/engine/Backend.c | 4 +++- src/engine/Backend.h | 22 +++++++++++----------- src/engine/BackendP.h | 19 +++++++++++++++---- 3 files changed, 29 insertions(+), 16 deletions(-) diff --git a/src/engine/Backend.c b/src/engine/Backend.c index 6fc02444cc..534c6e2914 100644 --- a/src/engine/Backend.c +++ b/src/engine/Backend.c @@ -25,6 +25,7 @@ #include #include +#include "Backend.h" #include "BackendP.h" /* static short module = MOD_ENGINE; */ @@ -111,7 +112,6 @@ xaccInitBackend(Backend *be) be->compile_query = NULL; be->free_query = NULL; be->run_query = NULL; - be->price_lookup = NULL; be->sync = NULL; @@ -123,6 +123,8 @@ xaccInitBackend(Backend *be) be->error_msg = NULL; be->percentage = NULL; + /* XXX remove these */ + be->price_lookup = NULL; be->export = NULL; } diff --git a/src/engine/Backend.h b/src/engine/Backend.h index 1b1cb05162..867096ba7e 100644 --- a/src/engine/Backend.h +++ b/src/engine/Backend.h @@ -41,7 +41,7 @@ typedef enum { ERR_BACKEND_NO_ERR = 0, ERR_BACKEND_NO_BACKEND, /**< Backend * pointer was null the err routine - or no backend handler (ENOSYS) */ + or no backend handler (ENOSYS) */ ERR_BACKEND_BAD_URL, /**< Can't parse url */ ERR_BACKEND_NO_SUCH_DB, /**< the named database doesn't exist */ ERR_BACKEND_CANT_CONNECT, /**< bad dbname/login/passwd or network failure */ @@ -52,11 +52,11 @@ typedef enum { ERR_BACKEND_SERVER_ERR, /**< error in response from server */ ERR_BACKEND_ALLOC, /**< internal memory allocation failure */ ERR_BACKEND_PERM, /**< user login successful, but no permissions - to access the desired object */ + to access the desired object */ ERR_BACKEND_MODIFIED, /**< commit of object update failed because - another user has modified the object */ + another user has modified the object */ ERR_BACKEND_MOD_DESTROY, /**< commit of object update failed because - another user has deleted the object */ + another user has deleted the object */ ERR_BACKEND_MISC, /**< undetermined error */ /* fileio errors */ @@ -80,13 +80,13 @@ typedef enum { ERR_SQL_DB_BUSY, /**< database is busy, cannot upgrade version */ /* RPC errors */ - ERR_RPC_HOST_UNK = 4000, /**< Host unknown */ - ERR_RPC_CANT_BIND, /**< can't bind to address */ - ERR_RPC_CANT_ACCEPT, /**< can't accept connection */ - ERR_RPC_NO_CONNECTION, /**< no connection to server */ - ERR_RPC_BAD_VERSION, /**< RPC Version Mismatch */ - ERR_RPC_FAILED, /**< Operation failed */ - ERR_RPC_NOT_ADDED, /**< object not added */ + ERR_RPC_HOST_UNK = 4000, /**< Host unknown */ + ERR_RPC_CANT_BIND, /**< can't bind to address */ + ERR_RPC_CANT_ACCEPT, /**< can't accept connection */ + ERR_RPC_NO_CONNECTION, /**< no connection to server */ + ERR_RPC_BAD_VERSION, /**< RPC Version Mismatch */ + ERR_RPC_FAILED, /**< Operation failed */ + ERR_RPC_NOT_ADDED, /**< object not added */ } GNCBackendError; /** \brief Pseudo-object providing an interface between the diff --git a/src/engine/BackendP.h b/src/engine/BackendP.h index 2c5093efa4..095de9d102 100644 --- a/src/engine/BackendP.h +++ b/src/engine/BackendP.h @@ -44,10 +44,9 @@ #include "Backend.h" #include "QueryNew.h" +#include "gnc-book.h" #include "gnc-session.h" -#include "gnc-pricedb.h" - /* * The session_begin() routine gives the backend a second initialization * opportunity. It is suggested that the backend check that @@ -243,7 +242,6 @@ struct backend_s gpointer (*compile_query) (Backend *, QueryNew *); void (*free_query) (Backend *, gpointer); void (*run_query) (Backend *, gpointer); - void (*price_lookup) (Backend *, GNCPriceLookup *); void (*sync) (Backend *, GNCBook *); @@ -257,7 +255,20 @@ struct backend_s GNCBackendError last_err; char * error_msg; - /* Export should really _NOT_ be here, but is left here for now */ + /* XXX price_lookup should be removed during the redesign + * of the SQL backend... prices can now be queried using + * the generic query mechanism. + * + * Note the correct signature for this call is + * void (*price_lookup) (Backend *, GNCPriceLookup *); + * we use gpointer to avoid an unwanted include file dependency. + */ + void (*price_lookup) (Backend *, gpointer); + + /* XXX Export should really _NOT_ be here, but is left here for now. + * I'm not sure where this should be going to. It should be + * removed ASAP. + */ void (*export) (Backend *, GNCBook *); };