#include <cat/dasp.h>
int catdasp_setdb(catdasp_protocol *proto, catdb_func *func, void *handle);
The semantics for the database handler are the same as for the database handler used by catssl_setdb. The handle argument can contain arbitrary data and will be passed to the function.
The function should match the following prototype:
typedef int catdb_func(int op,
const catdb_data *data,
void *handle);
The data argument is a structure that looks as follows:
typedef struct catdb_data {
cat_data key;
cat_data value;
} catdb_data;
Where cat_data is the following structure:
typedef struct cat_data {
int len;
void *data;
} cat_data;
The processing of the function depends on the op argument. If the function is successful, it should return 0. Any other return values are considered fatal errors.
The op argument should be one of the following values:
Returns CAT_OK.