access_method and new, empty, sessions.

Neil Williams linux at
Wed Feb 16 16:07:45 EST 2005

In the g2 branch, I adapted qofsession.c to handle QSF using the QOF 
load_backend_library routine in qof_session_load_backend().

Loading an existing file is handled fine, because the routines inspect the 
file contents and report back on what kind of content is found. QSF needs a 
few more tweaks to load files properly but g2 always tells the difference 
between gnucash-xml-v2, v1 or binary vs QSF. That's good - the access_method 
is not a problem here.

(The tweaked code will be in CVS - g2 - soon, it's working locally).

I'm now trying to see how it can work when qof_session_new() and 
qof_session_begin() are called where no content exists, i.e. new, empty, 

Is the access_method more of an identifier than a reflection of a protocol?

Can we invent new access_method strings that have no basis in real protocols? 
(Dialogs and other code can determine which is to be used, there's no reason 
for users to worry or know about the access_method - is there?)

How should I proceed to discriminate two backends that use the same 
access_method when no content exists yet?

Should I use and support:
session = qof_session_new();
qof_session_begin(session, "qsf:/somefile.xml", TRUE, FALSE);

using an arbitrary qsf:/ access_method? 

(Loading an existing file that contains QSF data using file:// will still load 
it as a QSF file.)

Is there an alternative method?


Neil Williams

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url :

More information about the gnucash-devel mailing list