mediastreamer2 5.2.0
Functions
Ms_list

Functions

bctbx_list_t * ms_list_append (bctbx_list_t *list, void *data)
 
bctbx_list_t * ms_list_append_link (bctbx_list_t *list, bctbx_list_t *new_elem)
 
bctbx_list_t * ms_list_prepend (bctbx_list_t *list, void *data)
 
bctbx_list_t * ms_list_free (bctbx_list_t *list)
 
bctbx_list_t * ms_list_free_with_data (bctbx_list_t *list, void(*freefunc)(void *))
 
bctbx_list_t * ms_list_concat (bctbx_list_t *first, bctbx_list_t *second)
 
bctbx_list_t * ms_list_remove (bctbx_list_t *list, void *data)
 
bctbx_list_t * ms_list_remove_custom (bctbx_list_t *list, MSCompareFunc compare_func, const void *user_data)
 
int ms_list_size (const bctbx_list_t *list)
 
void ms_list_for_each (const bctbx_list_t *list, MSIterateFunc iterate_func)
 
void ms_list_for_each2 (const bctbx_list_t *list, MSIterate2Func iterate_func, void *user_data)
 
void ms_list_for_each3 (const bctbx_list_t *list, MSIterate3Func iterate_func, void *user_data, void *factory)
 
bctbx_list_t * ms_list_remove_link (bctbx_list_t *list, bctbx_list_t *elem)
 
bctbx_list_t * ms_list_find (bctbx_list_t *list, void *data)
 
bctbx_list_t * ms_list_find_custom (bctbx_list_t *list, MSCompareFunc compare_func, const void *user_data)
 
void * ms_list_nth_data (const bctbx_list_t *list, int index)
 
int ms_list_position (const bctbx_list_t *list, bctbx_list_t *elem)
 
int ms_list_index (const bctbx_list_t *list, void *data)
 
bctbx_list_t * ms_list_insert_sorted (bctbx_list_t *list, void *data, MSCompareFunc compare_func)
 
bctbx_list_t * ms_list_insert (bctbx_list_t *list, bctbx_list_t *before, void *data)
 
bctbx_list_t * ms_list_copy (const bctbx_list_t *list)
 
bctbx_list_t * ms_list_copy_with_data (const bctbx_list_t *list, void *(*copyfunc)(void *))
 
bctbx_list_t * ms_list_next (const bctbx_list_t *list)
 

Detailed Description

Function Documentation

◆ ms_list_append()

bctbx_list_t * ms_list_append ( bctbx_list_t *  list,
void *  data 
)

Inserts a new element containing data to the end of a given list

Parameters
listlist where data should be added. If NULL, a new list will be created.
datadata to insert into the list
Returns
first element of the list
Deprecated:
Use bctbx_list_append() instead

◆ ms_list_append_link()

bctbx_list_t * ms_list_append_link ( bctbx_list_t *  list,
bctbx_list_t *  new_elem 
)

Inserts given element to the end of a given list

Parameters
listlist where data should be added. If NULL, a new list will be created.
new_elemelement to append
Returns
first element of the list
Deprecated:
Use bctbx_list_append_link() instead

◆ ms_list_concat()

bctbx_list_t * ms_list_concat ( bctbx_list_t *  first,
bctbx_list_t *  second 
)

Concatenates second list to the end of first list

Parameters
firstFirst list
secondSecond list to append at the end of first list.
Returns
first element of the merged list
Deprecated:
Use bctbx_list_concat() instead

◆ ms_list_copy()

bctbx_list_t * ms_list_copy ( const bctbx_list_t *  list)

Copies a list in another one, duplicating elements but not data

Parameters
listlist to copy
Returns
Newly created list
Deprecated:
Use bctbx_list_copy() instead

◆ ms_list_copy_with_data()

bctbx_list_t * ms_list_copy_with_data ( const bctbx_list_t *  list,
void *(*)(void *)  copyfunc 
)

Copies a list in another one, duplicating elements according to the given function

Parameters
listlist to copy
copyfuncfunction to invoke on each element which will return the new list data value
Returns
Newly created list
Deprecated:
Use bctbx_list_copy_with_data() instead

◆ ms_list_find()

bctbx_list_t * ms_list_find ( bctbx_list_t *  list,
void *  data 
)

Finds first element containing data in the given list.

Parameters
listList in which element must be found
datadata to find
Returns
element containing data, or NULL if not found
Deprecated:
Use bctbx_list_find() instead

◆ ms_list_find_custom()

bctbx_list_t * ms_list_find_custom ( bctbx_list_t *  list,
MSCompareFunc  compare_func,
const void *  user_data 
)

Finds first element according to the given predicate function

Parameters
listList in which element must be found
compare_funcFunction to invoke on each element. If it returns TRUE, the given element will be returned.
user_dataUser data to pass to compare_func function
Returns
Element matching the predicate, or NULL if none is found.
Deprecated:
Use bctbx_list_find_custom() instead

◆ ms_list_for_each()

void ms_list_for_each ( const bctbx_list_t *  list,
MSIterateFunc  iterate_func 
)

