-
-
Notifications
You must be signed in to change notification settings - Fork 3
constmap.3
constmap - create, search constant search maps
#include <constmap.h>
int constmap_init(struct constmap *cm, char *str, int size,
int delimiter);
int constmap(struct constmap *cm, char *str, int len);
int constmap_free(struct constmap *cm);
constmap_init() initializes a constmap database with content in str of size size. You can prepare str using
control_readfile(&str, "filename");
constmap_init() converts the data into a constant search map. You can specify if the records are unstructured or in key/value pair separated by colon ':' character by using 1 for delimiter. If you want to change the delimiter to something else, specify the character in delimiter. You can specifiy an ASCII character from SPACE ' ' to TILDE '~'. Any other value sets the delimiter to the colon character ':'.
constmap() returns a pointer to data pointed by str if found else it returns NULL.
constmap_free() frees memory allocated my constmap_init().
ascii(7)