XMMS2
|
Typedefs | |
typedef void(* | xmmsv_dict_foreach_func )(const char *key, xmmsv_t *value, void *user_data) |
typedef struct xmmsv_dict_iter_St | xmmsv_dict_iter_t |
Functions | |
int | xmmsv_dict_foreach (xmmsv_t *dictv, xmmsv_dict_foreach_func func, void *user_data) |
Apply a function to each key-element pair in the list. More... | |
int | xmmsv_get_dict_iter (const xmmsv_t *val, xmmsv_dict_iter_t **it) |
Retrieves a dict iterator from a dict xmmsv_t. More... | |
void | xmmsv_dict_iter_explicit_destroy (xmmsv_dict_iter_t *it) |
Explicitly free dict iterator. More... | |
int | xmmsv_dict_iter_pair (xmmsv_dict_iter_t *it, const char **key, xmmsv_t **val) |
Get the key-element pair currently pointed at by the iterator. More... | |
int | xmmsv_dict_iter_valid (xmmsv_dict_iter_t *it) |
Check whether the iterator is valid and points to a valid pair. More... | |
void | xmmsv_dict_iter_first (xmmsv_dict_iter_t *it) |
Rewind the iterator to the start of the dict. More... | |
void | xmmsv_dict_iter_next (xmmsv_dict_iter_t *it) |
Advance the iterator to the next pair in the dict. More... | |
int | xmmsv_dict_iter_find (xmmsv_dict_iter_t *it, const char *key) |
Move the iterator to the pair with the given key (if it exists) or move it to the position where the key would have to be put (if it doesn't exist yet). More... | |
int | xmmsv_dict_iter_set (xmmsv_dict_iter_t *it, xmmsv_t *val) |
Replace the element of the pair currently pointed to by the iterator. More... | |
int | xmmsv_dict_iter_remove (xmmsv_dict_iter_t *it) |
Remove the pair in the dict pointed at by the iterator. More... | |
int | xmmsv_dict_iter_pair_string (xmmsv_dict_iter_t *it, const char **key, const char **r) |
int | xmmsv_dict_iter_pair_int32 (xmmsv_dict_iter_t *it, const char **key, int32_t *r) |
int | xmmsv_dict_iter_pair_int64 (xmmsv_dict_iter_t *it, const char **key, int64_t *r) |
int | xmmsv_dict_iter_pair_float (xmmsv_dict_iter_t *it, const char **key, float *r) |
int | xmmsv_dict_iter_pair_coll (xmmsv_dict_iter_t *it, const char **key, xmmsv_t **r) |
int | xmmsv_dict_iter_set_string (xmmsv_dict_iter_t *it, const char *elem) |
int | xmmsv_dict_iter_set_int (xmmsv_dict_iter_t *it, int64_t elem) |
int | xmmsv_dict_iter_set_float (xmmsv_dict_iter_t *it, float elem) |
int | xmmsv_dict_iter_set_coll (xmmsv_dict_iter_t *it, xmmsv_t *elem) |
typedef void(* xmmsv_dict_foreach_func)(const char *key, xmmsv_t *value, void *user_data) |
typedef struct xmmsv_dict_iter_St xmmsv_dict_iter_t |
int xmmsv_dict_foreach | ( | xmmsv_t * | dictv, |
xmmsv_dict_foreach_func | func, | ||
void * | user_data | ||
) |
Apply a function to each key-element pair in the list.
No particular order is assumed.
dictv | A xmmsv_t containing a dict. |
function | The function to apply to each key-element pair. |
user_data | User data passed to the foreach function. |
Referenced by xmms_collection_restore(), and xmmsv_encode_url_full().
void xmmsv_dict_iter_explicit_destroy | ( | xmmsv_dict_iter_t * | it | ) |
Explicitly free dict iterator.
Immediately frees any resources used by this iterator. The iterator is freed automatically when the dict is freed, but this function is useful when the dict can be long lived.
it | iterator to free |
Referenced by xmmsv_dict_keys(), and xmmsv_dict_values().
int xmmsv_dict_iter_find | ( | xmmsv_dict_iter_t * | it, |
const char * | key | ||
) |
Move the iterator to the pair with the given key (if it exists) or move it to the position where the key would have to be put (if it doesn't exist yet).
it | A xmmsv_dict_iter_t. |
key | The key to seek for. |
Referenced by xmmsv_dict_format().
void xmmsv_dict_iter_first | ( | xmmsv_dict_iter_t * | it | ) |
Rewind the iterator to the start of the dict.
it | A xmmsv_dict_iter_t. |
Referenced by xmmsv_dict_iter_find().
void xmmsv_dict_iter_next | ( | xmmsv_dict_iter_t * | it | ) |
Advance the iterator to the next pair in the dict.
it | A xmmsv_dict_iter_t. |
Referenced by xmmsv_dict_foreach(), xmmsv_dict_iter_find(), xmmsv_dict_iter_remove(), xmmsv_dict_keys(), xmmsv_dict_values(), xmmsv_encode_url_full(), and xmmsv_propdict_to_dict().
int xmmsv_dict_iter_pair | ( | xmmsv_dict_iter_t * | it, |
const char ** | key, | ||
xmmsv_t ** | val | ||
) |
Get the key-element pair currently pointed at by the iterator.
This function does not increase the refcount of the element, the reference is still owned by the dict.
it | A xmmsv_dict_iter_t. |
key | Pointer set to the key pointed at by the iterator. |
val | Pointer set to a borrowed reference to the element pointed at by the iterator. |
Referenced by xmmsv_dict_foreach(), xmmsv_dict_format(), xmmsv_dict_iter_find(), xmmsv_dict_iter_pair_coll(), xmmsv_dict_keys(), xmmsv_dict_values(), xmmsv_encode_url_full(), and xmmsv_propdict_to_dict().
int xmmsv_dict_iter_pair_coll | ( | xmmsv_dict_iter_t * | it, |
const char ** | key, | ||
xmmsv_t ** | r | ||
) |
int xmmsv_dict_iter_pair_float | ( | xmmsv_dict_iter_t * | it, |
const char ** | key, | ||
float * | r | ||
) |
int xmmsv_dict_iter_pair_int32 | ( | xmmsv_dict_iter_t * | it, |
const char ** | key, | ||
int32_t * | r | ||
) |
int xmmsv_dict_iter_pair_int64 | ( | xmmsv_dict_iter_t * | it, |
const char ** | key, | ||
int64_t * | r | ||
) |
int xmmsv_dict_iter_pair_string | ( | xmmsv_dict_iter_t * | it, |
const char ** | key, | ||
const char ** | r | ||
) |
int xmmsv_dict_iter_remove | ( | xmmsv_dict_iter_t * | it | ) |
Remove the pair in the dict pointed at by the iterator.
it | A xmmsv_dict_iter_t. |
int xmmsv_dict_iter_set | ( | xmmsv_dict_iter_t * | it, |
xmmsv_t * | val | ||
) |
Replace the element of the pair currently pointed to by the iterator.
it | A xmmsv_dict_iter_t. |
val | The element to set in the pair. |
Referenced by xmmsv_dict_iter_set_coll().
int xmmsv_dict_iter_set_coll | ( | xmmsv_dict_iter_t * | it, |
xmmsv_t * | elem | ||
) |
int xmmsv_dict_iter_set_float | ( | xmmsv_dict_iter_t * | it, |
float | elem | ||
) |
int xmmsv_dict_iter_set_int | ( | xmmsv_dict_iter_t * | it, |
int64_t | elem | ||
) |
int xmmsv_dict_iter_set_string | ( | xmmsv_dict_iter_t * | it, |
const char * | elem | ||
) |
int xmmsv_dict_iter_valid | ( | xmmsv_dict_iter_t * | it | ) |
Check whether the iterator is valid and points to a valid pair.
it | A xmmsv_dict_iter_t. |
Referenced by xmmsv_dict_iter_find(), xmmsv_dict_iter_pair(), xmmsv_dict_iter_remove(), and xmmsv_dict_iter_set().
int xmmsv_get_dict_iter | ( | const xmmsv_t * | val, |
xmmsv_dict_iter_t ** | it | ||
) |
Retrieves a dict iterator from a dict xmmsv_t.
val | a xmmsv_t containing a dict. |
it | An xmmsv_dict_iter_t that can be used to access the dict data. The iterator will be freed when the value is freed. |
Referenced by xmmsv_dict_foreach(), xmmsv_dict_format(), xmmsv_dict_keys(), xmmsv_dict_values(), xmmsv_encode_url_full(), and xmmsv_propdict_to_dict().