Go to the documentation of this file.00001 #ifndef _PDICT_H_
00002 #define _PDICT_H_
00003
00004 typedef enum {
00005 PDR_VALUE_CHANGED = 1,
00006 PDR_ENTRY_ADDED,
00007 PDR_ENTRY_REMOVING,
00008 PDR_CURRENT_VALUE
00009 } pdict_reason_t;
00010
00011
00012 typedef struct pdict pdict_t;
00013
00014 typedef void (*pdl_notify_func_t)(const char *k,
00015 const char *v,
00016 pdict_reason_t r,
00017 const char *pde_oldval,
00018 void *arg);
00019
00020 typedef int (*pdict_walk_func_t)(const char *k,
00021 const char *v,
00022 void *arg);
00023
00024 pdict_t *pdict_alloc(void);
00025
00026 int pdict_add(pdict_t *pd,
00027 const char *k,
00028 const char *v,
00029 const char **ovp);
00030
00031 int pdict_add_persistent_change_listener(pdict_t *pd,
00032 const char *kpat,
00033 pdl_notify_func_t,
00034 void *);
00035
00036 int pdict_walk(pdict_t *pd,
00037 pdict_walk_func_t,
00038 void *arg);
00039
00040
00041
00042
00043
00044
00045 int pdict_ent_lookup(pdict_t *pd,
00046 const char *k,
00047 const char **v);
00048
00049 int pdict_ent_add_change_listener(pdict_t *pd,
00050 const char *k,
00051 pdl_notify_func_t,
00052 void *);
00053
00054 int pdict_ent_remove_change_listener(pdict_t *pd,
00055 const char *k,
00056 pdl_notify_func_t,
00057 void *);
00058
00059 int pdict_remove_persistent_change_listener(pdict_t *pd,
00060 int id);
00061
00062 int pdict_ent_remove(pdict_t *pd,
00063 const char *k,
00064 char **ovp);
00065
00066 const char *pdict_reason_str(pdict_reason_t);
00067
00068 pdict_reason_t pdict_reason_from_str(const char *);
00069
00070 #endif