399 ) { |
408 ) { |
400 return list->cl->remove(list, index); |
409 return list->cl->remove(list, index); |
401 } |
410 } |
402 |
411 |
403 /** |
412 /** |
|
413 * Swaps two items in the list. |
|
414 * |
|
415 * Implementations should only allocate temporary memory for the swap, if |
|
416 * it is necessary. |
|
417 * |
|
418 * @param list the list |
|
419 * @param i the index of the first element |
|
420 * @param j the index of the second element |
|
421 * @return zero on success, non-zero if one of the indices is out of bounds |
|
422 */ |
|
423 __attribute__((__nonnull__)) |
|
424 static inline int cxListSwap( |
|
425 CxList *list, |
|
426 size_t i, |
|
427 size_t j |
|
428 ) { |
|
429 return list->cl->swap(list, i, j); |
|
430 } |
|
431 |
|
432 /** |
404 * Returns a pointer to the element at the specified index. |
433 * Returns a pointer to the element at the specified index. |
405 * |
434 * |
406 * @param list the list |
435 * @param list the list |
407 * @param index the index of the element |
436 * @param index the index of the element |
408 * @return a pointer to the element or \c NULL if the index is out of bounds |
437 * @return a pointer to the element or \c NULL if the index is out of bounds |