mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
move transaction-counting-utility from book to transaction
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@8532 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
parent
071b1b7166
commit
fc0189c3f5
@ -3037,6 +3037,24 @@ xaccSplitMakeStockSplit(Split *s)
|
||||
}
|
||||
|
||||
|
||||
/* ====================================================================== */
|
||||
|
||||
static gboolean
|
||||
counter_thunk(Transaction *t, void *data)
|
||||
{
|
||||
(*((guint*)data))++;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
guint
|
||||
gnc_book_count_transactions(GNCBook *book)
|
||||
{
|
||||
guint count = 0;
|
||||
xaccGroupForEachTransaction(xaccGetAccountGroup(book),
|
||||
counter_thunk, (void*)&count);
|
||||
return count;
|
||||
}
|
||||
|
||||
/********************************************************************\
|
||||
\********************************************************************/
|
||||
|
||||
|
@ -148,6 +148,14 @@ Transaction * xaccTransLookup (const GUID *guid, GNCBook *book);
|
||||
transaction associated with the given id, or NULL
|
||||
if there is no such transaction. */
|
||||
Transaction * xaccTransLookupDirect (GUID guid, GNCBook *book);
|
||||
|
||||
|
||||
/** \warning XXX FIXME
|
||||
* gnc_book_count_transactions is a utility function,
|
||||
* probably needs to be moved to a utility file somewhere.
|
||||
*/
|
||||
guint gnc_book_count_transactions(GNCBook *book);
|
||||
|
||||
/**@}*/
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user