diff --git a/src/engine/Account.c b/src/engine/Account.c index e3cf9374fe..c2ba3135b5 100644 --- a/src/engine/Account.c +++ b/src/engine/Account.c @@ -23,6 +23,8 @@ * Huntington Beach, CA 92648-4632 * \********************************************************************/ +#include + #include "config.h" #include "Account.h" @@ -623,6 +625,40 @@ xaccConsolidateTransactions (Account * acc) /********************************************************************\ \********************************************************************/ +void +xaccAccountSetType (Account *acc, int tip) +{ + if (!acc) return; + acc->type = tip; +} + +void +xaccAccountSetName (Account *acc, char *str) +{ + if (!acc) return; + if (acc->accountName) free (acc->accountName); + acc->accountName = strdup (str); +} + +void +xaccAccountSetDescription (Account *acc, char *str) +{ + if (!acc) return; + if (acc->description) free (acc->description); + acc->description = strdup (str); +} + +void +xaccAccountSetNotes (Account *acc, char *str) +{ + if (!acc) return; + if (acc->notes) free (acc->notes); + acc->notes = strdup (str); +} + +/********************************************************************\ +\********************************************************************/ + AccountGroup * xaccAccountGetChildren (Account *acc) { @@ -635,6 +671,11 @@ xaccAccountGetParent (Account *acc) return (acc->parent); } +int +xaccAccountGetType (Account *acc) +{ + return (acc->type); +} char * xaccAccountGetName (Account *acc) @@ -642,4 +683,16 @@ xaccAccountGetName (Account *acc) return (acc->accountName); } +char * +xaccAccountGetDescription (Account *acc) +{ + return (acc->description); +} + +char * +xaccAccountGetNotes (Account *acc) +{ + return (acc->notes); +} + /*************************** END OF FILE **************************** */ diff --git a/src/engine/Account.h b/src/engine/Account.h index 47805d6dea..ab7525d12b 100644 --- a/src/engine/Account.h +++ b/src/engine/Account.h @@ -107,9 +107,17 @@ void xaccConsolidateTransactions (Account *); void xaccMoveFarEnd (Split *, Account *); void xaccMoveFarEndByName (Split *, const char *); -char * xaccAccountGetName (Account *); -AccountGroup *xaccAccountGetChildren (Account *); -AccountGroup *xaccAccountGetParent (Account *); +void xaccAccountSetType (Account *, int); +void xaccAccountSetName (Account *, char *); +void xaccAccountSetDescription (Account *, char *); +void xaccAccountSetNotes (Account *, char *); + +int xaccAccountGetType (Account *); +char * xaccAccountGetName (Account *); +char * xaccAccountGetDescription (Account *); +char * xaccAccountGetNotes (Account *); +AccountGroup * xaccAccountGetChildren (Account *); +AccountGroup * xaccAccountGetParent (Account *); /** GLOBALS *********************************************************/