XMMS2
|
Typedefs | |
typedef void(* | xmmsv_list_foreach_func )(xmmsv_t *value, void *user_data) |
typedef struct xmmsv_list_iter_St | xmmsv_list_iter_t |
Functions | |
int | xmmsv_list_foreach (xmmsv_t *listv, xmmsv_list_foreach_func func, void *user_data) |
Apply a function to each element in the list, in sequential order. More... | |
int | xmmsv_get_list_iter (const xmmsv_t *val, xmmsv_list_iter_t **it) |
Retrieves a list iterator from a list xmmsv_t. More... | |
void | xmmsv_list_iter_explicit_destroy (xmmsv_list_iter_t *it) |
Explicitly free list iterator. More... | |
int | xmmsv_list_iter_entry (xmmsv_list_iter_t *it, xmmsv_t **val) |
Get the element currently pointed at by the iterator. More... | |
int | xmmsv_list_iter_valid (xmmsv_list_iter_t *it) |
Check whether the iterator is valid and points to a valid element. More... | |
void | xmmsv_list_iter_first (xmmsv_list_iter_t *it) |
Rewind the iterator to the start of the list. More... | |
void | xmmsv_list_iter_last (xmmsv_list_iter_t *it) |
Move the iterator to end of the list. More... | |
void | xmmsv_list_iter_next (xmmsv_list_iter_t *it) |
Advance the iterator to the next element in the list. More... | |
void | xmmsv_list_iter_prev (xmmsv_list_iter_t *it) |
Move the iterator to the previous element in the list. More... | |
int | xmmsv_list_iter_seek (xmmsv_list_iter_t *it, int pos) |
Move the iterator to the n-th element in the list. More... | |
int | xmmsv_list_iter_tell (const xmmsv_list_iter_t *it) |
Tell the position of the iterator. More... | |
xmmsv_t * | xmmsv_list_iter_get_parent (const xmmsv_list_iter_t *it) |
Return the parent xmmsv_t of an iterator. More... | |
int | xmmsv_list_iter_set (xmmsv_list_iter_t *it, xmmsv_t *val) |
Replace an element in the list at the position pointed at by the iterator. More... | |
int | xmmsv_list_iter_insert (xmmsv_list_iter_t *it, xmmsv_t *val) |
Insert an element in the list at the position pointed at by the iterator. More... | |
int | xmmsv_list_iter_remove (xmmsv_list_iter_t *it) |
Remove the element in the list at the position pointed at by the iterator. More... | |
int | xmmsv_list_iter_entry_string (xmmsv_list_iter_t *it, const char **val) |
int | xmmsv_list_iter_entry_int32 (xmmsv_list_iter_t *it, int32_t *val) |
int | xmmsv_list_iter_entry_int64 (xmmsv_list_iter_t *it, int64_t *val) |
int | xmmsv_list_iter_entry_float (xmmsv_list_iter_t *it, float *val) |
int | xmmsv_list_iter_entry_coll (xmmsv_list_iter_t *it, xmmsv_t **val) |
int | xmmsv_list_iter_insert_string (xmmsv_list_iter_t *it, const char *val) |
int | xmmsv_list_iter_insert_int (xmmsv_list_iter_t *it, int64_t val) |
int | xmmsv_list_iter_insert_float (xmmsv_list_iter_t *it, float val) |
int | xmmsv_list_iter_insert_coll (xmmsv_list_iter_t *it, xmmsv_t *val) |
typedef void(* xmmsv_list_foreach_func)(xmmsv_t *value, void *user_data) |
typedef struct xmmsv_list_iter_St xmmsv_list_iter_t |
int xmmsv_get_list_iter | ( | const xmmsv_t * | val, |
xmmsv_list_iter_t ** | it | ||
) |
Retrieves a list iterator from a list xmmsv_t.
val | a xmmsv_t containing a list. |
it | An xmmsv_list_iter_t that can be used to access the list data. The iterator will be freed when the value is freed. |
Referenced by xmmsv_coll_add_operand(), xmmsv_coll_add_order_operators(), xmmsv_coll_remove_operand(), xmmsv_list_foreach(), xmmsv_list_has_type(), and xmmsv_list_index_of().
int xmmsv_list_foreach | ( | xmmsv_t * | listv, |
xmmsv_list_foreach_func | func, | ||
void * | user_data | ||
) |
Apply a function to each element in the list, in sequential order.
listv | A xmmsv_t containing a list. |
function | The function to apply to each element. |
user_data | User data passed to the foreach function. |
int xmmsv_list_iter_entry | ( | xmmsv_list_iter_t * | it, |
xmmsv_t ** | val | ||
) |
Get the element currently pointed at by the iterator.
This function does not increase the refcount of the element, the reference is still owned by the list. If iterator does not point on a valid element xmmsv_list_iter_entry returns 0 and leaves val untouched.
it | A xmmsv_list_iter_t. |
val | Pointer set to a borrowed reference to the element pointed at by the iterator. |
Referenced by xmmsv_coll_add_order_operators(), xmmsv_list_foreach(), xmmsv_list_has_type(), xmmsv_list_index_of(), and xmmsv_list_iter_entry_coll().
int xmmsv_list_iter_entry_coll | ( | xmmsv_list_iter_t * | it, |
xmmsv_t ** | val | ||
) |
int xmmsv_list_iter_entry_float | ( | xmmsv_list_iter_t * | it, |
float * | val | ||
) |
int xmmsv_list_iter_entry_int32 | ( | xmmsv_list_iter_t * | it, |
int32_t * | val | ||
) |
int xmmsv_list_iter_entry_int64 | ( | xmmsv_list_iter_t * | it, |
int64_t * | val | ||
) |
int xmmsv_list_iter_entry_string | ( | xmmsv_list_iter_t * | it, |
const char ** | val | ||
) |
void xmmsv_list_iter_explicit_destroy | ( | xmmsv_list_iter_t * | it | ) |
Explicitly free list iterator.
Immediately frees any resources used by this iterator. The iterator is freed automatically when the list is freed, but this function is useful when the list can be long lived.
it | iterator to free |
Referenced by xmmsv_coll_add_operand(), xmmsv_coll_remove_operand(), and xmmsv_list_index_of().
void xmmsv_list_iter_first | ( | xmmsv_list_iter_t * | it | ) |
Rewind the iterator to the start of the list.
it | A xmmsv_list_iter_t. |
xmmsv_t* xmmsv_list_iter_get_parent | ( | const xmmsv_list_iter_t * | it | ) |
Return the parent xmmsv_t of an iterator.
it | A xmmsv_list_iter_t. |
int xmmsv_list_iter_insert | ( | xmmsv_list_iter_t * | it, |
xmmsv_t * | val | ||
) |
Insert an element in the list at the position pointed at by the iterator.
it | A xmmsv_list_iter_t. |
val | The element to insert. |
Referenced by xmmsv_list_iter_insert_coll().
int xmmsv_list_iter_insert_coll | ( | xmmsv_list_iter_t * | it, |
xmmsv_t * | val | ||
) |
int xmmsv_list_iter_insert_float | ( | xmmsv_list_iter_t * | it, |
float | val | ||
) |
int xmmsv_list_iter_insert_int | ( | xmmsv_list_iter_t * | it, |
int64_t | val | ||
) |
int xmmsv_list_iter_insert_string | ( | xmmsv_list_iter_t * | it, |
const char * | val | ||
) |
void xmmsv_list_iter_last | ( | xmmsv_list_iter_t * | it | ) |
Move the iterator to end of the list.
listv | A xmmsv_list_iter_t. |
Referenced by xmmsv_coll_add_order_operators().
void xmmsv_list_iter_next | ( | xmmsv_list_iter_t * | it | ) |
Advance the iterator to the next element in the list.
it | A xmmsv_list_iter_t. |
Referenced by xmmsv_list_foreach(), xmmsv_list_has_type(), and xmmsv_list_index_of().
void xmmsv_list_iter_prev | ( | xmmsv_list_iter_t * | it | ) |
Move the iterator to the previous element in the list.
listv | A xmmsv_list_iter_t. |
Referenced by xmmsv_coll_add_order_operators().
int xmmsv_list_iter_remove | ( | xmmsv_list_iter_t * | it | ) |
Remove the element in the list at the position pointed at by the iterator.
it | A xmmsv_list_iter_t. |
Referenced by xmmsv_coll_remove_operand().
int xmmsv_list_iter_seek | ( | xmmsv_list_iter_t * | it, |
int | pos | ||
) |
Move the iterator to the n-th element in the list.
it | A xmmsv_list_iter_t. |
pos | The position in the list. If negative, start counting from the end (-1 is the last element, etc). |
int xmmsv_list_iter_set | ( | xmmsv_list_iter_t * | it, |
xmmsv_t * | val | ||
) |
Replace an element in the list at the position pointed at by the iterator.
it | A xmmsv_list_iter_t. |
val | The element to insert. |
int xmmsv_list_iter_tell | ( | const xmmsv_list_iter_t * | it | ) |
Tell the position of the iterator.
it | A xmmsv_list_iter_t. |
int xmmsv_list_iter_valid | ( | xmmsv_list_iter_t * | it | ) |
Check whether the iterator is valid and points to a valid element.
it | A xmmsv_list_iter_t. |
Referenced by xmmsv_list_iter_entry().