XMMS2
Modules | Functions

Modules

 Iteration
 

Functions

xmmsv_txmmsv_new_list (void)
 Allocates a new list xmmsv_t. More...
 
int xmmsv_list_get (xmmsv_t *listv, int pos, xmmsv_t **val)
 Get the element at the given position in the list xmmsv_t. More...
 
int xmmsv_list_set (xmmsv_t *listv, int pos, xmmsv_t *val)
 Set the element at the given position in the list xmmsv_t. More...
 
int xmmsv_list_append (xmmsv_t *listv, xmmsv_t *val)
 Append an element to the end of the list xmmsv_t. More...
 
int xmmsv_list_insert (xmmsv_t *listv, int pos, xmmsv_t *val)
 Insert an element at the given position in the list xmmsv_t. More...
 
int xmmsv_list_remove (xmmsv_t *listv, int pos)
 Remove the element at the given position from the list xmmsv_t. More...
 
int xmmsv_list_move (xmmsv_t *listv, int old_pos, int new_pos)
 Move the element from position #old to position #new. More...
 
int xmmsv_list_clear (xmmsv_t *listv)
 Empty the list from all its elements. More...
 
int xmmsv_list_get_size (xmmsv_t *listv)
 Return the size of the list. More...
 
int xmmsv_list_restrict_type (xmmsv_t *listv, xmmsv_type_t type)
 
int xmmsv_list_get_string (xmmsv_t *v, int pos, const char **val)
 
int xmmsv_list_get_int (xmmsv_t *v, int pos, int32_t *val)
 
int xmmsv_list_get_coll (xmmsv_t *v, int pos, xmmsv_coll_t **val)
 
int xmmsv_list_set_string (xmmsv_t *v, int pos, const char *val)
 
int xmmsv_list_set_int (xmmsv_t *v, int pos, int32_t val)
 
int xmmsv_list_set_coll (xmmsv_t *v, int pos, xmmsv_coll_t *val)
 
int xmmsv_list_insert_string (xmmsv_t *v, int pos, const char *val)
 
int xmmsv_list_insert_int (xmmsv_t *v, int pos, int32_t val)
 
int xmmsv_list_insert_coll (xmmsv_t *v, int pos, xmmsv_coll_t *val)
 
int xmmsv_list_append_string (xmmsv_t *v, const char *val)
 
int xmmsv_list_append_int (xmmsv_t *v, int32_t val)
 
int xmmsv_list_append_coll (xmmsv_t *v, xmmsv_coll_t *val)
 

Detailed Description

Function Documentation

◆ xmmsv_list_append()

int xmmsv_list_append ( xmmsv_t listv,
xmmsv_t val 
)

Append an element to the end of the list xmmsv_t.

The list will hold a reference to the element until it's removed.

Parameters
listvA xmmsv_t containing a list.
valThe element to append.
Returns
1 upon success otherwise 0

Definition at line 1340 of file value.c.

Referenced by xmms_collection_get_random_media(), xmms_collection_query_ids(), xmmsv_build_list_va(), and xmmsv_make_stringlist().

◆ xmmsv_list_append_coll()

int xmmsv_list_append_coll ( xmmsv_t v,
xmmsv_coll_t val 
)

◆ xmmsv_list_append_int()

int xmmsv_list_append_int ( xmmsv_t v,
int32_t  val 
)

◆ xmmsv_list_append_string()

int xmmsv_list_append_string ( xmmsv_t v,
const char *  val 
)

◆ xmmsv_list_clear()

int xmmsv_list_clear ( xmmsv_t listv)

Empty the list from all its elements.

Parameters
listvA xmmsv_t containing a list.
Returns
1 upon success otherwise 0

Definition at line 1356 of file value.c.

Referenced by xmmsv_coll_idlist_clear(), and xmmsv_coll_set_idlist().

◆ xmmsv_list_get()

int xmmsv_list_get ( xmmsv_t listv,
int  pos,
xmmsv_t **  val 
)

Get the element at the given position in the list xmmsv_t.

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

Parameters
listvA xmmsv_t containing a list.
posThe position in the list. If negative, start counting from the end (-1 is the last element, etc).
valPointer set to a borrowed reference to the element at the given position in the list.
Returns
1 upon success otherwise 0

Definition at line 1218 of file value.c.

◆ xmmsv_list_get_coll()

