+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;
+}
+