00001 00003 /* 00004 * Machine Problem #1 00005 * CS 241 00006 */ 00007 00008 #ifndef LIBDICTIONARY_H__ 00009 #define LIBDICTIONARY_H__ 00010 00011 extern const int NO_KEY_EXISTS; 00012 extern const int KEY_EXISTS; 00013 extern const int ILLEGAL_FORMAT; 00014 00015 typedef struct _dictionary_entry_t 00016 { 00017 00018 } dictionary_entry_t; 00019 00020 typedef struct _dictionary_t 00021 { 00022 /* You may find this dictionary_entry_t pointer useful. 00023 You are not required to use it and may remove it 00024 but your data structure MUST shrink/expand based on 00025 the size of entries. */ 00026 dictionary_entry_t *entry; 00027 } dictionary_t; 00028 00029 00030 void dictionary_init(dictionary_t *d); 00031 int dictionary_add(dictionary_t *d, const char *key, const char *value); 00032 int dictionary_parse(dictionary_t *d, char *key_value); 00033 const char *dictionary_get(dictionary_t *d, const char *key); 00034 int dictionary_remove(dictionary_t *d, const char *key); 00035 void dictionary_destroy(dictionary_t *d); 00036 00037 #endif