diff -r 1e2be40f0cb5 -r 6c81ee4f11ad src/array_list.c --- a/src/array_list.c Sun Nov 20 21:08:36 2022 +0100 +++ b/src/array_list.c Wed Nov 23 22:40:55 2022 +0100 @@ -185,6 +185,29 @@ ); } +static size_t cx_arl_add_array( + struct cx_list_s *list, + void const *array, + size_t n +) { + cx_array_list *arl = (cx_array_list *) list; + if (CX_ARRAY_COPY_SUCCESS == cx_array_copy( + &arl->data, + &list->size, + &list->capacity, + list->size, + array, + list->itemsize, + n, + &arl->reallocator + )) { + return n; + } else { + // array list implementation is "all or nothing" + return 0; + } +} + static int cx_arl_insert( struct cx_list_s *list, size_t index, @@ -385,6 +408,7 @@ static cx_list_class cx_array_list_class = { cx_arl_destructor, cx_arl_add, + cx_arl_add_array, cx_arl_insert, cx_arl_insert_iter, cx_arl_remove,