rename the free & alloc routine names

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@490 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Linas Vepstas 1998-02-02 05:27:21 +00:00
parent 1137fddc16
commit b18939af63
7 changed files with 40 additions and 40 deletions

View File

@ -118,7 +118,7 @@ accWindow( Widget parent )
accData = (AccWindow *)_malloc(sizeof(AccWindow));
accData->newacc = mallocAccount();
accData->newacc = xaccMallocAccount();
/* force the size of the dialog so it is not resizable */
dialog = XtVaCreatePopupShell( "dialog",
@ -372,7 +372,7 @@ closeAccWindow( Widget mw, XtPointer cd, XtPointer cb )
{
AccWindow *accData = (AccWindow *)cd;
if(accData->newacc) freeAccount (accData->newacc);
if(accData->newacc) xaccFreeAccount (accData->newacc);
xaccFreeAccountMenu (accData->accMenu);
_free(accData);

View File

@ -51,7 +51,7 @@ int next_free_unique_account_id = 0;
/********************************************************************\
\********************************************************************/
Account *
mallocAccount( void )
xaccMallocAccount( void )
{
Account *acc = (Account *)_malloc(sizeof(Account));
@ -83,7 +83,7 @@ mallocAccount( void )
/********************************************************************\
\********************************************************************/
void
freeAccount( Account *acc )
xaccFreeAccount( Account *acc )
{
int i=0, j=0;
Split *s, *debit_s;
@ -93,7 +93,7 @@ freeAccount( Account *acc )
if (NULL == acc) return;
/* recursively free children */
freeAccountGroup (acc->children);
xaccFreeAccountGroup (acc->children);
free(acc->accountName);
free(acc->description);

View File

@ -64,7 +64,7 @@ xaccInitializeAccountGroup (AccountGroup *grp)
/********************************************************************\
\********************************************************************/
AccountGroup *
mallocAccountGroup( void )
xaccMallocAccountGroup( void )
{
AccountGroup *grp = (AccountGroup *)_malloc(sizeof(AccountGroup));
@ -76,7 +76,7 @@ mallocAccountGroup( void )
/********************************************************************\
\********************************************************************/
void
freeAccountGroup( AccountGroup *grp )
xaccFreeAccountGroup( AccountGroup *grp )
{
int i;
if (NULL == grp) return;
@ -84,7 +84,7 @@ freeAccountGroup( AccountGroup *grp )
if (grp == topgroup) topgroup = NULL; /* safety device */
for( i=0; i<grp->numAcc; i++ ) {
freeAccount( grp->account[i] );
xaccFreeAccount( grp->account[i] );
}
_free( grp->account );
@ -394,7 +394,7 @@ xaccRemoveAccount (Account *acc)
* the group as well (unless its a root group) */
if (grp->parent) {
xaccRemoveGroup (grp);
freeAccountGroup (grp);
xaccFreeAccountGroup (grp);
}
}
@ -413,7 +413,7 @@ xaccInsertSubAccount( Account *adult, Account *child )
/* if a container for the children doesn't yet exist, add it */
if (NULL == adult->children) {
adult->children = mallocAccountGroup();
adult->children = xaccMallocAccountGroup();
}
/* set back-pointer to parent */
@ -537,7 +537,7 @@ xaccMergeAccounts (AccountGroup *grp)
acc_b->children = NULL;
} else {
xaccConcatGroups (ga, gb);
freeAccountGroup (gb);
xaccFreeAccountGroup (gb);
acc_b->children = NULL;
}
}
@ -557,7 +557,7 @@ xaccMergeAccounts (AccountGroup *grp)
/* free the account structure itself */
acc_b->numSplits = 0;
freeAccount (acc_b);
xaccFreeAccount (acc_b);
grp->account[j] = grp->account[grp->numAcc -1];
grp->account[grp->numAcc -1] = NULL;
grp->numAcc --;

View File

@ -235,7 +235,7 @@ xaccReadData( char *datafile )
return NULL;
}
holder = mallocAccountGroup();
holder = xaccMallocAccountGroup();
grp = readGroup (fd, NULL, token);
/* the number of unclaimed accounts should be zero if the
@ -247,12 +247,12 @@ xaccReadData( char *datafile )
error_code = ERR_FILEIO_FILE_BAD_READ;
/* create a lost account, put the missing accounts there */
acc = mallocAccount();
acc = xaccMallocAccount();
acc -> accountName = strdup (LOST_ACC_STR);
acc -> children = (struct _account_group *) holder;
insertAccount (grp, acc);
} else {
freeAccountGroup (holder);
xaccFreeAccountGroup (holder);
holder = NULL;
}
@ -275,7 +275,7 @@ readGroup (int fd, Account *aparent, int token)
int numAcc;
int err=0;
int i;
AccountGroup *grp = mallocAccountGroup();
AccountGroup *grp = xaccMallocAccountGroup();
ENTER ("readGroup");
@ -287,7 +287,7 @@ readGroup (int fd, Account *aparent, int token)
err = read( fd, &numAcc, sizeof(int) );
if( sizeof(int) != err )
{
freeAccountGroup (grp);
xaccFreeAccountGroup (grp);
return NULL;
}
XACC_FLIP_INT (numAcc);
@ -341,7 +341,7 @@ readAccount( int fd, AccountGroup *grp, int token )
XACC_FLIP_INT (accID);
acc = locateAccount (accID);
} else {
acc = mallocAccount();
acc = xaccMallocAccount();
insertAccount (holder, acc);
}
@ -431,7 +431,7 @@ locateAccount (int acc_id)
/* if neither, then it does not yet exist. Create it.
* Put it in the drunk tank. */
acc = mallocAccount ();
acc = xaccMallocAccount ();
acc->id = acc_id;
insertAccount (holder, acc);

