Menu

EXTFH for GNU COBOL and Zen/Btrieve

Anonymous
2022-02-01
2022-02-01
  • Anonymous

    Anonymous - 2022-02-01

    Where can I find the spec for adding a new database driver to GNU COBOL using EXTFH?

    I would like to interface the Zen/Btrieve API version 2 for C to GNU COBOL via EXTFH.

     
    • Simon Sobisch

      Simon Sobisch - 2022-02-01

      The is no such spec, but you can either "add a new database driver to GnuCOBOL" (as "have it used internally for all ORGANIZATION INDEXED [in this case you'd copy fbdb.c and implement everything] or you would create an EXTFH library interface that would be useable with any software that supports EXTFH (that is a standardized interface).

      I guess you want to do the later - in this case "just implement all functions" (or those that are relevant for you). As EXTFH is standardized you can find multiple docs online, the best I've seen so far are actually from Micro Focus (just ensure you use the FCD3 value).

      As a starting point you may use GnuCOBOL's EXTFH callback function (which you'd call when you are not interested in handling a specific file/type in the API). You can find it as EXTFH3 function at in https://sourceforge.net/p/gnucobol/code/4544/tree/trunk/libcob/fextfh.c#l1366 - of course nearly every call done there would be replaced by you for the wanted API and a bunch of stuff is only relevant to GnuCOBOL itself - but as a starting point it may be what you look out for.

      The spec is more or less: an entry point that uses an FCD3 structure, there's a C version and a COBOL version [yes, you can also write your EXTFH interface in COBOL].

       

Anonymous
Anonymous

Add attachments
Cancel