src/cx/list.h

changeset 1465
dc886f1a6155
parent 1453
b6fc5b1d5c5d
equal deleted inserted replaced
1464:9a10af83cfab 1465:dc886f1a6155
1009 cx_attr_nonnull_arg(1, 2, 3) 1009 cx_attr_nonnull_arg(1, 2, 3)
1010 CX_EXPORT int cxListDifference(CxList *dst, 1010 CX_EXPORT int cxListDifference(CxList *dst,
1011 const CxList *minuend, const CxList *subtrahend, 1011 const CxList *minuend, const CxList *subtrahend,
1012 cx_clone_func clone_func, const CxAllocator *clone_allocator, void *data); 1012 cx_clone_func clone_func, const CxAllocator *clone_allocator, void *data);
1013 1013
1014 /**
1015 * Clones elements from a list only if they are also present in another list.
1016 *
1017 * This function is optimized for the case when both the @p minuend and the
1018 * @p subtrahend are sorted.
1019 *
1020 * If the destination list already contains elements, the intersection is appended
1021 * to that list.
1022 *
1023 * @param dst the destination list
1024 * @param src the list to clone the elements from
1025 * @param other the list to check the elements for existence
1026 * @param clone_func the clone function for the elements
1027 * @param clone_allocator the allocator that is passed to the clone function
1028 * @param data optional additional data that is passed to the clone function
1029 * @retval zero when the elements were successfully cloned
1030 * @retval non-zero when an allocation error occurred
1031 */
1032 cx_attr_nonnull_arg(1, 2, 3)
1033 CX_EXPORT int cxListIntersection(CxList *dst, const CxList *src, const CxList *other,
1034 cx_clone_func clone_func, const CxAllocator *clone_allocator, void *data);
1035
1014 #ifdef __cplusplus 1036 #ifdef __cplusplus
1015 } // extern "C" 1037 } // extern "C"
1016 #endif 1038 #endif
1017 1039
1018 #endif // UCX_LIST_H 1040 #endif // UCX_LIST_H

mercurial