Guile API
John Ralls
jralls at ceridwen.us
Sun Nov 8 13:12:01 EST 2015
> On Nov 7, 2015, at 2:21 PM, Alex Weiss <alexweiss at theplate.com> wrote:
>
> Thanks for your help. I saw that code. However, I seem to be missing something. While the c function qof_session_new is exposed as qof-session-new, the same is not true for qof_session_begin.
>
> In my guile file I include gnucash bindings as so....
>
> (use-modules (gnucash gnc-module))
> (gnc:module-system-init)
> (gnc:module-load "gnucash/engine" 0)
>
> But a call to (qof-session-begin (qof-session-new) "file://agnucashfile.gnucash" #t #f #t)) is considered a call to "Unbound variable: qof-session-begin).
>
> Is qof-session-begin in a different module?
Ah, I’d forgotten that the python bindings have their own gnucash_core.i that %includes a bunch of headers not included in engine.i.
> On Nov 8, 2015, at 8:43 AM, Alex Weiss <alexweiss at theplate.com> wrote:
>
> I suspected I was going to have to make some sort of patch. Does anyone know if there are plans to expose "qof-session-load" in engine.i in a GnuCash release? As far as I can see, without it, I have to use the Python API.
There aren’t any at present, but it wouldn’t be that big a change.
You led off saying that you wanted to script GnuCash, which implies that there’s a running GnuCash with a loaded session that you want to manipulate. If what you really want to do is to run a separate program that uses the API, Python is perhaps a better choice unless you need to access API written in Scheme, like the QIF importer.
Regards,
John Ralls
More information about the gnucash-user
mailing list