Invoke function on each element of the list

Parameters
listList object
iterate_funcFunction to invoke on each element.
Deprecated:
Use bctbx_list_for_each() instead

◆ ms_list_for_each2()

void ms_list_for_each2 ( const bctbx_list_t *  list,
MSIterate2Func  iterate_func,
void *  user_data 
)

Invoke function on each element of the list

Parameters
listList object
iterate_funcFunction to invoke on each element.
user_dataUser data to pass to iterate_func function.
Deprecated:
Use bctbx_list_for_each2() instead

◆ ms_list_free()

bctbx_list_t * ms_list_free ( bctbx_list_t *  list)

Frees all elements of a given list Note that data contained in each element will not be freed. If you need to clean them, consider using @ms_list_free_with_data

Parameters
listobject to free.
Returns
NULL
Deprecated:
Use bctbx_list_free() instead

◆ ms_list_free_with_data()

bctbx_list_t * ms_list_free_with_data ( bctbx_list_t *  list,
void(*)(void *)  freefunc 
)

Frees all elements of a given list after having called freefunc on each element

Parameters
listobject to free.
freefuncfunction to invoke on each element data before destroying the element
Returns
NULL
Deprecated:
Use bctbx_list_free_with_data() instead

◆ ms_list_index()

int ms_list_index ( const bctbx_list_t *  list,
void *  data 
)

Returns the index of the first element containing data

Parameters
listList object
dataData to search for.
Returns
Index of the element containing data. -1 if not found.
Deprecated:
Use bctbx_list_index() instead

◆ ms_list_insert()

bctbx_list_t * ms_list_insert ( bctbx_list_t *  list,
bctbx_list_t *  before,
void *  data 
)

Inserts a new element containing data before the given element

Parameters
listlist where data should be added. If NULL, a new list will be created.
beforeelement parent to the one we will insert.
datadata to insert into the list
Returns
first element of the modified list.
Deprecated:
Use bctbx_list_insert() instead

◆ ms_list_insert_sorted()

bctbx_list_t * ms_list_insert_sorted ( bctbx_list_t *  list,
void *  data,
MSCompareFunc  compare_func 
)

Inserts a new element containing data at the place given by compare_func

Parameters
listlist where data should be added. If NULL, a new list will be created.
datadata to insert into the list
compare_funcfunction determining where should the new element be placed
Returns
first element of the list.
Deprecated:
Use bctbx_list_insert_sorted() instead

◆ ms_list_next()

bctbx_list_t * ms_list_next ( const bctbx_list_t *  list)
Deprecated:
Use bctbx_list_next() instead

◆ ms_list_nth_data()

void * ms_list_nth_data ( const bctbx_list_t *  list,
int  index 
)

Returns the nth element data of the list

Parameters
listList object
indexdata index which must be returned.
Returns
Element at the given index. NULL if index is invalid (negative or greater or equal to ms_list_size).
Deprecated:
Use bctbx_list_nth_data() instead

◆ ms_list_position()

int ms_list_position ( const bctbx_list_t *  list,
bctbx_list_t *  elem 
)

Returns the index of the given element

Parameters
listList object
elemElement to search for.
Returns
Index of the given element. -1 if not found.
Deprecated:
Use bctbx_list_position() instead

◆ ms_list_prepend()

bctbx_list_t * ms_list_prepend ( bctbx_list_t *  list,
void *  data 
)

Inserts a new element containing data to the start of a given list

Parameters
listlist where data should be added. If NULL, a new list will be created.
datadata to insert into the list
Returns
first element of the list - the one which was just created.
Deprecated:
Use bctbx_list_prepend() instead

◆ ms_list_remove()

bctbx_list_t * ms_list_remove ( bctbx_list_t *  list,
void *  data 
)

Finds and remove the first element containing the given data. Nothing is done if element is not found.

Parameters
listList in which data must be removed
dataData to remove
Returns
first element of the modified list
Deprecated:
Use bctbx_list_remove() instead

◆ ms_list_remove_custom()

bctbx_list_t * ms_list_remove_custom ( bctbx_list_t *  list,
MSCompareFunc  compare_func,
const void *  user_data 
)

Finds and remove any elements according to the given predicate function

Parameters
listList in which data must be removed
compare_funcFunction to invoke on each element. If it returns TRUE, the given element will be deleted.
user_dataUser data to pass to compare_func function
Returns
first element of the modified list
Deprecated:
Use bctbx_list_remove_custom() instead

◆ ms_list_remove_link()

bctbx_list_t * ms_list_remove_link ( bctbx_list_t *  list,
bctbx_list_t *  elem 
)

Finds and remove given element in list.

Parameters
listList in which element must be removed
elementelement to remove
Returns
first element of the modified list
Deprecated:
Use bctbx_list_remove_link() instead

◆ ms_list_size()

int ms_list_size ( const bctbx_list_t *  list)

Returns size of a given list

Parameters
listList to measure
Returns
Size of list
Deprecated:
Use bctbx_list_size() instead