upipe/ulifo.h header reference
Upipe thread-safe last-in first-out data structure More
Header inclusion
Members
Type
- struct ulifo
Functions
- void ulifo_clean(struct ulifo *ulifo)
- void ulifo_init(struct ulifo *ulifo, uint16_t length, void *extra)
- bool ulifo_push(struct ulifo *ulifo, void *opaque)
Macros
Description
Upipe thread-safe last-in first-out data structure
Members detail
This macro is declared in upipe/ulifo.h source file, line 31.
This struct is declared in upipe/ulifo.h source file, line 41.
This struct is the implementation of last-in first-out data structure.
Field | Description |
---|---|
struct uring uring; | ring structure |
uring_lifo lifo_carrier; | uring LIFO of elements carrying a uchain |
uring_lifo lifo_empty; | uring LIFO of elements not carrying a uchain |
void ulifo_clean(struct ulifo *ulifo)
This function is declared in upipe/ulifo.h source file, line 121.
This function cleans up the ulifo data structure. Please note that it is the caller's responsibility to empty the LIFO first, and to release the extra data passed to ulifo_init.
Parameter list:
- ulifo: pointer to a ulifo structure
void ulifo_init(struct ulifo *ulifo, uint16_t length, void *extra)
This function is declared in upipe/ulifo.h source file, line 65.
This function initializes a ulifo.
Parameter list:
- ulifo: pointer to a ulifo structure
- length: maximum number of elements in the LIFO
- extra: mandatory extra space allocated by the caller, with the size returned by ulifo_sizeof
This macro is declared in upipe/ulifo.h source file, line 111.
This macro pops an element with type checking.
Parameter list:
- ulifo: pointer to a ulifo structure
- type: type of the opaque pointer
The return value is pointer to opaque, or NULL if the LIFO is empty
bool ulifo_push(struct ulifo *ulifo, void *opaque)
This function is declared in upipe/ulifo.h source file, line 79.
This function pushes a new element.
Parameter list:
- ulifo: pointer to a ulifo structure
- opaque: opaque to associate with element (not NULL)
The return value is false if the maximum number of elements was reached and the element couldn't be queued
This macro is declared in upipe/ulifo.h source file, line 54.
This macro returns the required size of extra data space for ulifo.
Parameter list:
- length: maximum number of elements in the LIFO
The return value is size in octets to allocate
void * ulifo_pop_internal(struct ulifo *ulifo)
This function is for internal use only.
This function is declared in upipe/ulifo.h source file, line 95.
This function pops an element.
Parameter list:
- ulifo: pointer to a ulifo structure
The return value is pointer to opaque, or NULL if the LIFO is empty