From 334bf1753e1025441c2676fd269ff49c08550a92 Mon Sep 17 00:00:00 2001 From: Dave Peticolas Date: Mon, 23 Oct 2000 22:09:47 +0000 Subject: [PATCH] Fixes for swig bindings. git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@3072 57a11ea4-9604-0410-9ed3-97b8803252fd --- src/engine/Account.h | 3 ++- src/engine/Group.h | 11 +++++++---- src/quotes/gnc-prices.in | 4 +++- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/engine/Account.h b/src/engine/Account.h index 9b630c4f3b..8351839d64 100644 --- a/src/engine/Account.h +++ b/src/engine/Account.h @@ -310,11 +310,12 @@ const char * xaccAccountGetPriceSrc (Account *acc); void xaccAccountSortSplits(Account *); +#ifndef SWIG + gpointer xaccAccountForEachSplit(Account *s, gpointer (*thunk)(Split *s, gpointer data), gpointer data); -#ifndef SWIG /* Traverse all of the transactions in the given account. Continue processing IFF proc does not return FALSE. This function does not diff --git a/src/engine/Group.h b/src/engine/Group.h index 80846dc711..597633ea0f 100644 --- a/src/engine/Group.h +++ b/src/engine/Group.h @@ -197,18 +197,21 @@ char * xaccAccountGetNextChildCode (Account *acc, int num_digits); void xaccGroupAutoCode (AccountGroup *grp, int num_digits); void xaccGroupDepthAutoCode (AccountGroup *grp); +#ifndef SWIG + /* if the function returns null for a given item, it won't show up in the result list */ GSList *xaccGroupMapAccounts(AccountGroup *grp, gpointer (*thunk)(Account *a, void *data), gpointer data); + gpointer xaccGroupForEachAccountDeeply(AccountGroup *grp, - gpointer (*thunk)(Account *a, void *data), + gpointer (*thunk)(Account *a, + void *data), gpointer data); -gboolean xaccGroupEqual(AccountGroup *a, AccountGroup *b, gboolean check_guids); - -#ifndef SWIG +gboolean xaccGroupEqual(AccountGroup *a, AccountGroup *b, + gboolean check_guids); /* * The following functions provide support for "staged traversals" diff --git a/src/quotes/gnc-prices.in b/src/quotes/gnc-prices.in index 4b72e5489b..c99401f5a3 100644 --- a/src/quotes/gnc-prices.in +++ b/src/quotes/gnc-prices.in @@ -132,7 +132,9 @@ die "Usage: $0 " if $#ARGV < 0; # open the file, read all of the accounts print "Opening file $ARGV[0]\n"; $sess = gnucash::xaccMallocSession (); -$grp = gnucash::xaccSessionBegin ($sess, "file:".$ARGV[0]); +gnucash::xaccSessionBegin ($sess, "file:".$ARGV[0]); +gnucash::xaccSessionLoad ($sess); +$grp = gnucash::xaccSessionGetGroup ($sess); die "failed to read file $ARGV[0], maybe its locked? " if (! $grp);