int xmmsv_list_get_coll ( xmmsv_t v,
int  pos,
xmmsv_coll_t **  val 
)

◆ xmmsv_list_get_int()

int xmmsv_list_get_int ( xmmsv_t v,
int  pos,
int32_t *  val 
)

◆ xmmsv_list_get_size()

int xmmsv_list_get_size ( xmmsv_t listv)

Return the size of the list.

Parameters
listvThe xmmsv_t containing the list.
Returns
The size of the list, or -1 if listv is invalid.

Definition at line 1403 of file value.c.

Referenced by xmmsv_coll_idlist_get_size().

◆ xmmsv_list_get_string()

int xmmsv_list_get_string ( xmmsv_t v,
int  pos,
const char **  val 
)

◆ xmmsv_list_insert()

int xmmsv_list_insert ( xmmsv_t listv,
int  pos,
xmmsv_t val 
)

Insert an element at the given position in the list xmmsv_t.

The list will hold a reference to the element until it's removed.

Parameters
listvA xmmsv_t containing a list.
posThe position in the list. If negative, start counting from the end (-1 is the last element, etc).
valThe element to insert.
Returns
1 upon success otherwise 0

Definition at line 1282 of file value.c.

◆ xmmsv_list_insert_coll()

int xmmsv_list_insert_coll ( xmmsv_t v,
int  pos,
xmmsv_coll_t val 
)

◆ xmmsv_list_insert_int()

int xmmsv_list_insert_int ( xmmsv_t v,
int  pos,
int32_t  val 
)

◆ xmmsv_list_insert_string()

int xmmsv_list_insert_string ( xmmsv_t v,
int  pos,
const char *  val 
)

◆ xmmsv_list_move()

int xmmsv_list_move ( xmmsv_t listv,
int  old_pos,
int  new_pos 
)

Move the element from position #old to position #new.

xmmsv_list_iter_t's remain pointing at their element (which might or might not be at a different position).

Parameters
listvA xmmsv_t containing a list
oldThe original position in the list. If negative, start counting from the end (-1 is the last element, etc.)
newThe new position in the list. If negative start counting from the end (-1 is the last element, etc.) For the sake of counting the element to be moved is still at its old position.
Returns
1 upon success otherwise 0

Definition at line 1323 of file value.c.

Referenced by xmmsv_coll_idlist_move().

◆ xmmsv_list_remove()

int xmmsv_list_remove ( xmmsv_t listv,
int  pos 
)

Remove the element at the given position from the list xmmsv_t.

Parameters
listvA xmmsv_t containing a list.
posThe position in the list. If negative, start counting from the end (-1 is the last element, etc).
Returns
1 upon success otherwise 0

Definition at line 1300 of file value.c.

Referenced by xmmsv_coll_idlist_remove().

◆ xmmsv_list_restrict_type()

int xmmsv_list_restrict_type ( xmmsv_t listv,
xmmsv_type_t  type 
)

Definition at line 1413 of file value.c.

Referenced by xmmsv_coll_new().

◆ xmmsv_list_set()

int xmmsv_list_set ( xmmsv_t listv,
int  pos,
xmmsv_t val 
)

Set the element at the given position in the list xmmsv_t.

Parameters
listvA xmmsv_t containing a list.
posThe position in the list. If negative, start counting from the end (-1 is the last element, etc).
valThe element to put at the given position in the list.
Returns
1 upon success otherwise 0

Definition at line 1249 of file value.c.

◆ xmmsv_list_set_coll()

int xmmsv_list_set_coll ( xmmsv_t v,
int  pos,
xmmsv_coll_t val 
)

◆ xmmsv_list_set_int()

int xmmsv_list_set_int ( xmmsv_t v,
int  pos,
int32_t  val 
)

◆ xmmsv_list_set_string()

int xmmsv_list_set_string ( xmmsv_t v,
int  pos,
const char *  val 
)

◆ xmmsv_new_list()

xmmsv_t* xmmsv_new_list ( void  )

Allocates a new list xmmsv_t.

Returns
The new xmmsv_t. Must be unreferenced with xmmsv_unref.

Definition at line 250 of file value.c.

Referenced by xmms_collection_get_random_media(), xmms_collection_query_ids(), xmmsv_build_list_va(), xmmsv_coll_new(), and xmmsv_make_stringlist().