/*
* This file is part of DisOrder.
- * Copyright (C) 2004, 2005 Richard Kettlewell
+ * Copyright (C) 2004, 2005, 2007, 2008 Richard Kettlewell
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* USA
*/
-#include <config.h>
-#include "types.h"
-
-#include <string.h>
-#include <stdio.h>
+#include "common.h"
#include "mem.h"
#include "kvp.h"
return kvp ? kvp->value : 0;
}
+struct kvp *kvp_make(const char *name, ...) {
+ const char *value;
+ struct kvp *kvp = 0, *k;
+ va_list ap;
+
+ va_start(ap, name);
+ while(name) {
+ value = va_arg(ap, const char *);
+ k = xmalloc(sizeof *k);
+ k->name = name;
+ k->value = value ? xstrdup(value) : value;
+ k->next = kvp;
+ kvp = k;
+ name = va_arg(ap, const char *);
+ }
+ va_end(ap);
+ return kvp;
+}
+
/*
Local Variables:
c-basic-offset:2