Function
GLibPtrArraynew_null_terminated
since: 2.74
Declaration [src]
GPtrArray*
g_ptr_array_new_null_terminated (
guint reserved_size,
GDestroyNotify element_free_func,
gboolean null_terminated
)
Description [src]
Like g_ptr_array_new_full()
but also allows to set the array to
be NULL
terminated. A NULL
terminated pointer array has an
additional NULL
pointer after the last element, beyond the
current length.
GPtrArray
created by other constructors are not automatically NULL
terminated.
Note that if the array
‘s length is zero and currently no
data array is allocated, then pdata will still be NULL
.
%GPtrArray will only NULL
terminate pdata, if an actual
array is allocated. It does not guarantee that an array
is always allocated. In other words, if the length is zero,
then pdata may either point to a NULL
terminated array of length
zero or be NULL
.
Available since: 2.74
This function is not directly available to language bindings.
Parameters
reserved_size
-
Type:
guint
Number of pointers preallocated. If
null_terminated
isTRUE
, the actually allocated buffer size isreserved_size
plus 1, unlessreserved_size
is zero, in which case no initial buffer gets allocated. element_free_func
-
Type:
GDestroyNotify
A function to free elements with destroy
array
orNULL
. null_terminated
-
Type:
gboolean
Whether to make the array as
NULL
terminated.