rename transaction method names

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@487 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Linas Vepstas 1998-02-02 02:13:58 +00:00
parent 87e4ad928f
commit c9e8127c2b
7 changed files with 32 additions and 29 deletions

View File

@ -671,8 +671,7 @@ createCB( Widget mw, XtPointer cd, XtPointer cb )
} }
/* Add an opening balance transaction (as the first transaction) */ /* Add an opening balance transaction (as the first transaction) */
trans = mallocTransaction(); trans = xaccMallocTransaction();
initTransaction(trans);
todaysDate( &(trans->date) ); todaysDate( &(trans->date) );
xaccTransSetDescription (trans, OPEN_BALN_STR); xaccTransSetDescription (trans, OPEN_BALN_STR);

View File

@ -123,7 +123,7 @@ freeAccount( Account *acc )
} }
if ( (!dont_free_transaction) && (NULL == trans->credit_split.acc) ) { if ( (!dont_free_transaction) && (NULL == trans->credit_split.acc) ) {
freeTransaction( trans ); xaccFreeTransaction( trans );
} }
i++; i++;
@ -531,11 +531,11 @@ xaccConsolidateTransactions (Account * acc)
if (0 == DEQ(sa->share_price, sb->share_price)) continue; if (0 == DEQ(sa->share_price, sb->share_price)) continue;
if (strcmp (sa->memo, sb->memo)) continue; if (strcmp (sa->memo, sb->memo)) continue;
#ifdef STIL_BROKEN #ifdef STILL_BROKEN
/* hack alert -- still broken from splits */ /* hack alert -- still broken from splits */
/* Free the transaction, and shuffle down by one. /* Free the transaction, and shuffle down by one.
* Need to shuffle in order to preserve date ordering. */ * Need to shuffle in order to preserve date ordering. */
freeTransaction (tb); xaccFreeTransaction (tb);
for (k=j+1; k<acc->numTrans; k++) { for (k=j+1; k<acc->numTrans; k++) {
acc->transaction[k-1] = acc->transaction[k]; acc->transaction[k-1] = acc->transaction[k];

View File

@ -297,7 +297,7 @@ adjBOkCB( Widget mw, XtPointer cd, XtPointer cb )
acc->parent->saved = False; acc->parent->saved = False;
/* allocate mem for the new transaction */ /* allocate mem for the new transaction */
trans = mallocTransaction(); trans = xaccMallocTransaction();
/* Create the "trans" transaction */ /* Create the "trans" transaction */
str = XmTextGetString(adjBData->date); str = XmTextGetString(adjBData->date);

View File

@ -496,7 +496,7 @@ readTransaction( int fd, Account *acc, int token )
double share_price = 0.0; double share_price = 0.0;
/* create a transaction structure */ /* create a transaction structure */
trans = mallocTransaction(); trans = xaccMallocTransaction();
ENTER ("readTransaction"); ENTER ("readTransaction");
@ -504,7 +504,7 @@ readTransaction( int fd, Account *acc, int token )
if( trans->num == NULL ) if( trans->num == NULL )
{ {
PERR ("Premature end of Transaction at num"); PERR ("Premature end of Transaction at num");
freeTransaction(trans); xaccFreeTransaction(trans);
return NULL; return NULL;
} }
@ -512,7 +512,7 @@ readTransaction( int fd, Account *acc, int token )
if( date == NULL ) if( date == NULL )
{ {
PERR ("Premature end of Transaction at date"); PERR ("Premature end of Transaction at date");
freeTransaction(trans); xaccFreeTransaction(trans);
return NULL; return NULL;
} }
trans->date = *date; trans->date = *date;
@ -522,7 +522,7 @@ readTransaction( int fd, Account *acc, int token )
if( trans->description == NULL ) if( trans->description == NULL )
{ {
PERR ("Premature end of Transaction at description"); PERR ("Premature end of Transaction at description");
freeTransaction(trans); xaccFreeTransaction(trans);
return NULL; return NULL;
} }
@ -535,7 +535,7 @@ readTransaction( int fd, Account *acc, int token )
if( NULL == tmp ) if( NULL == tmp )
{ {
PERR ("Premature end of Transaction at memo"); PERR ("Premature end of Transaction at memo");
freeTransaction(trans); xaccFreeTransaction(trans);
return NULL; return NULL;
} }
xaccTransSetMemo (trans, tmp); xaccTransSetMemo (trans, tmp);
@ -547,7 +547,7 @@ readTransaction( int fd, Account *acc, int token )
if( tmp == NULL ) if( tmp == NULL )
{ {
PERR ("Premature end of Transaction at action"); PERR ("Premature end of Transaction at action");
freeTransaction(trans); xaccFreeTransaction(trans);
return NULL; return NULL;
} }
xaccTransSetAction (trans, tmp); xaccTransSetAction (trans, tmp);
@ -558,7 +558,7 @@ readTransaction( int fd, Account *acc, int token )
if( err != sizeof(int) ) if( err != sizeof(int) )
{ {
PERR ("Premature end of Transaction at catagory"); PERR ("Premature end of Transaction at catagory");
freeTransaction(trans); xaccFreeTransaction(trans);
return NULL; return NULL;
} }
@ -566,7 +566,7 @@ readTransaction( int fd, Account *acc, int token )
if( err != sizeof(char) ) if( err != sizeof(char) )
{ {
PERR ("Premature end of Transaction at reconciled"); PERR ("Premature end of Transaction at reconciled");
freeTransaction(trans); xaccFreeTransaction(trans);
return NULL; return NULL;
} }
xaccTransSetReconcile (trans, recn); xaccTransSetReconcile (trans, recn);
@ -602,7 +602,7 @@ readTransaction( int fd, Account *acc, int token )
if( err != sizeof(int) ) if( err != sizeof(int) )
{ {
PERR ("Premature end of Transaction at V1 amount"); PERR ("Premature end of Transaction at V1 amount");
freeTransaction(trans); xaccFreeTransaction(trans);
return NULL; return NULL;
} }
XACC_FLIP_INT (amount); XACC_FLIP_INT (amount);
@ -616,7 +616,7 @@ readTransaction( int fd, Account *acc, int token )
if( err != sizeof(double) ) if( err != sizeof(double) )
{ {
PERR ("Premature end of Transaction at amount"); PERR ("Premature end of Transaction at amount");
freeTransaction(trans); xaccFreeTransaction(trans);
return NULL; return NULL;
} }
XACC_FLIP_DOUBLE (damount); XACC_FLIP_DOUBLE (damount);
@ -628,7 +628,7 @@ readTransaction( int fd, Account *acc, int token )
if( err != sizeof(double) ) if( err != sizeof(double) )
{ {
PERR ("Premature end of Transaction at share_price"); PERR ("Premature end of Transaction at share_price");
freeTransaction(trans); xaccFreeTransaction(trans);
return NULL; return NULL;
} }
XACC_FLIP_DOUBLE (damount); XACC_FLIP_DOUBLE (damount);
@ -647,7 +647,7 @@ readTransaction( int fd, Account *acc, int token )
if( err != sizeof(int) ) if( err != sizeof(int) )
{ {
PERR ("Premature end of Transaction at credit"); PERR ("Premature end of Transaction at credit");
freeTransaction(trans); xaccFreeTransaction(trans);
return NULL; return NULL;
} }
XACC_FLIP_INT (acc_id); XACC_FLIP_INT (acc_id);
@ -664,7 +664,7 @@ readTransaction( int fd, Account *acc, int token )
if( err != sizeof(int) ) if( err != sizeof(int) )
{ {
PERR ("Premature end of Transaction at debit"); PERR ("Premature end of Transaction at debit");
freeTransaction(trans); xaccFreeTransaction(trans);
return NULL; return NULL;
} }
XACC_FLIP_INT (acc_id); XACC_FLIP_INT (acc_id);
@ -711,7 +711,7 @@ readTransaction( int fd, Account *acc, int token )
if( err != sizeof(int) ) if( err != sizeof(int) )
{ {
PERR ("Premature end of Transaction at num-splits"); PERR ("Premature end of Transaction at num-splits");
freeTransaction(trans); xaccFreeTransaction(trans);
return NULL; return NULL;
} }
XACC_FLIP_INT (numSplits); XACC_FLIP_INT (numSplits);

View File

@ -605,7 +605,7 @@ char * xaccReadQIFTransaction (int fd, Account *acc)
if (!qifline) return NULL; if (!qifline) return NULL;
if ('!' == qifline [0]) return qifline; if ('!' == qifline [0]) return qifline;
trans = mallocTransaction (); trans = xaccMallocTransaction ();
/* scan for transaction date, description, type */ /* scan for transaction date, description, type */
while (qifline) { while (qifline) {
@ -769,7 +769,7 @@ char * xaccReadQIFTransaction (int fd, Account *acc)
* if we see something else, assume the worst, free the last * if we see something else, assume the worst, free the last
* transaction, and return */ * transaction, and return */
if ('!' == qifline[0]) { if ('!' == qifline[0]) {
freeTransaction (trans); xaccFreeTransaction (trans);
return qifline; return qifline;
} }

View File

@ -163,12 +163,12 @@ double xaccGetShareBalance (Split *s)
} }
/********************************************************************\ /********************************************************************\
* initTransaction * xaccInitTransaction
* Initialize a transaction structure * Initialize a transaction structure
\********************************************************************/ \********************************************************************/
void void
initTransaction( Transaction * trans ) xaccInitTransaction( Transaction * trans )
{ {
/* fill in some sane defaults */ /* fill in some sane defaults */
@ -188,11 +188,12 @@ initTransaction( Transaction * trans )
/********************************************************************\ /********************************************************************\
\********************************************************************/ \********************************************************************/
Transaction * Transaction *
mallocTransaction( void ) xaccMallocTransaction( void )
{ {
Transaction *trans = (Transaction *)_malloc(sizeof(Transaction)); Transaction *trans = (Transaction *)_malloc(sizeof(Transaction));
initTransaction (trans); xaccInitTransaction (trans);
return trans; return trans;
} }
@ -200,7 +201,7 @@ mallocTransaction( void )
\********************************************************************/ \********************************************************************/
void void
freeTransaction( Transaction *trans ) xaccFreeTransaction( Transaction *trans )
{ {
int i; int i;
Split *s; Split *s;

View File

@ -458,7 +458,7 @@ xferCB( Widget mw, XtPointer cd, XtPointer cb )
grp->saved = False; grp->saved = False;
/* a double-entry transfer -- just one record, two accounts */ /* a double-entry transfer -- just one record, two accounts */
trans = mallocTransaction(); trans = xaccMallocTransaction();
split = xaccMallocSplit(); split = xaccMallocSplit();
xaccTransAppendSplit (trans, split); xaccTransAppendSplit (trans, split);
@ -475,6 +475,9 @@ xferCB( Widget mw, XtPointer cd, XtPointer cb )
xaccTransSetDescription (trans, XmTextGetString(xferData->desc)); xaccTransSetDescription (trans, XmTextGetString(xferData->desc));
xaccTransSetReconcile (trans, NREC); xaccTransSetReconcile (trans, NREC);
/* make sure that all monetary sums are up-to-date */
xaccTransRecomputeAmount (trans);
/* make note of which accounts this was transfered from & to */ /* make note of which accounts this was transfered from & to */
acc = getAccount(grp,xferData->from); acc = getAccount(grp,xferData->from);
split->acc = (struct _account *) acc; split->acc = (struct _account *) acc;