|
#define | PW_ARRAY_INIT(extend) |
|
#define | pw_array_get_len_s(a, s) |
|
#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) |
|
#define | pw_array_add_ptr(a, p) |
| Add a pointer to array.
|
|
An array object
The array is a dynamically resizable data structure that can hold items of the same size.
◆ PW_ARRAY_INIT
#define PW_ARRAY_INIT |
( |
| extend | ) |
|
Value:
size_t extend
number of bytes to extend with
Definition array.h:36
◆ pw_array_get_len_s
#define pw_array_get_len_s |
( |
| a, |
|
|
| s ) |
◆ pw_array_get_unchecked_s
#define pw_array_get_unchecked_s |
( |
| a, |
|
|
| idx, |
|
|
| s, |
|
|
| t ) |
Value:
#define SPA_PTROFF(ptr_, offset_, type_)
Return the address (buffer + offset) as pointer of type.
Definition defs.h:198
◆ pw_array_check_index_s
#define pw_array_check_index_s |
( |
| a, |
|
|
| idx, |
|
|
| s ) |
Value:
#define pw_array_get_len_s(a, s)
Definition array.h:42
◆ pw_array_get_len
#define pw_array_get_len |
( |
| a, |
|
|
| t ) |
Value:
Get the number of items of type t in array.
◆ pw_array_get_unchecked
#define pw_array_get_unchecked |
( |
| a, |
|
|
| idx, |
|
|
| t ) |
Value:
#define pw_array_get_unchecked_s(a, idx, s, t)
Definition array.h:43
Get the item with index idx and type t from array.
◆ pw_array_check_index
#define pw_array_check_index |
( |
| a, |
|
|
| idx, |
|
|
| t ) |
Value:
#define pw_array_check_index_s(a, idx, s)
Definition array.h:44
Check if an item with index idx and type t exist in array.
◆ pw_array_first
#define pw_array_first |
( |
| a | ) |
|
◆ pw_array_end
#define pw_array_end |
( |
| a | ) |
|
◆ pw_array_check
#define pw_array_check |
( |
| a, |
|
|
| p ) |
Value:
#define pw_array_end(a)
Definition array.h:54
◆ pw_array_for_each
#define pw_array_for_each |
( |
| pos, |
|
|
| array ) |
◆ pw_array_consume
#define pw_array_consume |
( |
| pos, |
|
|
| array ) |
◆ pw_array_remove
#define pw_array_remove |
( |
| a, |
|
|
| p ) |
◆ pw_array_add_ptr
#define pw_array_add_ptr |
( |
| a, |
|
|
| p ) |
Value:
static void * pw_array_add(struct pw_array *arr, size_t size)
Add ref size bytes to arr.
Definition array.h:119
Add a pointer to array.
◆ pw_array_init()
static void pw_array_init |
( |
struct pw_array * | arr, |
|
|
size_t | extend ) |
|
inlinestatic |
Initialize the array with given extend.
◆ pw_array_clear()
static void pw_array_clear |
( |
struct pw_array * | arr | ) |
|
|
inlinestatic |
◆ pw_array_reset()
static void pw_array_reset |
( |
struct pw_array * | arr | ) |
|
|
inlinestatic |
◆ pw_array_ensure_size()
static int pw_array_ensure_size |
( |
struct pw_array * | arr, |
|
|
size_t | size ) |
|
inlinestatic |
Make sure size bytes can be added to the array.
◆ pw_array_add()
static void * pw_array_add |
( |
struct pw_array * | arr, |
|
|
size_t | size ) |
|
inlinestatic |
Add ref size bytes to arr.
A pointer to memory that can hold at least size bytes is returned
◆ pw_array_add_fixed()
static void * pw_array_add_fixed |
( |
struct pw_array * | arr, |
|
|
size_t | size ) |
|
inlinestatic |
Add ref size bytes to arr.
When there is not enough memory to hold size bytes, NULL is returned