add strict types in order to enable the perl/Java wrappers to function

properly.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@5751 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Linas Vepstas
2001-10-31 15:25:46 +00:00
parent b9f6eb414d
commit 63ec87aa7b
10 changed files with 43 additions and 15 deletions

View File

@@ -244,7 +244,7 @@ gboolean xaccAccountGetReconcileChildrenStatus(Account *account);
gnc_numeric xaccAccountGetBalanceAsOfDate (Account *account, time_t date);
GList* xaccAccountGetSplitList (Account *account);
SplitList* xaccAccountGetSplitList (Account *account);
gboolean xaccAccountGetTaxRelated (Account *account);
void xaccAccountSetTaxRelated (Account *account,

View File

@@ -132,7 +132,7 @@ struct account_s
gint32 version;
guint32 version_check; /* data aging timestamp */
GList *splits; /* list of split pointers */
SplitList *splits; /* list of split pointers */
/* keep track of nesting level of begin/end edit calls */
gint32 editlevel;

View File

@@ -120,8 +120,8 @@ Account * xaccGroupGetAccount (AccountGroup *group, int index);
* be freed by the caller.
*/
GList * xaccGroupGetSubAccounts (AccountGroup *grp);
GList * xaccGroupGetAccountList (AccountGroup *grp);
AccountList * xaccGroupGetSubAccounts (AccountGroup *grp);
AccountList * xaccGroupGetAccountList (AccountGroup *grp);
/*
* The xaccGetAccountFromName() subroutine fetches the
@@ -237,7 +237,7 @@ gboolean xaccGroupEqual(AccountGroup *a, AccountGroup *b,
*/
void xaccGroupBeginStagedTransactionTraversals(AccountGroup *grp);
void xaccSplitsBeginStagedTransactionTraversals(GList *splits);
void xaccSplitsBeginStagedTransactionTraversals(SplitList *splits);
void xaccAccountBeginStagedTransactionTraversals(Account *account);
/* xaccTransactionTraverse() checks the stage of the given transaction.

View File

@@ -56,7 +56,7 @@ struct account_group_s
Account *parent; /* back-pointer to parent */
GList *accounts; /* list of account pointers */
AccountList *accounts; /* list of account pointers */
Backend *backend; /* persistant storage backend */

View File

@@ -2428,7 +2428,7 @@ xaccTransGetSplit (Transaction *trans, int i)
return g_list_nth_data (trans->splits, i);
}
GList *
SplitList *
xaccTransGetSplitList (Transaction *trans)
{
if (!trans) return NULL;

View File

@@ -47,6 +47,8 @@ typedef struct account_s Account;
typedef struct account_group_s AccountGroup;
typedef struct split_s Split;
typedef struct transaction_s Transaction;
typedef GList AccountList;
typedef GList SplitList;
/** PROTOTYPES ******************************************************/
@@ -202,7 +204,7 @@ Split * xaccTransGetSplit (Transaction *trans, int i);
/* The xaccTransGetSplitList() method returns a GList of the splits
* in a transaction. This list must not be modified. Do *NOT* free
* this list when you are done with it. */
GList * xaccTransGetSplitList (Transaction *trans);
SplitList * xaccTransGetSplitList (Transaction *trans);
/* These routines return the Num (or ID field), the description,
* the notes, and the date field.

View File

@@ -2,6 +2,25 @@ This document is becoming obsolete. Please refer to the design
documentation in src/doc/design for a complete description of the
Engine architecture.
Architecture Flaw
-----------------
A few areas in the engine are marked 'FIXME: architecture flaw'.
What does this really mean? There is a Soviet joke from the 1960's:
A westerner in Moscow stops a man to ask him the time. The man puts
down his breifcase, and flicks his wrist to look at his watch. "The
time is 7:03, the temperature is 12 degrees C, the air presssure is
950 mmHg and falling." The westerner remarks with considerable
interest, "Why, that's a mighty fine watch you have there! We don't
have anything like that in the America!" The Soviet responds, "Why
yes, this demonstrates the superiority of Soviet engineering over
decadent captalist design." Stooping to pick up his breifcase,
he mumbles half to himself, "If only these batteries weren't so heavy."
There are a few places where the engine requires the use of guile.
These should be eliminated.
Accounting Engine
-----------------
This document reviews the operation of, and various design points

View File

@@ -54,30 +54,30 @@ typedef enum {GNC_TR_EXP_MISC,
void gnc_tracking_associate_income_accounts(Account *stock_account,
GNCTrackingIncomeCategory category,
GList *account_list);
AccountList *account_list);
void gnc_tracking_asssociate_expense_account(Account *stock_account,
GNCTrackingExpenseCategory category,
GList *account_list);
AccountList *account_list);
/*
* returns a list of account *'s,
* returns null if no association specified
*/
GList *gnc_tracking_find_expense_accounts(Account *stock_account,
AccountList *gnc_tracking_find_expense_accounts(Account *stock_account,
GNCTrackingExpenseCategory category);
GList *gnc_tracking_find_income_accounts(Account *stock_account,
AccountList *gnc_tracking_find_income_accounts(Account *stock_account,
GNCTrackingIncomeCategory category);
/* for ROI purposes we don't care about categories, these are "grab
all" for that purpose */
GList *gnc_tracking_find_all_expense_accounts(Account *stock_account);
AccountList *gnc_tracking_find_all_expense_accounts(Account *stock_account);
GList *gnc_tracking_find_all_income_accounts(Account *stock_account);
AccountList *gnc_tracking_find_all_income_accounts(Account *stock_account);
/*

View File

@@ -76,6 +76,10 @@ gnc_book_init (GNCBook *book, GNCSession *session)
book->sx_notsaved = FALSE;
book->template_group = xaccMallocAccountGroup(session);
/* FIXME: the gnc_engine_commodity_table_new() routine invokes
* guile/scheme to load the default list of currencies. This
* forces the engine to link to guile, which is an obvious
* architecture flaw. */
book->commodity_table = gnc_engine_commodity_table_new ();
xaccGroupSetBook (book->topgroup, book);

View File

@@ -220,11 +220,14 @@ gnc_session_int_backend_load_error(GNCSession *session,
static void
gnc_session_load_backend(GNCSession * session, char * backend_name)
{
GNCModule mod;
GNCModule mod = 0;
Backend *(* be_new_func)(void);
char * mod_name = g_strdup_printf("gnucash/backend/%s", backend_name);
/* FIXME: this needs to be smarter with version numbers. */
/* FIXME: this should use dlopen(), instead of guile/scheme,
* to load the modules. Right now, this requires the engine to
* link to scheme, which is an obvious architecture flaw. */
mod = gnc_module_load(mod_name, 0);
if (mod)