Added initial config file support.

This commit is contained in:
pdw
2003-10-19 06:44:33 +00:00
parent 3824538a29
commit 458045923b
11 changed files with 799 additions and 30 deletions

33
stringmap.h Normal file
View File

@@ -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_ */