QOF API and gnucash string cache code in G2

Neil Williams linux at codehelp.co.uk
Thu Oct 20 05:20:09 EDT 2005


On Friday 14 October 2005 1:54 pm, David Hampton wrote:
> Log Message:
> -----------
> Patch from Chris Shoemaker to privatize the gnucash string cache code
> and force all usage through gnc_string_cache_{remove,insert}()
> functions.  This makes debugging various uses (and misuses) of the
> cache easier.

Part of this is going to need to be made backwards-compatible with the 
external QOF library: (despite the name, gnc-engine-util.c|h is part of QOF 
even though gnc-engine.c|h is only in gnucash - this is one of the filename 
changes I want to make within libqof1. Using #include "qof.h" insures against 
problems when this is changed.)

> -/** Get the gnc_string_cache.  Create it if it doesn't exist already
> -
> -\todo hide the gcache as a static */
> -GCache* gnc_engine_get_string_cache(void);

I can't remove a part of the API like that, it needs to be retained and 
deprecated. It won't affect gnucash, but it would break other QOF 
applications.

To maintain synchronisation with external QOF, I'll reinstate the old 
non-static function as a deprecated part of the API.

Something like:

> Index: gnc-engine-util.h
+/** Get the gnc_string_cache.  Create it if it doesn't exist already
+
+ \deprecated Use qof_init instead. */
+GCache* gnc_engine_get_string_cache(void);

> Index: gnc-engine-util.c
>
+ /* deprecated function - to be made static */
- static GCache*
+ GCache*
gnc_engine_get_string_cache(void)

The deprecated function is not now used in gnucash and this change should not 
have any effect elsewhere.

As with all other changes to QOF files, all deprecated code will be removed in 
a single operation when libqof2 is ready and no parts of the API will be 
removed during the life of libqof1 (which has been on pre-release for a few 
weeks now). 

My next patch should clarify which files are QOF files and which are gnucash 
engine files.

-- 

Neil Williams
=============
http://www.data-freedom.org/
http://www.nosoftwarepatents.com/
http://www.linux.codehelp.co.uk/

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


More information about the gnucash-devel mailing list