summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/lib/eina/eina_inarray.c13
-rw-r--r--src/lib/eina/eina_inarray.h10
2 files changed, 23 insertions, 0 deletions
diff --git a/src/lib/eina/eina_inarray.c b/src/lib/eina/eina_inarray.c
index e674a20f3c..c1e07bed6d 100644
--- a/src/lib/eina/eina_inarray.c
+++ b/src/lib/eina/eina_inarray.c
@@ -382,6 +382,19 @@ eina_inarray_flush(Eina_Inarray *array)
382 array->members = NULL; 382 array->members = NULL;
383} 383}
384 384
385EAPI Eina_Bool
386eina_inarray_resize(Eina_Inarray *array, unsigned int new_size)
387{
388 Eina_Bool r;
389 EINA_MAGIC_CHECK_INARRAY(array, EINA_FALSE);
390
391 r = _eina_inarray_resize(array, new_size);
392 if(!r) return EINA_FALSE;
393
394 array->len = new_size;
395 return EINA_TRUE;
396}
397
385EAPI int 398EAPI int
386eina_inarray_push(Eina_Inarray *array, const void *data) 399eina_inarray_push(Eina_Inarray *array, const void *data)
387{ 400{
diff --git a/src/lib/eina/eina_inarray.h b/src/lib/eina/eina_inarray.h
index 9d7f9f6d8c..b9010d7d4e 100644
--- a/src/lib/eina/eina_inarray.h
+++ b/src/lib/eina/eina_inarray.h
@@ -602,6 +602,16 @@ EAPI int eina_inarray_foreach_remove(Eina_Inarray *array,
602 const void *user_data) EINA_ARG_NONNULL(1, 2); 602 const void *user_data) EINA_ARG_NONNULL(1, 2);
603 603
604/** 604/**
605 * @brief Resize array to new size
606 * @param array array object
607 * @param new_size
608 * @return #EINA_TRUE if it successfully resized the array
609 *
610 * @since 1.10
611 */
612EAPI Eina_Bool eina_inarray_resize(Eina_Inarray *array, unsigned int new_size);
613
614/**
605 * @brief number of members in array. 615 * @brief number of members in array.
606 * @param array array object 616 * @param array array object
607 * @return number of members in array. 617 * @return number of members in array.