View File

@ -937,8 +937,8 @@ fileMenubarCB( Widget mw, XtPointer cd, XtPointer cb )
datafile = NULL;
/* destroy open windows first, before destroying the group itself */
xaccGroupWindowDestroy (grp);
freeAccountGroup (grp);
grp = mallocAccountGroup();
xaccFreeAccountGroup (grp);
grp = xaccMallocAccountGroup();
grp->new = True; /* so we have to do a "SaveAs" when
* the file is first saved */
topgroup = grp;
@ -981,13 +981,13 @@ fileMenubarCB( Widget mw, XtPointer cd, XtPointer cb )
break;
case ERR_FILEIO_FILE_TOO_OLD:
if (!verifyBox( toplevel, FILE_TOO_OLD_MSG )) {
freeAccountGroup (newgrp);
xaccFreeAccountGroup (newgrp);
newgrp = NULL;
}
break;
case ERR_FILEIO_FILE_BAD_READ:
if (!verifyBox( toplevel, FILE_BAD_READ_MSG )) {
freeAccountGroup (newgrp);
xaccFreeAccountGroup (newgrp);
newgrp = NULL;
}
break;
@ -999,7 +999,7 @@ fileMenubarCB( Widget mw, XtPointer cd, XtPointer cb )
if (newgrp) {
/* destroy open windows first, before destroying the group itself */
xaccGroupWindowDestroy (grp);
freeAccountGroup (grp);
xaccFreeAccountGroup (grp);
topgroup = newgrp;
}
}
@ -1023,7 +1023,7 @@ fileMenubarCB( Widget mw, XtPointer cd, XtPointer cb )
if( NULL == topgroup ) {
/* no topgroup exists */
topgroup = mallocAccountGroup();
topgroup = xaccMallocAccountGroup();
}
/* since quicken will not export all accounts
@ -1070,7 +1070,7 @@ fileMenubarCB( Widget mw, XtPointer cd, XtPointer cb )
/* destroy open windows first, before destroying the group itself */
xaccGroupWindowDestroy (grp);
freeAccountGroup (grp);
xaccFreeAccountGroup (grp);
topgroup = NULL;
XtUnmapWidget(toplevel); /* make it disappear quickly */
XtDestroyWidget(toplevel);
@ -1176,7 +1176,7 @@ accountMenubarCB( Widget mw, XtPointer cd, XtPointer cb )
* windows, if they are open */
xaccAccountWindowDestroy (selected_acc);
xaccRemoveAccount (selected_acc);
freeAccount (selected_acc);
xaccFreeAccount (selected_acc);
selected_acc = NULL;
refreshMainWindow();
}

