Section: Linux Programmer's Manual (3)Updated: Aug 16, 2000Local indexUp
tdb_open - Open a tdb database.
#include <tdb.h>TDB_CONTEXT *tdb_open(const char *pathname, int hash_size, int tdb_flags, int open_flags, mode_t mode );
Open the database, creating it if necessary. The
size is advisory, use zero for a default value.
can be one of
Clear database if we are the only one with it open.
Don't use a file, instead store the data in memory. The
are ignored in
this case. This is useful if you need a quick associative array or map.
Don't do any locking (this is always turned on for read-only file
Don't use mmap.
Create a database in the reverse of native endian: normally when the
database is created (or cleared with TDB_CLEAR_IF_FIRST), it is
created in native endian order. This flag is set (or unset)
automatically for existing databases.
are passed straight to the open call on the database file. A flags
value of O_WRONLY is invalid.
On success a pointer to an opaque data structure, a TDB_CONTEXT is
returned. On error a NULL is returned.