gncBookMerge second draft

Neil Williams linux at codehelp.co.uk
Sun Jun 20 06:36:08 EDT 2004


The doxygen docs should be a complete guide:
http://www.codehelp.co.uk/code/group__BookMerge.html
http://www.codehelp.co.uk/code/gncBookMerge_8h.html
http://www.codehelp.co.uk/code/gncBookMerge_8c.html
http://www.codehelp.co.uk/code/gncBookMerge.c
http://www.codehelp.co.uk/code/gncBookMerge.h
http://www.codehelp.co.uk/code/Makefile.am

I've got to the start of the comparison process - all the types and objects 
and all the rules are ready. Output so far is limited:
Gnucash Version 1.9.0
Test Account: Neil's testing account
Test Account 2: Neil's second account
type label Account
Account name    Neil's testing account

Account code
Account notes   (null)
Account name    Neil's second account

Account code
Account notes   (null)

The comparison routine is very bare, I wanted to get the rest ready before 
continuing - it can currently receive all objects (although only Account is 
defined) and all types (although QOF_TYPE_STRING is the only one active).

My issues with it at the moment all centre around freeing memory. I haven't 
used g_free() or similar functions so far - it's not that much of a problem 
when running in console mode with only one object! I'd appreciate advice on 
where objects must be freed.

General views on the design, criticism, derision, laughter, all to the usual 
address.
:-)

It compiles to a 6.7k executable.

I've also had some thoughts on making a better link between gncBookMerge and 
qof_class_register:
http://www.codehelp.co.uk/code/group__BookMerge.html#ga7
mergeRegister needs to be extended to include the parameter names of all 
available objects Alternatively, it could be obtained from qof_class if a 
suitable call is added to the API in the future - this would eliminate the 
need to manually update gncBookMerge.c every time an object is added, removed 
or amended.
 Possible call:
 GSList* qof_class_get_all_parameters ( QofIdType obj_name);
(basically a version of qof_class_get_parameter called without a second 
parameter and returning a GSList*)
 The full list of available objects is already available, combining the two 
will be sufficient to generate mergeRegister at run-time. 

-- 

Neil Williams
=============
http://www.codehelp.co.uk/
http://www.dclug.org.uk/
http://www.isbn.org.uk/
http://sourceforge.net/projects/isbnsearch/

http://www.biglumber.com/x/web?qs=0x8801094A28BCB3E3
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: signature
Url : http://lists.gnucash.org/pipermail/gnucash-devel/attachments/20040620/74bbe84e/attachment.bin


More information about the gnucash-devel mailing list