libonion
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Public Member Functions | Data Fields
onion_dict_t Struct Reference

A 'char *' to 'char *' dictionary. More...

#include <types.h>

Public Member Functions

onion_dictonion_dict_new ()
void onion_dict_set_flags (onion_dict *dict, int flags)
onion_dictonion_dict_dup (onion_dict *dict)
 Creates a duplicate of the dict.
onion_dictonion_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_nodeonion_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_dictonion_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_blockonion_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_dictonion_dict_rget_dict (const onion_dict *dict, const char *key,...)
 Gets a dictionary dict value, recursively.

Data Fields

struct onion_dict_node_troot
int refcount
int(* cmp )(const char *a, const char *b)

Detailed Description

A 'char *' to 'char *' dictionary.

Member Function Documentation

const char * onion_dict_get ( const onion_dict dict,
const char *  key 
)

Field Documentation

int(* onion_dict_t::cmp)(const char *a, const char *b)
int onion_dict_t::refcount
struct onion_dict_node_t* onion_dict_t::root

The documentation for this struct was generated from the following files: