cdb_init_frommem(3)
limb manual
cdb_init_frommem(3)
NAME
cdb_init_frommem - initialize a cdb from memory area
SYNOPSIS
#include <limb/cdb.h>
void cdb_init_frommem(cdb *c, const char *mem, u32 len)
DESCRIPTION
The cdb_init_frommem
() function initializes the cdb pointed to by c
, which
must be CDB_ZERO
before the call, to use the memory pointed by mem
which
must hold the content of a valid cdb file, for len
bytes.
Warning
A cdb initialized via this function is just as valid as with one of the
functions using a file as backend. However, you should not call
cdb_free(3) with a cdb initialized from cdb_init_frommem
().
Instead, it is up to the caller to free the memory pointed to by mem
however it needs to, once the cdb isn't needed anymore.