Scripting

Hendrik Boom hendrik at topoi.pooq.com
Mon Nov 14 13:00:22 EST 2011


On Sun, 13 Nov 2011 19:17:38 -0500, Derek Atkins wrote:

> Hendrik Boom <hendrik at topoi.pooq.com> writes:
> 
>>>> (3) This library would be the basis for scripting interfaces to
>>>> gnucash. The API would make the gnucash library itself indifferent to
>>>> the scripting language being used.  Of course, the API must still be
>>>> clearly documented, or it will be practically useless.  Documentation
>>>> in the header files may suffice.
>>> 
>>> This is also the case.  The Scheme and Python bindings are based on
>>> the C APIs by wrapping using SWIG.
>>
>> Good.  By the Scheme bindings do you mean the hooks for the report-
>> generating guile code?
> 
> Amongst others, yes.  The reports use the scheme bindings, but there are
> more APIs wrapped than just those used by the reports.  For a while back
> in the 1.x days the gnucash "application" was actually a guile script.

I suppose then that the paragraphs in  src/scm/startup-design.txt are 
obsolete:

- gnucash is a hybrid /bin/sh and guile script which first execs
    gnucash-env on itself to set up the proper environment and then
    run the rest of the code in the gnucash file as a guile script.
- from the gnucash script itself, the (gnucash bootstrap) is loaded,
    and then control transfers to the scheme function, main.

Is there still a way, other than as a report, to run a scheme script that 
uses gnucash's API?

-- hendrik



More information about the gnucash-devel mailing list