libonion
|
A 'char *' to 'char *' dictionary. More...
#include <types.h>
Public Member Functions | |
onion_dict * | onion_dict_new () |
void | onion_dict_set_flags (onion_dict *dict, int flags) |
onion_dict * | onion_dict_dup (onion_dict *dict) |
Creates a duplicate of the dict. | |
onion_dict * | onion_dict_hard_dup (onion_dict *dict) |
Creates a full duplicate of the dict. | |
void | onion_dict_free (onion_dict *dict) |
Removes the full dict struct from mem. | |
static const onion_dict_node * | onion_dict_find_node (const onion_dict *d, const onion_dict_node *current, const char *key, const onion_dict_node **parent) |
Searchs for a given key, and returns that node and its parent (if parent!=NULL) | |
void | onion_dict_add (onion_dict *dict, const char *key, const void *value, int flags) |
Adds a value in the tree.Flags are or from onion_dict_flags_e, for example OD_DUP_ALL. | |
int | onion_dict_remove (onion_dict *dict, const char *key) |
const char * | onion_dict_get (const onion_dict *dict, const char *key) |
Gets a value. For dicts returns NULL; use onion_dict_get_dict. | |
onion_dict * | onion_dict_get_dict (const onion_dict *dict, const char *key) |
Gets a value, only if its a dict. | |
void | onion_dict_print_dot (const onion_dict *dict) |
void | onion_dict_preorder (const onion_dict *dict, void *func, void *data) |
Executes a function on each element, in preorder by key. | |
int | onion_dict_count (const onion_dict *dict) |
Counts elements. | |
void | onion_dict_lock_read (const onion_dict *dict) |
void | onion_dict_lock_write (onion_dict *dict) |
Do a read lock. Several can lock for reading, but only can be writing. | |
void | onion_dict_unlock (onion_dict *dict) |
Free latest lock be it read or write. | |
onion_block * | onion_dict_to_json (onion_dict *dict) |
Converts a dict to a json string. | |
const char * | onion_dict_rget (const onion_dict *dict, const char *key,...) |
Gets a dictionary string value, recursively. | |
onion_dict * | onion_dict_rget_dict (const onion_dict *dict, const char *key,...) |
Gets a dictionary dict value, recursively. |
Data Fields | |
struct onion_dict_node_t * | root |
int | refcount |
int(* | cmp )(const char *a, const char *b) |
A 'char *' to 'char *' dictionary.
const char * onion_dict_get | ( | const onion_dict * | dict, |
const char * | key | ||
) |
Gets a value. For dicts returns NULL; use onion_dict_get_dict.
References onion_dict_node_t::data, OD_DICT, onion_dict_find_node(), and root.
Referenced by onion_dict_rget(), onion_mime_get(), onion_request_t::onion_request_get_cookie(), onion_request_t::onion_request_get_file(), onion_request_t::onion_request_get_header(), onion_request_t::onion_request_get_language_code(), onion_request_t::onion_request_get_post(), onion_request_t::onion_request_get_query(), onion_request_t::onion_request_get_session(), and onion_request_t::onion_request_guess_session_id().
int(* onion_dict_t::cmp)(const char *a, const char *b) |
Referenced by onion_dict_find_node(), onion_dict_new(), and onion_dict_set_flags().
int onion_dict_t::refcount |
Referenced by onion_dict_dup(), onion_dict_free(), and onion_dict_new().
struct onion_dict_node_t* onion_dict_t::root |