summaryrefslogtreecommitdiffhomepage
path: root/src/orderedmap.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/orderedmap.h')
-rw-r--r--src/orderedmap.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/orderedmap.h b/src/orderedmap.h
new file mode 100644
index 0000000..e3f4b0e
--- /dev/null
+++ b/src/orderedmap.h
@@ -0,0 +1,20 @@
+#ifndef ORDEREDMAP_H
+#define ORDEREDMAP_H
+
+#include <stdlib.h>
+#include "sblist.h"
+#include "hsearch.h"
+
+typedef struct orderedmap {
+ sblist* values;
+ struct htab *map;
+} *orderedmap;
+
+struct orderedmap *orderedmap_create(size_t nbuckets);
+void* orderedmap_destroy(struct orderedmap *o);
+int orderedmap_append(struct orderedmap *o, const char *key, char *value );
+char* orderedmap_find(struct orderedmap *o, const char *key);
+int orderedmap_remove(struct orderedmap *o, const char *key);
+size_t orderedmap_next(struct orderedmap *o, size_t iter, char** key, char** value);
+
+#endif