cdb_find man page on Alpinelinux

Man page or keyword search:  
man Server   18016 pages
apropos Keyword Search (all sections)
Output format
Alpinelinux logo
[printable version]

cdb_find(3)							   cdb_find(3)

NAME
       cdb_find - look up a key in a constant database

SYNTAX
       #include <cdb.h>
       #include <uint32.h>

       int cdb_find(struct cdb *c,char *key,unsigned long int keylen);
       int cdb_datalen(struct cdb *c);
       int cdb_datapos(struct cdb *c);
       int cdb_findnext(struct cdb *c,char *key,unsigned long int keylen);

DESCRIPTION
       cdb_find	 looks	for  key. If cdb_find returns 0, the database does not
       contain that key; stop. If cdb_find returns -1, there was a read error;
       abort.

       cdb_datalen  returns  the  length  of the data associated with the key.
       Use it to allocate a pointer p with enough space to hold the data.

       cdb_datapos returns the position of the data inside the file.   Use  it
       as argument to cdb_read to retrieve the data.

       There  may be several records under a single key. You can use cdb_find‐
       next to find the next record under this key.

EXAMPLE
       static struct c;

       if (cdb_find(&c,key,strlen(key)>0) {
	 char *buf=alloca(cdb_datalen(&c));
	 cdb_read(&c,buf,cdb_datalen(&c),cdb_datapos(&c));
	 write(1,buf,cdb_datalen(&c));
       }

SEE ALSO
       cdb_read(3), cdb_init(3), cdb_free(3), cdbmake(1)

								   cdb_find(3)
[top]

List of man pages available for Alpinelinux

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net