remove obsolete code (replaced by code in Query.c

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@1158 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Linas Vepstas 1998-09-13 07:47:14 +00:00
parent a1dadd6c08
commit 497fa63f63
2 changed files with 0 additions and 60 deletions

View File

@ -62,65 +62,6 @@ Account ** accListCopy (Account **list)
newlist [nacc] = NULL;
return newlist;
}
/* ------------------------------------------------------ */
/* sort the transactions in date order */
Split ** accListGetSortedSplits (Account **list)
{
Account *acc;
Split **sarray;
int nacc = 0;
int nsplits = 0;
int i, j;
if (!list) return 0;
/* count the total number of transactions */
nacc = 0;
acc = list[0];
while (acc) {
nsplits += acc->numSplits;
nacc++;
acc = list[nacc];
}
nsplits ++;
/* malloc the array of transactions */
sarray = (Split **) _malloc (nsplits * sizeof (Split *));
/* put all of the transactions in the flat array */
nacc = 0;
nsplits = 0;
acc = list[0];
while (acc) {
for (i=0; i<acc->numSplits; i++) {
sarray[nsplits] = acc->splits[i];
nsplits ++;
}
nacc++;
acc = list[nacc];
}
sarray [nsplits] = NULL;
/* search and destroy duplicates. */
/* duplicates are possible due to double-entry */
/* one transaction can appear at most twice in the list */
for (i=0; i<nsplits; i++) {
for (j=i+1; j<nsplits; j++) {
if (sarray[i] == sarray[j]) {
sarray[j] = sarray [nsplits-1];
sarray[nsplits-1] = NULL;
nsplits --;
}
}
}
/* run the sort routine on the array */
qsort (sarray, nsplits, sizeof (Split *),
(int(*)(const void*, const void *)) xaccSplitOrder);
return sarray;
}
/* ------------------------------------------------------ */
Account **

View File

@ -29,7 +29,6 @@
int accListCount (Account **list);
Account ** accListCopy (Account **list);
Split ** accListGetSortedSplits (Account **list);
Account ** xaccGroupToList (Account *);