View File

@ -306,7 +306,7 @@ char * xaccReadQIFAccList (int fd, AccountGroup *grp, int cat)
if (!grp) return 0x0;
do {
acc = mallocAccount();
acc = xaccMallocAccount();
if (cat) {
qifline = xaccReadQIFCategory (fd, acc);
} else {
@ -315,11 +315,11 @@ char * xaccReadQIFAccList (int fd, AccountGroup *grp, int cat)
if ('!' == qifline [0]) break;
if (-1 == acc->type) { /* free up malloced data if unknown account type */
freeAccount(acc);
xaccFreeAccount(acc);
continue;
}
if (!qifline) { /* free up malloced data if the read bombed. */
freeAccount(acc);
xaccFreeAccount(acc);
continue;
}
@ -516,7 +516,7 @@ xaccGetXferQIFAccount (Account *acc, char *qifline)
/* if not, create it */
if (!xfer_acc) {
xfer_acc = mallocAccount ();
xfer_acc = xaccMallocAccount ();
xfer_acc->accountName = XtNewString (qifline);
xfer_acc->description = XtNewString ("");
xfer_acc->notes = XtNewString ("");
@ -557,7 +557,7 @@ xaccGetSecurityQIFAccount (Account *acc, char *qifline)
/* if not, create it */
if (!xfer_acc) {
xfer_acc = mallocAccount ();
xfer_acc = xaccMallocAccount ();
xfer_acc->accountName = XtNewString (qifline);
xfer_acc->description = XtNewString ("");
xfer_acc->notes = XtNewString ("");
@ -905,11 +905,11 @@ xaccReadQIFData( char *datafile )
return NULL;
}
grp = mallocAccountGroup();
grp = xaccMallocAccountGroup();
while (qifline) {
if (STRSTR (qifline, "Type:Bank")) {
Account *acc = mallocAccount();
Account *acc = xaccMallocAccount();
DEBUG ("got bank\n");
acc->type = BANK;
@ -935,7 +935,7 @@ xaccReadQIFData( char *datafile )
} else
if (STRSTR (qifline, "Type:Invst")) {
Account *acc = mallocAccount();
Account *acc = xaccMallocAccount();
DEBUG ("got Invst\n");
acc->type = BANK;
@ -980,15 +980,15 @@ xaccReadQIFData( char *datafile )
} else {
/* read account name, followed by dollar data ... */
Account *preexisting;
Account *acc = mallocAccount();
Account *acc = xaccMallocAccount();
DEBUG ("got account\n");
qifline = xaccReadQIFAccount (fd, acc);
if (!qifline) { /* free up malloced data if the read bombed. */
freeAccount(acc);
xaccFreeAccount(acc);
continue;
}
if (-1 == acc->type) { /* free up malloced data if unknown account type */
freeAccount(acc);
xaccFreeAccount(acc);
continue;
}
@ -996,7 +996,7 @@ xaccReadQIFData( char *datafile )
* if we do, use it, otherwise create it */
preexisting = xaccGetAccountFromName (grp, acc->accountName);
if (preexisting) {
freeAccount (acc);
xaccFreeAccount (acc);
acc = preexisting;
} else {
insertAccount( grp, acc );

View File

@ -159,7 +159,7 @@ main( int argc, char *argv[] )
if( NULL == topgroup )
{
topgroup = mallocAccountGroup(); /* the file could not be found */
topgroup = xaccMallocAccountGroup(); /* the file could not be found */
topgroup->new = True;
}