diff options
Diffstat (limited to 'pk.h.in')
| -rw-r--r-- | pk.h.in | 24 |
1 files changed, 24 insertions, 0 deletions
@@ -27,6 +27,7 @@ * # define PK_IMPL_MEM * # define PK_IMPL_STR * # define PK_IMPL_EV +* # define PK_IMPL_ARR * #include "pk.h" * ``` * @@ -119,6 +120,26 @@ * that in this provided scenario a given mgr will still grow if a second EV is * registered. * +******************************************************************************** +* pkarr.h: def PK_IMPL_ARR before including pk.h to enable ad-hoc +* +* Provides a structure for managing contiguous lists +* +* The following definitions (shown with defaults) can be overridden: +* PK_ARR_INITIAL_COUNT 16 +* PK_ARR_GROW_RATIO 1.5 +* +* Initialize `stride`, `alignment` (optional), and `bkt` (optional) members +* *before* calling any `pk_arr_*` methods. +* ``` c +* struct pk_arr arr = {0}; +* arr.stride = sizeof(obj); +* arr.alignment = alignof(obj); // optional +* arr.bkt = bkt; // optional +* pk_arr_reserve(&arr, 10); // optional +* pk_arr_append(&arr, &obj); +* ``` +* *******************************************************************************/ #define PK_VERSION "@@PK_VERSION@@" @@ -136,4 +157,7 @@ # ifndef PK_IMPL_EV # define PK_IMPL_EV # endif +# ifndef PK_IMPL_ARR +# define PK_IMPL_ARR +# endif #endif |
