libcomps ..
|
Functions | |
void | comps_objdict_set (COMPS_ObjDict *rt, char *key, COMPS_Object *data) |
void | comps_objdict_set_x (COMPS_ObjDict *rt, char *key, COMPS_Object *data) |
void | comps_objdict_set_n (COMPS_ObjDict *rt, char *key, unsigned int len, COMPS_Object *data) |
COMPS_Object * | comps_objdict_get (COMPS_ObjDict *rt, const char *key) |
COMPS_Object * | comps_objdict_get_x (COMPS_ObjRTree *rt, const char *key) |
void | comps_objdict_unset (COMPS_ObjDict *rt, const char *key) |
void | comps_objdict_clear (COMPS_ObjDict *rt) |
COMPS_HSList * | comps_objdict_values (COMPS_ObjDict *rt) |
void | comps_objdict_values_walk (COMPS_ObjRTree *rt, void *udata, void(*walk_f)(void *, COMPS_Object *)) |
COMPS_ObjDict * | comps_objdict_clone (COMPS_ObjDict *rt) |
COMPS_HSList * | comps_objdict_keys (COMPS_ObjDict *rt) |
COMPS_HSList * | comps_objdict_pairs (COMPS_ObjDict *rt) |
COMPS_ObjDict * | comps_objdict_union (COMPS_ObjDict *d1, COMPS_ObjDict *d2) |
void comps_objdict_clear | ( | COMPS_ObjDict * | rt | ) |
remove all items from dictionary
rt | COMPS_ObjDict object |
COMPS_ObjDict * comps_objdict_clone | ( | COMPS_ObjDict * | rt | ) |
Makes copy of dictionary
Items in new dictionary is same items with incremented reference counter only
rt | COMPS_ObjDict object |
COMPS_Object * comps_objdict_get | ( | COMPS_ObjDict * | rt, |
const char * | key | ||
) |
get item from dictionary for specified key
if there's no such item, return NULL. Item's reference counter will be incremented.
rt | COMPS_ObjDict object |
specified | key |
COMPS_Object * comps_objdict_get_x | ( | COMPS_ObjRTree * | rt, |
const char * | key | ||
) |
get item from dictionary for specified key
if there's no such item, return NULL. Item's reference counter WON'T be incremented.
rt | COMPS_ObjDict object |
specified | key |
COMPS_HSList * comps_objdict_keys | ( | COMPS_ObjDict * | rt | ) |
Return list of keys in dictionary
rt | COMPS_ObjDict object |
COMPS_HSList * comps_objdict_pairs | ( | COMPS_ObjDict * | rt | ) |
Return list of pairs(key-value) in dictionary
rt | COMPS_ObjDict object |
void comps_objdict_set | ( | COMPS_ObjDict * | rt, |
char * | key, | ||
COMPS_Object * | data | ||
) |
set new item to dictionary
if there's already item for specified key in dictionary, old item will be replaced with new item and its reference counter will be decremented. Reference counter of new item will be incremented
rt | COMPS_ObjDict object |
key | key for new item |
data | new item |
void comps_objdict_set_n | ( | COMPS_ObjDict * | rt, |
char * | key, | ||
unsigned int | len, | ||
COMPS_Object * | data | ||
) |
same as comps_objdict_set but with key length limited by argument
rt | COMPS_ObjDict object |
key | key for new item |
len | key length limiter |
data | new item |
void comps_objdict_set_x | ( | COMPS_ObjDict * | rt, |
char * | key, | ||
COMPS_Object * | data | ||
) |
set new item to dictionary
if there's already item for specified key in dictionary, old item will be replaced with new item and its reference counter will be decremented. Reference counter of new items won't be incremented
rt | COMPS_ObjDict object |
key | key for new item |
data | new item |
COMPS_ObjDict * comps_objdict_union | ( | COMPS_ObjDict * | d1, |
COMPS_ObjDict * | d2 | ||
) |
Join two dictionries into one
New dictionary is filled with pairs of first dictionary and then with pairs of second dictionary with skipped items whose keys are already in dictionary
d1 | COMPS_ObjDict object |
d2 | COMPS_ObjDict object |
void comps_objdict_unset | ( | COMPS_ObjDict * | rt, |
const char * | key | ||
) |
remove item from dictionary for specified key
item's reference counter will be decremented
rt | COMPS_ObjDict object |
key | item's key |
COMPS_HSList * comps_objdict_values | ( | COMPS_ObjDict * | rt | ) |
Return list of all values(items) in dictionary
rt | COMPS_ObjDict objecti |
void comps_objdict_values_walk | ( | COMPS_ObjRTree * | rt, |
void * | udata, | ||
void(*)(void *, COMPS_Object *) | walk_f | ||
) |
Apply function for each item in dictionary
Applied function takes user data (udata param) and item as arguments
rt | COMPS_ObjDict object |
udata | user data |
walk_f | applied function |