- stretch 1.12.0-1+deb9u1
- testing 1.16.0-1
- stretch-backports 1.16.0-1~bpo9+1
- unstable 1.16.0-1
wl_array(3) | Wayland | wl_array(3) |
NAME¶
wl_arraySYNOPSIS¶
#include <wayland-util.h>
Public Member Functions¶
void wl_array_init (struct wl_array *array)
void wl_array_release (struct wl_array *array)
void * wl_array_add (struct wl_array *array, size_t size)
int wl_array_copy (struct wl_array *array, struct wl_array *source)
Data Fields¶
size_t size
size_t alloc
void * data
Related Functions¶
(Note that these are not member functions.)#define wl_array_for_each(pos, array)
Detailed Description¶
Dynamic arrayA wl_array is a dynamic array that can only grow until released. It is intended for relatively small allocations whose size is variable or not known in advance. While construction of a wl_array does not require all elements to be of the same size, wl_array_for_each() does require all elements to have the same type and size.
Member Function Documentation¶
void * wl_array_add (struct wl_array * array, size_t size)¶
Increases the size of the array by size bytes.Parameters:
size Number of bytes to increase the size of the array by
Returns:
int wl_array_copy (struct wl_array * array, struct wl_array * source)¶
Copies the contents of source to array.Parameters:
source Source array to copy from
Returns:
void wl_array_init (struct wl_array * array)¶
Initializes the array.Parameters:
void wl_array_release (struct wl_array * array)¶
Releases the array data.Note:
Parameters:
Friends And Related Function Documentation¶
#define wl_array_for_each(pos, array) [related]¶
Value:for (pos = (array)->data; (const char *) pos < ((const char *) (array)->data + (array)->size); (pos)++)Iterates over an array.
This macro expresses a for-each iterator for wl_array. It assigns each element in the array to pos, which can then be referenced in a trailing code block. pos must be a pointer to the array element type, and all array elements must be of the same type and size.
Parameters:
array Array to iterate over
See also:
Field Documentation¶
size_t wl_array::alloc¶
Allocated spacevoid* wl_array::data¶
Array datasize_t wl_array::size¶
Array sizeAuthor¶
Generated automatically by Doxygen for Wayland from the source code.Mon Oct 22 2018 | Version 1.16.0 |