COHERENT manpages

This page displays the COHERENT manpage for firstkey() [Retrieve the first record from a DBM data base].

List of available manpages
Index


firstkey() -- DBM Function (libgdbm)

Retrieve the first record from a DBM data base
#include <dbm.h>
datum firstkey()

Function firstkey() retrieves the  first record from the currently open DBM
data  base.  The  data base  must have  been opened by  a call  to function
dbminit().

firstkey()  returns a  pointer to  the retrieved record.   If no  record is
available (i.e.,  the data base is  empty), or if an  error occurred, field
dptr within the returned record is initialized to NULL.

Please  note that  the hashing  algorithm used  the DBM  functions dictates
which record  is ``first''  within the  data base.  A  loop that  uses this
function plus  the function nextkey()  will retrieve every  record from the
data  base; however,  the records  probably will  not be  in the  order you
expect.

See Also


Notes

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