MP8 Web Server
All Data Structures Files Functions Variables Pages
libdictionary.h
1 /*
2  * CS 241
3  * The University of Illinois
4  */
5 
6 #ifndef _LIBDICTIONRY_H_
7 #define _LIBDICTIONRY_H_
8 
9 #include <pthread.h>
10 
11 #define KEY_EXISTS 1
12 #define NO_KEY_EXISTS 2
13 #define ILLEGAL_FORMAT 3
14 
15 typedef struct _dictionary_entry_t
16 {
17  const char *key, *value;
19 
20 typedef struct _dictionary_t
21 {
22  void *root;
23  pthread_mutex_t mutex;
24 } dictionary_t;
25 
26 
30 
31 int dictionary_add(dictionary_t *d, const char *key, const char *value);
32 const char *dictionary_get(dictionary_t *d, const char *key);
33 int dictionary_parse(dictionary_t *d, char *key_value);
34 int dictionary_remove(dictionary_t *d, const char *key);
35 
36 #endif