add some config routines

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@1507 57a11ea4-9604-0410-9ed3-97b8803252fd
zzzoldfeatures/xacc-12-patch
Linas Vepstas 28 years ago
parent 699bf111c5
commit b19bf7028d

@ -42,7 +42,7 @@
/*
* If the "force_double_entry" flag determines how
* The "force_double_entry" flag determines how
* the splits in a transaction will be balanced.
*
* The following values have significance:
@ -185,6 +185,21 @@ xaccFreeSplit( Split *split )
/********************************************************************\
\********************************************************************/
void
xaccConfigSetForceDoubleEntry (int force)
{
force_double_entry = force;
}
int
xaccConfigGetForceDoubleEntry (void)
{
return (force_double_entry);
}
/********************************************************************\
\********************************************************************/
#define MARK_SPLIT(split) { \
Account *acc = (Account *) ((split)->acc); \
if (acc) acc->changed = 1; \

@ -72,6 +72,27 @@ struct timespec64 {
typedef struct timespec64 Timespec;
/** PROTOTYPES ******************************************************/
/*
* The xaccConfigSetForceDoubleEntry() and xaccConfigGetForceDoubleEntry()
* set and get the "force_double_entry" flag. This flag determines how
* the splits in a transaction will be balanced.
*
* The following values have significance:
* 0 -- anything goes
* 1 -- The sum of all splits in a transaction will be
* forced to be zero, even if this requires the
* creation of additional splits. Note that a split
* whose value is zero (e.g. a stock price) can exist
* by itself. Otherwise, all splits must come in at
* least pairs.
* 2 -- splits without parents will be forced into a
* lost & found account. (Not implemented)
*/
void xaccConfigSetForceDoubleEntry (int force);
int xaccConfigGetForceDoubleEntry (void);
/*
* The xaccMallocTransaction() will malloc memory and initilize it.
* Once created, it is usually unsafe to merely "free" this memory;

Loading…
Cancel
Save