00001 00002 /* 00003 * CS 241 00004 * The University of Illinois 00005 */ 00006 00007 #ifndef _LIBDS_H_ 00008 #define _LIBDS_H_ 00009 00010 #include <pthread.h> 00011 00012 typedef struct _datastore_t 00013 { 00014 void *root; 00015 pthread_mutex_t mutex; 00016 } datastore_t; 00017 00018 void datastore_init(datastore_t *ds); 00019 00020 unsigned long datastore_put(datastore_t *ds, const char *key, const char *value); 00021 const char *datastore_get(datastore_t *ds, const char *key, unsigned long *revision); 00022 unsigned long datastore_update(datastore_t *ds, const char *key, const char *value, unsigned long known_revision); 00023 unsigned long datastore_delete(datastore_t *ds, const char *key, unsigned long known_revision); 00024 00025 void datastore_destroy(datastore_t *ds); 00026 00027 #endif