upipe/ulist.h header reference

Upipe implementation of lists of structures (NOT thread-safe) More

Header inclusion  

Members  

Functions  

Macros  

Description  

Please note that ulists cannot be assigned, as in: struct uchain mylist = mystruct->mylist;

Members detail  

#define _UPIPE_ULIST_H_  

This macro is declared in upipe/ulist.h source file, line 34.

void ulist_add(struct uchain *ulist, struct uchain *element)  

This function is declared in upipe/ulist.h source file, line 122.

This function adds a new element at the end.

Parameters list:

  • ulist: pointer to a ulist structure
  • element: pointer to element to add

void ulist_delete(struct uchain *element)  

This function is declared in upipe/ulist.h source file, line 110.

This function deletes an element from a ulist.

Parameters list:

  • element: pointer to element to delete

#define ulist_delete_foreach(ulist, uchain, uchain_tmp)  

This macro is declared in upipe/ulist.h source file, line 182.

This macro walks through a ulist. This variant allows to remove the current element safely.

Parameters list:

  • ulist: pointer to a ulist
  • uchain: iterator
  • uchain_tmp: uchain to use for temporary storage

size_t ulist_depth(struct uchain *ulist)  

This function is declared in upipe/ulist.h source file, line 80.

This function calculates the depth of the list (suboptimal, only for debug).

Parameters list:

  • ulist: pointer to a ulist

The return value is the depth of the list

bool ulist_empty(struct uchain *ulist)  

This function is declared in upipe/ulist.h source file, line 70.

This function checks if the list is empty.

Parameters list:

  • ulist: pointer to a ulist

The return value is true if the list is empty

#define ulist_foreach(ulist, uchain)  

This macro is declared in upipe/ulist.h source file, line 171.

This macro walks through a ulist. Please note that the list may not be altered during the walk (see ulist_delete_foreach).

Parameters list:

  • ulist: pointer to a ulist
  • uchain: iterator

void ulist_init(struct uchain *ulist)  

This function is declared in upipe/ulist.h source file, line 49.

This function initializes a ulist.

Parameters list:

  • uchain: pointer to a ulist

void ulist_insert(struct uchain *prev, struct uchain *next, struct uchain *element)  

This function is declared in upipe/ulist.h source file, line 98.

This function adds a new element to a ulist at the given position.

Parameters list:

  • element: pointer to element to add
  • prev: pointer to previous element
  • next: pointer to next element

bool ulist_is_last(struct uchain *ulist, struct uchain *element)  

This function is declared in upipe/ulist.h source file, line 60.

This function checks if the element is the last of the list.

Parameters list:

  • ulist: pointer to a ulist
  • element: pointer to element

The return value is true if the element is the last

struct uchain * ulist_peek(struct uchain *ulist)  

This function is declared in upipe/ulist.h source file, line 143.

This function returns a pointer to the first element of the list (without removing it).

Parameters list:

  • ulist: pointer to a ulist

The return value is pointer to the first element

struct uchain * ulist_pop(struct uchain *ulist)  

This function is declared in upipe/ulist.h source file, line 156.

This function returns a pointer to the first element of the list and removes it.

Parameters list:

  • ulist: pointer to a ulist

The return value is pointer to the first element

void ulist_unshift(struct uchain *ulist, struct uchain *element)  

This function is declared in upipe/ulist.h source file, line 132.

This function adds a new element at the beginning.

Parameters list:

  • ulist: pointer to a ulist
  • element: pointer to the first element to add

Valid XHTML 1.0 StrictGenerated by cmassiot on Thu Nov 6 12:15:35 2014 using MkDoc