holotko wrote:
> Thanks for all the help and suggestions concerning this question. Actually,
> soon after I sent this out I sort of figured out what was the problem.
> Checking some of the documentation I discovered the GNU implementation of
> dbm , or gdbm, was installed. In the source code I replaced the header file
> "ndbm.h" with "gbbm.h". Also, I noted that some of the functions had
> changed somewhat, mostly the names, i.e. dbm_fetch() ---> gdbm_fetch,
> dbm_store() --> gdbm_store(), etc. Most notably different under gdbm was
> gdbm_open(), in which the parameter list was slightly different. Also, when
> declaring the pointer I had to use "GDBM_FILE dbm" as opposed to "DBM
> *dbm;". All in all the differences between the older implementation of dbm,
> and the new GNU gdbm impl. appeared to be relatively minor, at least as far
> as the most basic functions are concerned. it didn't take me too long to
> modify my source and get the project to recompile and run satisfactorily.
Note that libgdbm also implements the dbm_* functions. You can take a
program which uses the functions declared in ndbm.h and link it
against libgdbm. You don't have to modify it.
> Someone also pointed out the name of the library to link to in order to
> utilize the old functions "-ldb" I believe....
libdb also provides the dbm_* functions. However, it uses the libdb
(aka `Berkeley DB' or `NEWDB') file format. If you need to read files
which were created by libdbm or libgdbm, then you need to use one of
these libraries rather than libdb.
If you don't need to read existing dbm/gdbm files, then libdb's format
is better, as it is architecture-independent.
--
Glynn Clements <[EMAIL PROTECTED]>