Qsmtp  0.30dev
Functions
cdb.h File Reference

headers of function to read from CDB database More...

#include <sys/stat.h>

Go to the source code of this file.

Functions

const char * cdb_seekmm (int, const char *, unsigned int, char **, const struct stat *)
 

Detailed Description

headers of function to read from CDB database

Function Documentation

const char* cdb_seekmm ( int  fd,
const char *  key,
unsigned int  len,
char **  mm,
const struct stat *  st 
)

perform cdb search on the given file

Parameters
fdfile descriptor to search (will be closed)
keykey to search for
lenlength of key
mmbase of mmapped address space
stfile information
Returns
cdb value belonging to that key
Return values
NULLno key found in database or error

If the function returns NULL and errno is 0 everything worked fine but there is no entry for key in the file. On error errno is set.

The file is mmaped into memory, the result pointer will point inside that memory. The caller must munmap() the value returned in mm if the function does not return NULL. fd will be closed before the function returns.