From fc57f9bea050630d67bde98404398c79944132e1 Mon Sep 17 00:00:00 2001 From: Linas Vepstas Date: Mon, 13 May 2002 04:28:17 +0000 Subject: [PATCH] start roughing in support for lots git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@6858 57a11ea4-9604-0410-9ed3-97b8803252fd --- src/engine/GNCId.h | 23 ++++++++++++----------- src/engine/Makefile.am | 2 ++ src/engine/Transaction.c | 1 + src/engine/TransactionP.h | 2 ++ src/engine/gnc-engine.h | 3 ++- 5 files changed, 19 insertions(+), 12 deletions(-) diff --git a/src/engine/GNCId.h b/src/engine/GNCId.h index b6a40cfaaf..b59b91b5ec 100644 --- a/src/engine/GNCId.h +++ b/src/engine/GNCId.h @@ -46,19 +46,20 @@ * an entity, the type of the entity will match the type of the * identifier. */ -typedef char * GNCIdType; +typedef const char * GNCIdType; typedef const char * GNCIdTypeConst; -#define GNC_ID_NONE NULL -#define GNC_ID_NULL "null" -#define GNC_ID_ACCOUNT "Account" -#define GNC_ID_TRANS "Trans" -#define GNC_ID_SPLIT "Split" -#define GNC_ID_PRICE "Price" -#define GNC_ID_BOOK "Book" -#define GNC_ID_SESSION "Session" -#define GNC_ID_SCHEDXACTION "SchedXaction" -#define GNC_ID_FREQSPEC "FreqSpec" +#define GNC_ID_NONE NULL +#define GNC_ID_ACCOUNT "Account" +#define GNC_ID_BOOK "Book" +#define GNC_ID_FREQSPEC "FreqSpec" +#define GNC_ID_LOT "Lot" +#define GNC_ID_NULL "null" +#define GNC_ID_PRICE "Price" +#define GNC_ID_SPLIT "Split" +#define GNC_ID_SCHEDXACTION "SchedXaction" +#define GNC_ID_SESSION "Session" +#define GNC_ID_TRANS "Trans" /* Return the type of an identifier. */ GNCIdType xaccGUIDType (const GUID * guid, GNCBook *book); diff --git a/src/engine/Makefile.am b/src/engine/Makefile.am index 44946061bb..6d920f1fdd 100644 --- a/src/engine/Makefile.am +++ b/src/engine/Makefile.am @@ -28,6 +28,7 @@ libgncmod_engine_la_SOURCES = \ gnc-engine-util.c \ gnc-engine.c \ gnc-event.c \ + gnc-lot.c \ gnc-numeric.c \ gnc-pricedb.c \ gnc-session.c \ @@ -90,6 +91,7 @@ noinst_HEADERS = \ TransactionP.h \ gnc-book-p.h \ gnc-event-p.h \ + gnc-lot-p.h \ gnc-pricedb-p.h \ gnc-session-p.h \ gncObjectP.h \ diff --git a/src/engine/Transaction.c b/src/engine/Transaction.c index 9f8572d039..3e61b6fab4 100644 --- a/src/engine/Transaction.c +++ b/src/engine/Transaction.c @@ -103,6 +103,7 @@ xaccInitSplit(Split * split, GNCBook *book) /* fill in some sane defaults */ xaccSplitSetAccount(split, NULL); split->parent = NULL; + split->lot = NULL; split->action = g_cache_insert(gnc_engine_get_string_cache(), ""); split->memo = g_cache_insert(gnc_engine_get_string_cache(), ""); diff --git a/src/engine/TransactionP.h b/src/engine/TransactionP.h index 9563eff565..0e8e73692c 100644 --- a/src/engine/TransactionP.h +++ b/src/engine/TransactionP.h @@ -82,6 +82,8 @@ struct split_s Account *acc; /* back-pointer to debited/credited account */ + GNCLot *lot; /* back-pointer to debited/credited lot */ + Transaction *parent; /* parent of split */ /* The memo field is an arbitrary user-assiged value. diff --git a/src/engine/gnc-engine.h b/src/engine/gnc-engine.h index 9ccd412187..054a573d33 100644 --- a/src/engine/gnc-engine.h +++ b/src/engine/gnc-engine.h @@ -34,9 +34,10 @@ typedef struct account_group_s AccountGroup; typedef struct split_s Split; typedef struct transaction_s Transaction; typedef struct gnc_book_struct GNCBook; -typedef struct gnc_session_struct GNCSession; typedef struct gnc_commodity_s gnc_commodity; typedef struct gnc_commodity_table_s gnc_commodity_table; +typedef struct gnc_lot_struct GNCLot; +typedef struct gnc_session_struct GNCSession; typedef GList AccountList; typedef GList BookList;