279 ) { |
289 ) { |
280 return list->cl->insert(list, index, elem); |
290 return list->cl->insert(list, index, elem); |
281 } |
291 } |
282 |
292 |
283 /** |
293 /** |
|
294 * Inserts multiple items to the list at the specified index. |
|
295 * If \p index equals the list size, this is effectively cxListAddArray(). |
|
296 * |
|
297 * This method is usually more efficient than invoking cxListInsert() |
|
298 * multiple times. |
|
299 * |
|
300 * If there is not enough memory to add all elements, the returned value is |
|
301 * less than \p n. |
|
302 * |
|
303 * @param list the list |
|
304 * @param index the index where to add the elements |
|
305 * @param array a pointer to the elements to add |
|
306 * @param n the number of elements to add |
|
307 * @return the number of added elements |
|
308 */ |
|
309 __attribute__((__nonnull__)) |
|
310 static inline size_t cxListInsertArray( |
|
311 CxList *list, |
|
312 size_t index, |
|
313 void const *array, |
|
314 size_t n |
|
315 ) { |
|
316 return list->cl->insert_array(list, index, array, n); |
|
317 } |
|
318 |
|
319 /** |
284 * Inserts an element after the current location of the specified iterator. |
320 * Inserts an element after the current location of the specified iterator. |
285 * |
321 * |
286 * The used iterator remains operational, but all other active iterators should |
322 * The used iterator remains operational, but all other active iterators should |
287 * be considered invalidated. |
323 * be considered invalidated. |
288 * |
324 * |