upipe/ulist.h header reference

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

Header inclusion [link] 

Members [link] 

Functions [link] 

  • void ulist_add(struct uchain *ulist, struct uchain *element)
  • struct uchain * ulist_at(struct uchain *ulist, unsigned int index)
  • void ulist_bubble(struct uchain *ulist, struct uchain *element, int (*compar)(struct ::uchain *,struct ::uchain *) )
  • void ulist_bubble_reverse(struct uchain *ulist, struct uchain *element, int (*compar)(struct ::uchain *,struct ::uchain *) )
  • void ulist_delete(struct uchain *element)
  • size_t ulist_depth(struct uchain *ulist)
  • bool ulist_empty(struct uchain *ulist)
  • void ulist_init(struct uchain *ulist)
  • void ulist_insert(struct uchain *prev, struct uchain *next, struct uchain *element)
  • bool ulist_is_first(struct uchain *ulist, struct uchain *element)
  • bool ulist_is_in(struct uchain *element)
  • bool ulist_is_last(struct uchain *ulist, struct uchain *element)
  • struct uchain * ulist_next(struct uchain *ulist, struct uchain *element)
  • struct uchain * ulist_peek(struct uchain *ulist)
  • struct uchain * ulist_peek_last(struct uchain *ulist)
  • struct uchain * ulist_pop(struct uchain *ulist)
  • struct uchain * ulist_prev(struct uchain *ulist, struct uchain *element)
  • void ulist_sort(struct uchain *ulist, int (*compar)(struct ::uchain **,struct ::uchain **) )
  • void ulist_unshift(struct uchain *ulist, struct uchain *element)

Macros [link] 

Description [link] 

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

Members detail [link] 

#define _UPIPE_ULIST_H_ [link] 

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

void ulist_add(struct uchain *ulist, struct uchain *element) [link] 

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

This function adds a new element at the end.

Parameter list:

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

struct uchain * ulist_at(struct uchain *ulist, unsigned int index) [link] 

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

This function return a pointer to the element at the given index.

Parameter list:

  • ulist: pointer to a ulist
  • index: the index in the list

The return value is pointer to the element at index

void ulist_bubble(struct uchain *ulist, struct uchain *element, int (*compar)(struct ::uchain *,struct ::uchain *) ) [link] 

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

This function inserts a new element into a list using a comparison function.

Parameter list:

  • ulist: pointer to a ulist
  • element: element to insert
  • compar: comparison function accepting two uchains as arguments

void ulist_bubble_reverse(struct uchain *ulist, struct uchain *element, int (*compar)(struct ::uchain *,struct ::uchain *) ) [link] 

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

This function inserts a new element into a list using a comparison function, from the end.

Parameter list:

  • ulist: pointer to a ulist
  • element: element to insert
  • compar: comparison function accepting two uchains as arguments

void ulist_delete(struct uchain *element) [link] 

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

This function deletes an element from a ulist.

Parameter list:

  • element: pointer to element to delete

#define ulist_delete_foreach(ulist, uchain, uchain_tmp) [link] 

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

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

Parameter list:

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

#define ulist_delete_foreach_reverse(ulist, uchain, uchain_tmp) [link] 

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

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

Parameter list:

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

size_t ulist_depth(struct uchain *ulist) [link] 

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

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

Parameter list:

  • ulist: pointer to a ulist

The return value is the depth of the list

bool ulist_empty(struct uchain *ulist) [link] 

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

This function checks if the list is empty.

Parameter list:

  • ulist: pointer to a ulist

The return value is true if the list is empty

#define ulist_foreach(ulist, uchain) [link] 

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

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

Parameter list:

  • ulist: pointer to a ulist
  • uchain: iterator

#define ulist_foreach_reverse(ulist, uchain) [link] 

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

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

Parameter list:

  • ulist: pointer to a ulist
  • uchain: iterator

void ulist_init(struct uchain *ulist) [link] 

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

This function initializes a ulist.

Parameter list:

  • uchain: pointer to a ulist

void ulist_insert(struct uchain *prev, struct uchain *next, struct uchain *element) [link] 

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

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

Parameter list:

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

bool ulist_is_first(struct uchain *ulist, struct uchain *element) [link] 

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

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

Parameter list:

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

The return value is true if the element is the first

bool ulist_is_in(struct uchain *element) [link] 

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

This function checks if the element is in a list.

Parameter list:

  • element: pointer to element

The return value is true if the element is in the list

bool ulist_is_last(struct uchain *ulist, struct uchain *element) [link] 

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

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

Parameter list:

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

The return value is true if the element is the last

struct uchain * ulist_next(struct uchain *ulist, struct uchain *element) [link] 

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

This function return the next element in the list or NULL.

Parameter list:

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

The return value is point to the next element or NULL

struct uchain * ulist_peek(struct uchain *ulist) [link] 

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

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

Parameter list:

  • ulist: pointer to a ulist

The return value is pointer to the first element

struct uchain * ulist_peek_last(struct uchain *ulist) [link] 

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

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

Parameter list:

  • ulist: pointer to a ulist

The return value is pointer to the last element or NULL if the list is empty

struct uchain * ulist_pop(struct uchain *ulist) [link] 

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

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

Parameter list:

  • ulist: pointer to a ulist

The return value is pointer to the first element

struct uchain * ulist_prev(struct uchain *ulist, struct uchain *element) [link] 

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

This function return the previous element in the list or NULL.

Parameter list:

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

The return value is point to the previous element or NULL

void ulist_sort(struct uchain *ulist, int (*compar)(struct ::uchain **,struct ::uchain **) ) [link] 

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

This function sorts through a list using a comparison function.

Parameter list:

  • ulist: pointer to a ulist
  • compar: comparison function accepting two uchains as arguments

void ulist_unshift(struct uchain *ulist, struct uchain *element) [link] 

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

This function adds a new element at the beginning.

Parameter list:

  • ulist: pointer to a ulist
  • element: pointer to the first element to add
Valid XHTML 1.0 StrictGenerated by cmassiot on Sun Dec 14 18:31:17 2025 using MkDoc