summaryrefslogtreecommitdiff
path: root/stringmap.h
diff options
context:
space:
mode:
authorpdw <>2003-10-19 06:44:33 +0000
committerpdw <>2003-10-19 06:44:33 +0000
commit458045923be8a5ff15493a2fd4343f1899a03fa0 (patch)
tree625f07958bf4f2b41da1d0774f8fea26e2a3faed /stringmap.h
parent3824538a293966a04eeec220110cc6e84f133312 (diff)
downloadiftop-458045923be8a5ff15493a2fd4343f1899a03fa0.zip
Added initial config file support.
Diffstat (limited to 'stringmap.h')
-rw-r--r--stringmap.h33
1 files changed, 33 insertions, 0 deletions
diff --git a/stringmap.h b/stringmap.h
new file mode 100644
index 0000000..f5d0153
--- /dev/null
+++ b/stringmap.h
@@ -0,0 +1,33 @@
+/*
+ * stringmap.h:
+ * map of strings
+ *
+ * Copyright (c) 2001 Chris Lightfoot. All rights reserved.
+ *
+ * $Id$
+ *
+ */
+
+#ifndef __STRINGMAP_H_ /* include guard */
+#define __STRINGMAP_H_
+
+#include "vector.h"
+
+typedef struct _stringmap {
+ char *key;
+ item d;
+ struct _stringmap *l, *g;
+} *stringmap;
+
+stringmap stringmap_new(void);
+void stringmap_delete(stringmap);
+void stringmap_delete_free(stringmap);
+
+/* Try to insert an item into a stringmap, returning 1 if the map already
+ * contained an item with that key.
+ */
+item *stringmap_insert(stringmap, const char*, const item);
+/* Find an item in a stringmap */
+stringmap stringmap_find(const stringmap, const char*);
+
+#endif /* __STRINGMAP_H_ */