Please remember to copy the list on all replies so that everyone benefits from 
what you learn.

Regards,
John Ralls

> On May 5, 2026, at 17:01, NH Rao <[email protected]> wrote:
> 
> Thank you for the reply. If you want, I can share the github link within a 
> couple of days after I feel a bit more comfortable. This was my first forrey 
> with Java FFM and based on what I am seeing so far, it can be very useful. I 
> was able to run basic gnucash code in a day, including gnc_numeric which was 
> a bit more challenging.
> 
> As for the backend, I am just calling gnc_engine_init. This seems to be doing 
> proper things for me like loading the file backend.
> 
> I've few lofty goals in mind and will eventually start moving in that 
> direction. These include getting the amount due from my PDF statements for 
> various bills and creating corresponding transactions and creating splits for 
> my salary stub entries.
> 
> Regards,
> 
> Niranjan
> 
> On Tue, May 5, 2026 at 4:41 PM John Ralls <[email protected] 
> <mailto:[email protected]>> wrote:
>> This sounds like an interesting experiment!
>> 
>> There’s nothing special about header file naming. The original XACC headers 
>> had capitalized names, very few of the later ones do. Note, though, that 
>> headers having the .hpp suffix export C++-mangled symbols and I don’t think 
>> Java can link those without SWIG bindings.
>> 
>> You’ll need at least libgnc-core-utils.so <http://core-utils.so/>, it has 
>> utilities that the engine depends on. You’ll also need at least one of the 
>> backend libraries to handle persistence unless you’re planning to write your 
>> own.
>> 
>> Regards,
>> John Ralls
>> 
>> 
>> > On May 5, 2026, at 1:30 PM, NH Rao <[email protected] 
>> > <mailto:[email protected]>> wrote:
>> > 
>> > Greetings,
>> > 
>> > I am experimenting with Java FFM API to call gnucash API functions. So far 
>> > I am able to emulate the functionality of 
>> > bindings/python/example_scripts/export_account_totals.py with similar 
>> > results. This was a just POC and now I am seriously attempting to write 
>> > proper code.
>> > 
>> > Some questions
>> > 
>> > I am using headers files which start with capital letters (e.g. Account.h) 
>> > as it felt like convention is to expose API from these files. Did I get 
>> > this right?
>> > 
>> > I am just using libgnc-engine.so when importing a shared library. Do I 
>> > need to import any other shared libraries for the API functionality?
>> > 
>> > Many functions return const char* e.g. const char * xaccAccountGetName 
>> > (const Account *account); but the header file does not mention that the 
>> > caller has to free the returned pointer. But gnc_numeric_to_string 
>> > explicitly mentions that the caller has to free the memory.  Is it safe to 
>> > assume that if there is no explicit comment, I don't need to worry about 
>> > freeing the memory
>> > 
>> > Regards,
>> > 
>> > Niranjan
>> > _______________________________________________
>> > gnucash-devel mailing list
>> > [email protected] <mailto:[email protected]>
>> > https://lists.gnucash.org/mailman/listinfo/gnucash-devel
>> 

_______________________________________________
gnucash-devel mailing list
[email protected]
https://lists.gnucash.org/mailman/listinfo/gnucash-devel

Reply via email to