QOF iteration and callbacks

Neil Williams linux at codehelp.co.uk
Fri Jun 18 10:51:03 EDT 2004


On Friday 18 June 2004 3:08, Linas Vepstas wrote:
> On Thu, Jun 17, 2004 at 10:46:33AM -0400, Derek Atkins was heard to remark:
> > > void gnc_bm_foreach (QofEntity obj, gpointer ud1); doesn't work. Why?
> >
> > You need (QofEntity* obj, gpointer ud1).
>
> I'm guessing that the * was dropped accidentally, and then Niel
> had a very hard seeing that it was missing.  

Precisely. I missed it because of my lack of familiarity with callbacks - 
normally you get a much clearer warning from the compiler when you make a 
typo like that.

However, that wasn't all that was missing. I'm testing this in a 'limited' 
environment where only certain parts of the engine are initialised, 
specifically, I haven't loaded any modules or any external files. What I 
didn't realise is that I could not hope to use GNCInvoice in that environment 
- it was never going to be properly registered with QofObject and would 
therefore always generate the critical error. I've switched to testing 
Account and it's coming along OK. No more critical errors from 
qof_object_foreach. The iteration is solved, now I'm working on building the 
rule sets.

> Once you miss 
> something like that, the brain can leap to various incorrect
> conclusions, and then ...
>
> > > my brain is getting addled, is that
> > > example a declaration or just another cast?
>
> which didn't have anythingto do with the actual problem.

:-)

-- 

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/20040618/bf44038f/attachment.bin


More information about the gnucash-devel mailing list