logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

Author

       Generated automatically by Doxygen for Wayland from the source code.

Version 1.23.1                              Thu May 22 2025 08:23:52                                 wl_array(3)

Detailed Description

       Dynamic array

       A 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.

Field Documentation

size_twl_array::alloc
       Allocated space

   void*wl_array::data
       Array data

   size_twl_array::size
       Array size

Member Function Documentation

void*wl_array_add(structwl_array*array,size_tsize)
       Increases the size of the array by size bytes.

       Parametersarray Array whose size is to be increased
           size Number of bytes to increase the size of the array by

       Returns
           A pointer to the beginning of the newly appended space, or NULL when resizing fails.

   intwl_array_copy(structwl_array*array,structwl_array*source)
       Copies the contents of source to array.

       Parametersarray Destination array to copy to
           source Source array to copy from

       Returns
           0 on success, or -1 on failure

   voidwl_array_init(structwl_array*array)
       Initializes the array.

       Parametersarray Array to initialize

   voidwl_array_release(structwl_array*array)
       Releases the array data.

       Note
           Leaves the array in an invalid state.

       Parametersarray Array whose data is to be released

Name

       wl_array

Synopsis

       #include <wayland-util.h>

   PublicMemberFunctions
       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)

   DataFields
       size_t size
       size_t alloc
       void * dataRelatedSymbols
       (Note that these are not member symbols.)
       #define wl_array_for_each(pos,  array)

See Also