split name change

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@373 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Linas Vepstas 1998-01-06 02:14:52 +00:00
parent cb21407d6e
commit 3b6c2588a3
4 changed files with 24 additions and 22 deletions

View File

@ -118,7 +118,7 @@ freeAccount( Account *acc )
s = acc->splits[0];
while (s) {
struct _account * _acc = (struct _account *) acc;
if (_acc == s->debit) s->debit = NULL;
if (_acc == s->acc) s->acc = NULL;
i++;
s = acc->splits[i];
}
@ -395,7 +395,7 @@ xaccInsertSplit ( Account *acc, Split *split )
/* mark the data file as needing to be saved: */
if( acc->parent != NULL ) acc->parent->saved = False;
split->debit = (struct _account *) acc;
split->acc = (struct _account *) acc;
oldsplits = acc->splits;
acc->numSplits ++;

View File

@ -488,7 +488,7 @@ readTransaction( int fd, Account *acc, int token )
/* create a transaction structure with at least one split */
trans = mallocTransaction();
split = mallocSplit();
split = xaccMallocSplit();
xaccAppendSplit (trans, split);
ENTER ("readTransaction");
@ -650,7 +650,7 @@ readTransaction( int fd, Account *acc, int token )
XACC_FLIP_INT (acc_id);
INFO_2 ("readTransaction(): debit %d\n", acc_id);
peer_acc = locateAccount (acc_id);
split -> debit = (struct _account *) peer_acc;
split -> acc = (struct _account *) peer_acc;
/* insert the transaction into both the debit and
* the credit accounts; next, the debit ... */

View File

@ -715,9 +715,9 @@ char * xaccReadQIFTransaction (int fd, Account *acc)
split -> damount = 0.0; /* amount is double */
split -> share_price= 1.0; /* share_price is double */
split -> reconciled = NREC; /* reconciled is byte */
split -> debit = (struct _account *) xaccGetXferQIFAccount (acc, qifline);
split -> acc = (struct _account *) xaccGetXferQIFAccount (acc, qifline);
xaccInsertSplit (trans, split);
xaccAppendSplit (trans, split);
/* hack alert -- we should insert this split into
* the split account, and remove the L field */

View File

@ -46,7 +46,7 @@ xaccInitSplit( Split * split )
{
/* fill in some sane defaults */
split->debit = NULL;
split->acc = NULL;
split->parent = NULL;
split->memo = XtNewString("");
@ -77,7 +77,7 @@ xaccFreeSplit( Split *split )
/* free a split only if it is not claimed
* by any accounts. */
if (split->debit) return;
if (split->acc) return;
xaccRemoveSplit (split);
@ -131,8 +131,10 @@ initTransaction( Transaction * trans )
trans->memo = XtNewString("");
trans->action = XtNewString("");
trans->splits = (Split **) _malloc (sizeof (Split *));
trans->splits[0] = NULL;
trans->debit_splits = (Split **) _malloc (sizeof (Split *));
trans->debit_splits[0] = NULL;
xaccInitSplit ( &(trans->credit_split));
trans->reconciled = NREC;
trans->damount = 0.0;
@ -175,10 +177,10 @@ freeTransaction( Transaction *trans )
/*
hack alert -- don't do this until splits are fully
implemented and tested.
if (NULL != trans->splits[0]) return;
if (NULL != trans->debit_splits[0]) return;
*/
_free (trans->splits);
_free (trans->debit_splits);
XtFree(trans->num);
XtFree(trans->description);
XtFree(trans->memo);
@ -218,15 +220,15 @@ xaccAppendSplit (Transaction *trans, Split *split)
if (!split) return;
split->parent = (struct _transaction *) trans;
num = xaccCountSplits (trans->splits);
num = xaccCountSplits (trans->debit_splits);
oldarray = trans->splits;
trans->splits = (Split **) _malloc ((num+2)*sizeof(Split *));
oldarray = trans->debit_splits;
trans->debit_splits = (Split **) _malloc ((num+2)*sizeof(Split *));
for (i=0; i<num; i++) {
(trans->splits)[i] = oldarray[i];
(trans->debit_splits)[i] = oldarray[i];
}
trans->splits[num] = split;
trans->splits[num+1] = NULL;
trans->debit_splits[num] = split;
trans->debit_splits[num+1] = NULL;
if (oldarray) _free (oldarray);
}
@ -247,15 +249,15 @@ xaccRemoveSplit (Split *split)
if (!trans) return;
s = trans->splits[0];
s = trans->debit_splits[0];
while (s) {
trans->splits[i] = trans->splits[n];
trans->debit_splits[i] = trans->debit_splits[n];
if (split == s) { i--; }
i++;
n++;
s = trans->splits[n];
s = trans->debit_splits[n];
}
trans->splits[i] = NULL;
trans->debit_splits[i] = NULL;
/* hack alert -- we should also remove it from the account */
}