6#define ALIGNMENT sizeof(size_t)
16 float shrink_threshold;
27typedef enum sparse_status_t
38#define sparse_create(...) \
41 DYNARR_DEFAULT_ARGS, \
50sparse_t *sparse_create_(
const sparse_opts_t *
const opts);
56sparse_t *sparse_clone(
const sparse_t *
const array);
62void sparse_destroy(sparse_t *
const array);
69size_t sparse_element_size(
const sparse_t *
const array);
75size_t sparse_size(
const sparse_t *
const array);
81size_t sparse_first_index(
const sparse_t *
const array);
87size_t sparse_last_index(
const sparse_t *
const array);
93size_t sparse_first_free_index(
const sparse_t *
const array);
99size_t sparse_last_free_index(
const sparse_t *
const array);
107sparse_status_t sparse_insert(sparse_t **
const array,
const size_t index,
const void *
const value);
115sparse_status_t sparse_insert_reserve(sparse_t **
const array,
const size_t index);
121void *sparse_get(
const sparse_t *array,
const size_t index);
127sparse_status_t sparse_remove(sparse_t **
const array,
const size_t index);
135bool sparse_is_empty_element(
const sparse_t *
const array,
const size_t index);
138typedef int (*sparse_foreach_t) (
const size_t index,
const void *
const element,
void *
const param);
139typedef int (*sparse_aggregate_t) (
const size_t index,
const void *
const element,
void *
const acc,
void *
const param);
140typedef int (*sparse_transform_t) (
const size_t index,
void *
const element,
void *
const param);
142int sparse_foreach(
const sparse_t *
const sparse,
143 const sparse_foreach_t func,
146int sparse_aggregate(
const sparse_t *
const sparse,
147 const sparse_aggregate_t func,
151int sparse_transform(sparse_t *
const sparse,
152 const sparse_transform_t func,