XMMS2
Modules | Functions
Dictionaries
The type xmmsv_t

Modules

 Iteration

Functions

xmmsv_txmmsv_new_dict (void)
 Allocates a new dict xmmsv_t.
int xmmsv_dict_get (xmmsv_t *dictv, const char *key, xmmsv_t **val)
 Get the element corresponding to the given key in the dict xmmsv_t (if it exists).
int xmmsv_dict_set (xmmsv_t *dictv, const char *key, xmmsv_t *val)
 Insert an element under the given key in the dict xmmsv_t.
int xmmsv_dict_remove (xmmsv_t *dictv, const char *key)
 Remove the element corresponding to a given key in the dict

xmmsv_t (if it exists).


int xmmsv_dict_clear (xmmsv_t *dictv)
 Empty the dict of all its elements.
int xmmsv_dict_get_size (xmmsv_t *dictv)
 Return the size of the dict.
int xmmsv_dict_has_key (xmmsv_t *dictv, const char *key)
int xmmsv_dict_entry_get_string (xmmsv_t *val, const char *key, const char **r)
int xmmsv_dict_entry_get_int (xmmsv_t *val, const char *key, int32_t *r)
int xmmsv_dict_entry_get_coll (xmmsv_t *val, const char *key, xmmsv_coll_t **coll)
int xmmsv_dict_set_string (xmmsv_t *val, const char *key, const char *el)
int xmmsv_dict_set_int (xmmsv_t *val, const char *key, int32_t el)
int xmmsv_dict_set_coll (xmmsv_t *val, const char *key, xmmsv_coll_t *el)
xmmsv_type_t xmmsv_dict_entry_get_type (xmmsv_t *val, const char *key)
 Gets the type of a dict entry.

Function Documentation

int xmmsv_dict_clear ( xmmsv_t dictv)

Empty the dict of all its elements.

Parameters:
dictvA xmmsv_t containing a dict.
Returns:
1 upon success otherwise 0

Definition at line 1833 of file value.c.

int xmmsv_dict_entry_get_coll ( xmmsv_t val,
const char *  key,
xmmsv_coll_t **  coll 
)
int xmmsv_dict_entry_get_int ( xmmsv_t val,
const char *  key,
int32_t *  r 
)
int xmmsv_dict_entry_get_string ( xmmsv_t val,
const char *  key,
const char **  r 
)
xmmsv_type_t xmmsv_dict_entry_get_type ( xmmsv_t val,
const char *  key 
)

Gets the type of a dict entry.

Parameters:
valA xmmsv_t containing a dict.
keyThe key in the dict.
Returns:
The type of the entry or XMMSV_TYPE_NONE if something goes wrong.

Definition at line 508 of file value.c.

int xmmsv_dict_get ( xmmsv_t dictv,
const char *  key,
xmmsv_t **  val 
)

Get the element corresponding to the given key in the dict xmmsv_t (if it exists).

This function does not increase the refcount of the element, the reference is still owned by the dict.

Parameters:
dictvA xmmsv_t containing a dict.
keyThe key in the dict.
valPointer set to a borrowed reference to the element corresponding to the given key in the dict.
Returns:
1 upon success otherwise 0

Definition at line 1717 of file value.c.

Referenced by xmms_collection_query_ids(), xmmsv_dict_entry_get_type(), and xmmsv_dict_has_key().

int xmmsv_dict_get_size ( xmmsv_t dictv)

Return the size of the dict.

Parameters:
dictvThe xmmsv_t containing the dict.
Returns:
The size of the dict, or -1 if dict is invalid.

Definition at line 1882 of file value.c.

int xmmsv_dict_has_key ( xmmsv_t dictv,
const char *  key 
)

Definition at line 2492 of file value.c.

int xmmsv_dict_remove ( xmmsv_t dictv,
const char *  key 
)

Remove the element corresponding to a given key in the dict

xmmsv_t (if it exists).

Parameters:
dictvA xmmsv_t containing a dict.
keyThe key in the dict.
Returns:
1 upon success otherwise 0

Definition at line 1803 of file value.c.

Referenced by xmmsv_coll_attribute_remove().

int xmmsv_dict_set ( xmmsv_t dictv,
const char *  key,
xmmsv_t val 
)

Insert an element under the given key in the dict xmmsv_t.

If the key already referenced an element, that element is unref'd and replaced by the new one.

Parameters:
dictvA xmmsv_t containing a dict.
keyThe key in the dict.
valThe new element to insert in the dict.
Returns:
1 upon success otherwise 0

Definition at line 1752 of file value.c.

Referenced by xmms_sqlite_query_table(), xmms_xform_browse_add_entry_property(), xmmsv_build_dict(), xmmsv_coll_attribute_set(), and xmmsv_propdict_to_dict().

int xmmsv_dict_set_coll ( xmmsv_t val,
const char *  key,
xmmsv_coll_t el 
)
int xmmsv_dict_set_int ( xmmsv_t val,
const char *  key,
int32_t  el 
)
int xmmsv_dict_set_string ( xmmsv_t val,
const char *  key,
const char *  el 
)
xmmsv_t* xmmsv_new_dict ( void  )

Allocates a new dict xmmsv_t.

Returns:
The new xmmsv_t. Must be unreferenced with

xmmsv_unref.

Definition at line 268 of file value.c.

Referenced by xmms_sqlite_query_table(), xmms_xform_browse_add_entry(), xmmsv_build_dict(), xmmsv_coll_new(), and xmmsv_propdict_to_dict().