44 (*e)->value[
len] =
'\0';
72 dst_e = &(*dst_e)->
next;
101 opt->callback_func = 0;
102 opt->callback_handle = 0;
104 opt->parent1= parent1;
106 (parent1->refcount)++;
107 opt->parent2= parent2;
109 (parent2->refcount)++;
123 void *callback_handle)
128 callback_old =
opt->callback_func;
129 opt->callback_func = callback_func;
130 opt->callback_handle = callback_handle;
140 if (
opt->refcount == 0)
142 struct ZOOM_options_entry *e;
144 ZOOM_options_destroy(opt->parent1);
145 ZOOM_options_destroy(opt->parent2);
149 struct ZOOM_options_entry *e0 = e;
169 if (!strcmp((*e)->name,
name))
192 if (
opt->callback_func)
194 v = (*opt->callback_func)(opt->callback_handle, name);
201 for (e =
opt->entries; e; e = e->
next)
230 if (!strcmp(v,
"1") || !strcmp(v,
"T"))
void yaz_snprintf(char *buf, size_t size, const char *fmt,...)
Header for config file reading utilities.
struct ZOOM_options_entry * next
ZOOM_options_callback callback_func
struct ZOOM_options_entry * entries
Header for memory handling functions.
#define xstrdup(s)
utility macro which calls xstrdup_f
#define xfree(x)
utility macro which calls xfree_f
#define xmalloc(x)
utility macro which calls malloc_f
ZOOM_options_create(void)
ZOOM_options_getl(ZOOM_options opt, const char *name, int *lenp)
ZOOM_options_create_with_parent(ZOOM_options parent)
ZOOM_options_create_with_parent2(ZOOM_options parent1, ZOOM_options parent2)
ZOOM_options_set(ZOOM_options opt, const char *name, const char *value)
void ZOOM_options_addref(ZOOM_options opt)
static void set_value(struct ZOOM_options_entry **e, const char *value, int len)
ZOOM_options_setl(ZOOM_options opt, const char *name, const char *value, int len)
ZOOM_options_get(ZOOM_options opt, const char *name)
ZOOM_options_dup(ZOOM_options src)
static void append_entry(struct ZOOM_options_entry **e, const char *name, const char *value, int len)
Internal header for ZOOM implementation.
ZOOM_options_destroy(ZOOM_options opt)
ZOOM_options_create(void)
ZOOM_options_set_callback(ZOOM_options opt, ZOOM_options_callback c, void *handle)
ZOOM_options_getl(ZOOM_options opt, const char *name, int *lenp)
ZOOM_options_create_with_parent(ZOOM_options parent)
typedefZOOM_BEGIN_CDECL struct ZOOM_options_p * ZOOM_options
ZOOM_options_get_int(ZOOM_options opt, const char *name, int defa)
ZOOM_options_create_with_parent2(ZOOM_options parent1, ZOOM_options parent2)
ZOOM_options_set(ZOOM_options opt, const char *name, const char *v)
const char *(* ZOOM_options_callback)(void *handle, const char *name)
ZOOM_options_set_int(ZOOM_options opt, const char *name, int value)
ZOOM_options_setl(ZOOM_options opt, const char *name, const char *value, int len)
ZOOM_options_get(ZOOM_options opt, const char *name)
ZOOM_options_dup(ZOOM_options src)
ZOOM_options_get_bool(ZOOM_options opt, const char *name, int defa)