COHERENT manpages

This page displays the COHERENT manpage for gdbm_fetch() [Retrieve a record from a GDBM data base].

List of available manpages
Index


gdbm_fetch() -- GDBM Function (libgdbm)

Retrieve a record from a GDBM data base
#include <gdbm.h>
datum gdbm_fetch (database, key)
GDBM_FILE database;
datum key;

Function gdbm_fetch()  retrieves the record  with key from  the database to
which  database points.   database must  have  been returned  by a  call to
gdbm_open().

gdbm_fetch() returns  the record  that contains  key. If database  does not
contains such  a record, gdbm_fetch() returns a record  whose field dptr is
set to NULL.

gdbm_fetch()  calls malloc()  to allocate  the memory to  hold the  data it
retrieves from database. It is  your responsibility to free this memory; to
do so, call  free() and pass it field dptr  in the record that gdbm_fetch()
returns.

See Also


Notes

For  a statement  of copyright  and  permissions on  this routine,  see the
Lexicon entry for libgdbm.