From: Ralph Ronnquist Date: Sat, 9 Jul 2022 09:28:54 +0000 (+1000) Subject: added convenience callbacks X-Git-Url: https://git.rrq.au/?a=commitdiff_plain;h=d90019791ac5db4335ff117b765704a7b6167e68;p=rrq%2Frrqmisc.git added convenience callbacks --- diff --git a/vector/vector.h b/vector/vector.h index 3cbd935..4dc61f8 100644 --- a/vector/vector.h +++ b/vector/vector.h @@ -377,4 +377,20 @@ extern vector_index vector_find(vector *pv,void *value); */ extern vector_index vector_next_unused(vector *pv,vector_index index); +/** + * \brief Convenience callback function for vector shrinking to free + * any existing slot assignment. + * + * \related vector + */ +extern int vector_free_any(vector *pv,vector_index ix,void *item,void *data); + +/** + * \brief Convenience callback function for vector shrinking to ignore + * any existing slot assignment (without free-ing them). + * + * \related vector + */ +extern int vector_clear_any(vector *pv,vector_index ix,void *item,void *data); + #endif