COHERENT manpages

This page displays the COHERENT manpage for gdbm_firstkey() [Return the first record from a GDBM data base].

List of available manpages
Index


gdbm_firstkey() -- GDBM Function (libgdbm)

Return the first record from a GDBM data base
#include <gdbm.h>
datum gdbm_firstkey(database)
GDBM_FILE database;

Function gdbm_firstkey()  returns the  first record  from the data  base to
which  database points.   database must  have  been returned  by a  call to
gdbm_open().

gdbm_firstkey() returns  the first record  within database. Note  that that
the first record is dictated by the algorithm that the GDBM routines use to
hash the keys within the data  base, and so may not be what you expect.  If
database is empty, gdbm_firstkey() returns a record whose field dptr is set
to NULL.

gdbm_firstkey() 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_firstkey() returns.

See Also


Notes

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