Some General questions about GC

Andrew Sackville-West andrew at swclan.homelinux.org
Sat Jan 19 12:32:28 EST 2008


On Fri, Jan 18, 2008 at 11:24:49PM -0500, Richard Geddes wrote:
> I took a class using the EOPL text about 2 years ago so I'm a little
> rusty. 
> 
> Using Dr Scheme... do you recommend a particular language or is the
> Standard r5RS ok?

http://www.gnu.org/software/guile/guile.html

is what is used. It interfaces between the gnucash C code and the
scheme report code.

> 
> Looks like there are some functions that are defined in other files...
> is there a 'main' file that calls/includes invoice.scm?

It's much more complicated than that, but for starters, look at
/usr/share/gnucash/guile-modules/report/report-system.scm which shows
a good chunk of the available API. There is more but it's a start.

> 
> Can the scheme code run by itself or does it need the main GC to run?

no, you need the GC API. It works like this: the main C code exposes a
pretty broad interface of functions that allow you to do just about
anything from the scheme side. There are also a number of helper
functions written in scheme that add to that C functionality. The
biggest hurdle in modifying or writing the reports is learning the
available API. The scheme parts are pretty easy, it learning what
functions you need to get the info out gnucash proper to get the
results you want. 

For example there is a whole series of xacc* functions:

xaccAccountGetSplits -> returns a list of all the splits in an account
xaccSplitGetTrans(or maybe its Txn) -> returns the parent txn of the
split
xaccSplitGetOtherSplit -> in a two split txn returns the other split
etc etc etc 

The hard part is learning what all those things are and how they
work. 

A good starting place is svn.gnucash.org and browse the api
documentation.

hth

A
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.gnucash.org/pipermail/gnucash-user/attachments/20080119/c3e9e85a/attachment.bin 


More information about the gnucash-user mailing list