+struct ZOOM_options_entry {
+ char *name;
+ char *value;
+ int len; /* of `value', which may contain NULs */
+ struct ZOOM_options_entry *next;
+};
+
+struct ZOOM_options_p {
+ int refcount;
+ void *callback_handle;
+ ZOOM_options_callback callback_func;
+ struct ZOOM_options_entry *entries;
+ ZOOM_options parent1;
+ ZOOM_options parent2;
+};
+
+static void set_value(struct ZOOM_options_entry **e,
+ const char *value, int len)
+{
+ (*e)->value = 0;
+ (*e)->len = 0;
+ if (value)
+ {
+ (*e)->value = (char *) xmalloc(len+1);
+ memcpy((*e)->value, value, len);
+ (*e)->value[len] = '\0';
+ (*e)->len = len;
+ }
+}
+
+static void append_entry(struct ZOOM_options_entry **e,
+ const char *name, const char *value, int len)
+{
+ *e = (struct ZOOM_options_entry *) xmalloc(sizeof(**e));
+ (*e)->name = xstrdup(name);
+ set_value(e, value, len);
+ (*e)->next = 0;
+}
+