netbsd man page for cdbr

Query: cdbr

OS: netbsd

Section: 3

Links: netbsd man pages   all man pages

Forums: unix linux community   forum categories

Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar

CDBR(3) 						   BSD Library Functions Manual 						   CDBR(3)

NAME
cdbr cdbr_open, cdbr_entries, cdbr_get, cdbr_find, cdbr_close, cdbr_write -- constant database access methods
SYNOPSIS
struct cdbr * cdbr_open(const char *path, int flags); uint32_t cdbr_entries(struct cdbr *cdbr); int cdbr_get(struct cdbr *cdbr, uint32_t index, const void **data, size_t *datalen); int cdbr_find(struct cdbr *cdbr, const void *key, size_t keylen, const void **data, size_t *datalen); void cdbr_close(struct cdbr *cdbr);
DESCRIPTION
The cdbr library provides a space efficient (key,value) database based on perfect hashing. A cdb database is opened for reading by calling cdbr_open(). The only supported value for flags is CDBR_DEFAULT. The function returns a handle to pass to the other functions. The database is closed by invoking cdbr_close(). All resources associated with the handle are freed and the memory returned by cdbr_get() and cdbr_find() is invalidated. The number of records in the database can be obtained by calling cdbr_entries(). Records can be obtained by record number using cdbr_get() or by key using cdbr_find(). Both functions return 0 on success and update data and datalen accordingly. The location *data remains valid until cdbr_close() is called. It is the responsibility of the caller of cdbr_find() to ensure that the key matches the returned data. The function returns the only possible match, but the database doesn't store the keys to minimize overhead.
SEE ALSO
nbperf(1), cdbw(3), db(3), cdb(5)
HISTORY
Support for the cdb format first appeared in NetBSD 6.0.
AUTHORS
The cdbr and cdbw functions have been written by Joerg Sonnenberger <joerg@NetBSD.org>.
BSD
March 3, 2010 BSD
Related Man Pages
cdbr_get(3) - netbsd
cdbr_find(3) - netbsd
cdbw_put_data(3) - netbsd
cdbw_put_key(3) - netbsd
cdb(5) - netbsd
Similar Topics in the Unix Linux Community
error: rw/regexp.h: No such file or directory
missing binary operator before token &quot;(&quot;
cast from const void* to unsigned int loses precision
Copy of &quot;How to create a long list of directories with mkdir?&quot;