959 * @param list the list that shall be freed |
959 * @param list the list that shall be freed |
960 */ |
960 */ |
961 CX_EXPORT void cxListFree(CxList *list); |
961 CX_EXPORT void cxListFree(CxList *list); |
962 |
962 |
963 |
963 |
|
964 /** |
|
965 * Performs a deep clone of one list into another. |
|
966 * |
|
967 * If the destination list already contains elements, the cloned elements |
|
968 * are appended to that list. |
|
969 * |
|
970 * @attention If the cloned elements need to be destroyed by a destructor |
|
971 * function, you must make sure that the destination list also uses this |
|
972 * destructor function. |
|
973 * |
|
974 * @param dst the destination list |
|
975 * @param src the source list |
|
976 * @param clone_func the clone function for the elements |
|
977 * @param clone_allocator the allocator that is passed to the clone function |
|
978 * @param data optional additional data that is passed to the clone function |
|
979 * @return the number of elements that have been successfully cloned |
|
980 */ |
|
981 cx_attr_nonnull_arg(1, 2, 3) |
|
982 CX_EXPORT size_t cxListClone(CxList *dst, const CxList *src, |
|
983 cx_clone_func clone_func, const CxAllocator *clone_allocator, void *data); |
|
984 |
964 #ifdef __cplusplus |
985 #ifdef __cplusplus |
965 } // extern "C" |
986 } // extern "C" |
966 #endif |
987 #endif |
967 |
988 |
968 #endif // UCX_LIST_H |
989 #endif // UCX_LIST_H |