.\" Automatically generated man page, do not edit .TH QBARRAY.H 3 2023-07-21 "LIBQB" "libqb Programmer's Manual" .SH NAME qbarray.h \- This is a dynamic array (it can grow, but without moving memory). .SH SYNOPSIS .nf .B #include .SH DESCRIPTION .nf arr = qb_array_create_2(64, sizeof(struct my_struct), 256); \[char46].. res = qb_array_index(arr, idx, (void**)&my_ptr); if (res < 0) { return res; } // use my_ptr, now even if there is a grow, this pointer will be valid. .fi .PP Currently, this dynamic array abstract data type can accommodate only 2^\fBQB_ARRAY_MAX_INDEX_BITS\fP elements, and with standard zero-based indexing, this gives a valid index range [0, \fBQB_ARRAY_MAX_ELEMENTS\fP), where the notation denotes the beginning of the interval is included and the end is excluded. In other words, client space shall avoid a pitfall of relying solely on the type of \fBmax_elements\fP parameter to \fIqb_array_create\fR and/or of \fBidx\fP parameter to \fIqb_array_index\fR (these types conflict, anyway). .SH SEE ALSO .PP .nh .ad l \fIqb_array_elems_per_bin_get\fR(3), \fIqb_array_new_bin_cb_set\fR(3), \fIqb_array_create\fR(3), \fIqb_array_grow\fR(3), \fIqb_array_num_bins_get\fR(3), \fIqb_array_index\fR(3), \fIqb_array_create_2\fR(3), \fIqb_array_free\fR(3) .ad .hy .SH "COPYRIGHT" .PP Copyright (C) 2010-2020 Red Hat, Inc.