#include <cybergarage/typedef.h>
#include <cybergarage/util/clist.h>
#include <cybergarage/util/cstring.h>
Data Structures | |
struct | _CgDictionary |
The generic wrapper struct for CyberLinkC's dictionarys. More... | |
Defines | |
#define | cg_dictionary_element_setkey(dirElem, name) cg_string_setvalue(dirElem->key, name) |
#define | cg_dictionary_element_getkey(dirElem) cg_string_getvalue(dirElem->key) |
#define | cg_dictionary_element_setvalue(dirElem, val) cg_string_setvalue(dirElem->value, val) |
#define | cg_dictionary_element_getvalue(dirElem) cg_string_getvalue(dirElem->value) |
#define | cg_dictionary_element_next(dirElem) (CgDictionaryElement *)cg_list_next((CgList *)dirElem) |
#define | cg_dictionary_element_remove(dirElem) cg_list_remove((CgList *)dirElem) |
#define | cg_dictionary_clear(dir) cg_list_clear((CgList *)dir, (CG_LIST_DESTRUCTORFUNC)cg_dictionary_element_delete) |
#define | cg_dictionary_size(dir) cg_list_size((CgList *)dir) |
#define | cg_dictionary_gets(dir) (CgDictionaryElement *)cg_list_next((CgList *)dir) |
#define | cg_dictionary_add(dir, dirElem) cg_list_add((CgList *)dir, (CgList *)dirElem) |
#define | cg_dictionary_remove(dirElem) cg_list_remove((CgList *)dirElem) |
Typedefs | |
typedef struct _CgDictionary | CgDictionaryElement |
The generic wrapper struct for CyberLinkC's dictionarys. | |
typedef struct _CgDictionary | CgDictionary |
Functions | |
CgDictionaryElement * | cg_dictionary_element_new () |
BOOL | cg_dictionary_element_delete (CgDictionaryElement *dirElem) |
CgDictionary * | cg_dictionary_new () |
void | cg_dictionary_delete (CgDictionary *dir) |
CgDictionaryElement * | cg_dictionary_get (CgDictionary *dir, char *key) |
void | cg_dictionary_setvalue (CgDictionary *dir, char *key, char *value) |
char * | cg_dictionary_getvalue (CgDictionary *dir, char *key) |
Add a dictionary into a dictionary list
dir | The dictionary list in question | |
dirElem | The dictionary to add to the list |
#define cg_dictionary_clear | ( | dir | ) | cg_list_clear((CgList *)dir, (CG_LIST_DESTRUCTORFUNC)cg_dictionary_element_delete) |
Clear the contents of a dictionary list
dir | Dictionary list in question |
#define cg_dictionary_element_getkey | ( | dirElem | ) | cg_string_getvalue(dirElem->key) |
Get a key
dirElem | Dictionary struct |
#define cg_dictionary_element_getvalue | ( | dirElem | ) | cg_string_getvalue(dirElem->value) |
Get a value
dirElem | Dictionary struct |
#define cg_dictionary_element_next | ( | dirElem | ) | (CgDictionaryElement *)cg_list_next((CgList *)dirElem) |
#define cg_dictionary_element_remove | ( | dirElem | ) | cg_list_remove((CgList *)dirElem) |
#define cg_dictionary_element_setkey | ( | dirElem, | |||
name | ) | cg_string_setvalue(dirElem->key, name) |
Set a key
dirElem | Dictionary struct | |
name | String to set |
#define cg_dictionary_element_setvalue | ( | dirElem, | |||
val | ) | cg_string_setvalue(dirElem->value, val) |
Set a value
dirElem | Dictionary struct | |
value | String to set |
#define cg_dictionary_gets | ( | dir | ) | (CgDictionaryElement *)cg_list_next((CgList *)dir) |
Get the first actual item from a dictionary list to use as an iterator
dir | The dictionary list in question |
#define cg_dictionary_remove | ( | dirElem | ) | cg_list_remove((CgList *)dirElem) |
Remove a dictionary from dictionary list
dirElem | The dictionary to be removed |
#define cg_dictionary_size | ( | dir | ) | cg_list_size((CgList *)dir) |
Get the size of a dictionary list
dir | The dictionary list in question |
typedef struct _CgDictionary CgDictionary |
typedef struct _CgDictionary CgDictionaryElement |
The generic wrapper struct for CyberLinkC's dictionarys.
This wrapper has been created to enable 100% code compatibility between different platforms (Linux, Win32 etc..)
void cg_dictionary_delete | ( | CgDictionary * | dir | ) |
Destroy a dictionary list
dir | The dictionary list in question |
BOOL cg_dictionary_element_delete | ( | CgDictionaryElement * | dirElem | ) |
Destroy a dictionary.
dirElem | Dictionary to destroy |
CgDictionaryElement* cg_dictionary_element_new | ( | ) |
Create a new dictionary
CgDictionaryElement* cg_dictionary_get | ( | CgDictionary * | dir, | |
char * | key | |||
) |
Get a element of the specified key
dir | The dictionary list in question | |
key | Name to search. |
char* cg_dictionary_getvalue | ( | CgDictionary * | dir, | |
char * | key | |||
) |
Get a value of the specified key
dir | The dictionary list in question | |
key | Name to search. |
CgDictionary* cg_dictionary_new | ( | ) |
Create a new dictionary list
void cg_dictionary_setvalue | ( | CgDictionary * | dir, | |
char * | key, | |||
char * | value | |||
) |
Set a new element into a dictionary
dir | The dictionary list in question | |
key | Name to set. | |
value | Value to set. |