|
PipeWire 1.4.10
|
An array object. More...
Files | |
| file | array.h |
| pipewire/array.h | |
Data Structures | |
| struct | pw_array |
Macros | |
| #define | PW_ARRAY_INIT(extend) |
| Initialize an array. | |
| #define | pw_array_get_len_s(a, s) |
| Return the length of an array. | |
| #define | pw_array_get_unchecked_s(a, idx, s, t) |
| #define | pw_array_check_index_s(a, idx, s) |
| #define | pw_array_get_len(a, t) |
| Get the number of items of type t in array. | |
| #define | pw_array_get_unchecked(a, idx, t) |
| Get the item with index idx and type t from array. | |
| #define | pw_array_check_index(a, idx, t) |
| Check if an item with index idx and type t exist in array. | |
| #define | pw_array_first(a) |
| #define | pw_array_end(a) |
| #define | pw_array_check(a, p) |
| #define | pw_array_for_each(pos, array) |
| #define | pw_array_consume(pos, array) |
| #define | pw_array_remove(a, p) |
Functions | |
| PW_API_ARRAY void | pw_array_init (struct pw_array *arr, size_t extend) |
| Initialize the array with given extend. | |
| PW_API_ARRAY void | pw_array_clear (struct pw_array *arr) |
| Clear the array. | |
| PW_API_ARRAY void | pw_array_init_static (struct pw_array *arr, void *data, size_t size) |
| Initialize a static array. | |
| PW_API_ARRAY void | pw_array_reset (struct pw_array *arr) |
| Reset the array. | |
| PW_API_ARRAY int | pw_array_ensure_size (struct pw_array *arr, size_t size) |
| Make sure size bytes can be added to the array. | |
| PW_API_ARRAY void * | pw_array_add (struct pw_array *arr, size_t size) |
| Add ref size bytes to arr. | |
| PW_API_ARRAY int | pw_array_add_ptr (struct pw_array *arr, void *ptr) |
| Add a pointer to array. | |
An array object.
The array is a dynamically resizable data structure that can hold items of the same size.
| #define PW_ARRAY_INIT | ( | extend | ) |
| #define pw_array_get_len_s | ( | a, | |
| s ) |
Return the length of an array.
| #define pw_array_get_unchecked_s | ( | a, | |
| idx, | |||
| s, | |||
| t ) |
| #define pw_array_check_index_s | ( | a, | |
| idx, | |||
| s ) |
| #define pw_array_get_len | ( | a, | |
| t ) |
Get the number of items of type t in array.
| #define pw_array_get_unchecked | ( | a, | |
| idx, | |||
| t ) |
Get the item with index idx and type t from array.
No bounds check is done.
| #define pw_array_check_index | ( | a, | |
| idx, | |||
| t ) |
Check if an item with index idx and type t exist in array.
| #define pw_array_first | ( | a | ) |
| #define pw_array_end | ( | a | ) |
| #define pw_array_check | ( | a, | |
| p ) |
| #define pw_array_for_each | ( | pos, | |
| array ) |
| #define pw_array_consume | ( | pos, | |
| array ) |
| #define pw_array_remove | ( | a, | |
| p ) |
| PW_API_ARRAY void pw_array_init | ( | struct pw_array * | arr, |
| size_t | extend ) |
Initialize the array with given extend.
Extend needs to be > 0 or else the array will not be able to expand.
| PW_API_ARRAY void pw_array_clear | ( | struct pw_array * | arr | ) |
Clear the array.
This should be called when pw_array_init() was called.
| PW_API_ARRAY void pw_array_init_static | ( | struct pw_array * | arr, |
| void * | data, | ||
| size_t | size ) |
Initialize a static array.
| PW_API_ARRAY void pw_array_reset | ( | struct pw_array * | arr | ) |
Reset the array.
| PW_API_ARRAY int pw_array_ensure_size | ( | struct pw_array * | arr, |
| size_t | size ) |
Make sure size bytes can be added to the array.
| PW_API_ARRAY void * pw_array_add | ( | struct pw_array * | arr, |
| size_t | size ) |
Add ref size bytes to arr.
A pointer to memory that can hold at least size bytes is returned or NULL when an error occurred and errno will be set.
| PW_API_ARRAY int pw_array_add_ptr | ( | struct pw_array * | arr, |
| void * | ptr ) |
Add a pointer to array.
Returns 0 on success and a negative errno style error on failure.