dbm_nextkey()

read the next key of a database 

Function


SYNOPSIS

#include <ndbm.h>

datum dbm_firstkey(DBM *db);


DESCRIPTION

The dbm_nextkey() function returns the next key in the database specified by db. The dbm_firstkey() function must be called before calling dbm_nextkey(). Subsequent calls to dbm_nextkey() return the next key until all of the keys in the database have been returned.

A datum consists of at least two members, dptr and dsize. The dptr member points to an object that is dsize bytes in length. Arbitrary binary data, as well as character strings, may be stored in the object pointed to by dptr.

This function can be combined with dbm_firstkey() to traverse the database, using code such as:

for (key = dbm_firstkey(db);
	key.dptr != NULL;
	key = dbm_nextkey(db))
{
}

PARAMETERS

db 

Points to the database where the key is fetched from. This must be a pointer returned by a prior call to dbm_open().


RETURN VALUES

The dbm_nextkey() function returns a key datum. When the end of the database is reached, the dptr member of the key is a null pointer. If an error is detected, the dptr member of the key is a null pointer, and the error condition of the database is set.


CONFORMANCE

UNIX 98.


MULTITHREAD SAFETY LEVEL

Unsafe.


PORTING ISSUES

None


AVAILABILITY

PTC MKS Toolkit for Professional Developers
PTC MKS Toolkit for Professional Developers 64-Bit Edition
PTC MKS Toolkit for Enterprise Developers
PTC MKS Toolkit for Enterprise Developers 64-Bit Edition


SEE ALSO

Functions:
dbm_clearerr(), dbm_close(), dbm_delete(), dbm_error(), dbm_fetch(), dbm_firstkey(), dbm_open(), dbm_store(), dbopen()


PTC MKS Toolkit 10.3 Documentation Build 39.