183 1, |
183 1, |
184 &arl->reallocator |
184 &arl->reallocator |
185 ); |
185 ); |
186 } |
186 } |
187 |
187 |
|
188 static size_t cx_arl_add_array( |
|
189 struct cx_list_s *list, |
|
190 void const *array, |
|
191 size_t n |
|
192 ) { |
|
193 cx_array_list *arl = (cx_array_list *) list; |
|
194 if (CX_ARRAY_COPY_SUCCESS == cx_array_copy( |
|
195 &arl->data, |
|
196 &list->size, |
|
197 &list->capacity, |
|
198 list->size, |
|
199 array, |
|
200 list->itemsize, |
|
201 n, |
|
202 &arl->reallocator |
|
203 )) { |
|
204 return n; |
|
205 } else { |
|
206 // array list implementation is "all or nothing" |
|
207 return 0; |
|
208 } |
|
209 } |
|
210 |
188 static int cx_arl_insert( |
211 static int cx_arl_insert( |
189 struct cx_list_s *list, |
212 struct cx_list_s *list, |
190 size_t index, |
213 size_t index, |
191 void const *elem |
214 void const *elem |
192 ) { |
215 ) { |