finalize hiding of transaction structures, start work on hiding account

structures


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@676 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Linas Vepstas 1998-03-20 05:55:00 +00:00
parent f4f5fa937e
commit 2afb8e10cf
6 changed files with 60 additions and 8 deletions

View File

@ -620,4 +620,26 @@ xaccConsolidateTransactions (Account * acc)
}
}
/********************************************************************\
\********************************************************************/
AccountGroup *
xaccAccountGetChildren (Account *acc)
{
return (acc->children);
}
AccountGroup *
xaccAccountGetParent (Account *acc)
{
return (acc->parent);
}
char *
xaccAccountGetName (Account *acc)
{
return (acc->accountName);
}
/*************************** END OF FILE **************************** */

View File

@ -107,6 +107,10 @@ void xaccConsolidateTransactions (Account *);
void xaccMoveFarEnd (Split *, Account *);
void xaccMoveFarEndByName (Split *, const char *);
char * xaccAccountGetName (Account *);
AccountGroup *xaccAccountGetChildren (Account *);
AccountGroup *xaccAccountGetParent (Account *);
/** GLOBALS *********************************************************/
extern int next_free_unique_account_id;

View File

@ -43,8 +43,8 @@
struct _account {
/* public data, describes account */
struct _account_group *parent; /* back-pointer to parent */
struct _account_group *children; /* pointer to sub-accounts */
AccountGroup *parent; /* back-pointer to parent */
AccountGroup *children; /* pointer to sub-accounts */
int id; /* unique account id, internally assigned */
char flags;
short type;

View File

@ -31,7 +31,7 @@
#include "Account.h"
/** STRUCTS *********************************************************/
typedef struct _account_group {
struct _account_group {
/* The flags: */
unsigned int saved : 1;
unsigned int new : 1;
@ -44,7 +44,7 @@ typedef struct _account_group {
/* cached parameters */
double balance;
} AccountGroup;
};
/** PROTOTYPES ******************************************************/
AccountGroup *xaccMallocAccountGroup( void );

View File

@ -616,7 +616,10 @@ xaccTransGetSourceSplit (Transaction *trans)
Split *
xaccTransGetDestSplit (Transaction *trans, int i)
{
return (trans->dest_splits[i]);
if (trans->dest_splits) {
return (trans->dest_splits[i]);
}
return NULL;
}
char *
@ -631,6 +634,12 @@ xaccTransGetDescription (Transaction *trans)
return (trans->description);
}
Date *
xaccTransGetDate (Transaction *trans)
{
return (&(trans->date));
}
char *
xaccTransGetDateStr (Transaction *trans)
{
@ -697,6 +706,18 @@ xaccSplitGetAccount (Split *split)
return (split->acc);
}
char *
xaccSplitGetMemo (Split *split)
{
return (split->memo);
}
char *
xaccSplitGetAction (Split *split)
{
return (split->action);
}
char
xaccSplitGetReconcile (Split *split)
{

View File

@ -48,9 +48,10 @@
* between "dining", "tips" and "taxes" categories.
*/
typedef struct _account Account;
typedef struct _split Split;
typedef struct _transaction Transaction;
typedef struct _account Account;
typedef struct _account_group AccountGroup;
typedef struct _split Split;
typedef struct _transaction Transaction;
/** PROTOTYPES ******************************************************/
@ -94,6 +95,7 @@ Split * xaccTransGetDestSplit (Transaction *trans, int i);
char * xaccTransGetNum (Transaction *);
char * xaccTransGetDescription (Transaction *trans);
Date * xaccTransGetDate (Transaction *);
char * xaccTransGetDateStr (Transaction *);
/* return the number of destination splits */
@ -144,6 +146,9 @@ double xaccGetShareBalance (Split *);
Transaction * xaccSplitGetParent (Split *);
/* return the value of the reconcile flag */
char * xaccSplitGetMemo (Split *split);
char * xaccSplitGetAction (Split *split);
char xaccSplitGetReconcile (Split *split);
double xaccSplitGetAmount (Split * split);
double xaccSplitGetValue (Split * split);