tdb_firskey(Aug 16, 2000) tdb_firskey(Aug 16, 2000) NAME tdb_firstkey - return the key of the first record in a tdb database tdb_nextkey - return the key of next record in the tdb database SYNOPSIS #include TDB_DATA tdb_firstkey(TDB_CONTEXT *tdb); TDB_DATA tdb_nextkey(TDB_CONTEXT *tdb, TDB_DATA prev_key); DESCRIPTION tdb_firstkey fetches the key of the first entry in the tdb database. tdb_nextkey fetches the key of the entry imme- diately after prev_key in the database. The TDB_DATA structure returned by both these functions is defined as: typedef struct { char *dptr; size_t dsize; } TDB_DATA; The order in which this traverses the database is its own internal hash order. Do not expect the keys to be in any recognisablly sorted order. Since tdb allows writers to exist at the same time as readers, the results of trying to iterate through the records this way could be unpredictable because the database might need to reorganize to accomidate new or larger records and this could change the position of a record. If you need to traverse the whole database use tdb_traverse instead. RETURN VALUE If the call succeeds, then a TDB_DATA structure is returned with the dptr structure filled in. If the call fails or you have reached the end of the database then dptr will be set to NULL. NOTE: The caller is responsible for freeing the data pointed to by dptr AUTHORS Software: Andrew Tridgell and Luke Kenneth Casson Leighton Man page: Ben Woodard SEE ALSO gdbm(3), tdb(3) Linux Programmer's Manual Samba 1