src/cx/map.h

changeset 1447
aaf85b3e9601
parent 1445
e8089a590b71
child 1448
0f0fe7311b76
equal deleted inserted replaced
1446:5732947cbcc2 1447:aaf85b3e9601
506 cx_attr_nonnull_arg(1, 2, 3) 506 cx_attr_nonnull_arg(1, 2, 3)
507 CX_EXPORT int cxMapClone(CxMap *dst, const CxMap *src, 507 CX_EXPORT int cxMapClone(CxMap *dst, const CxMap *src,
508 cx_clone_func clone_func, const CxAllocator *clone_allocator, void *data); 508 cx_clone_func clone_func, const CxAllocator *clone_allocator, void *data);
509 509
510 510
511 /**
512 * Clones entries of a map if their key is not present in another map.
513 *
514 * @param dst the destination map
515 * @param minuend the map to subtract the entries from
516 * @param subtrahend the map containing the elements to be subtracted
517 * @param clone_func the clone function for the values
518 * @param clone_allocator the allocator that is passed to the clone function
519 * @param data optional additional data that is passed to the clone function
520 * @retval zero when the elements were successfully cloned
521 * @retval non-zero when an allocation error occurred
522 */
511 cx_attr_nonnull_arg(1, 2, 3, 4) 523 cx_attr_nonnull_arg(1, 2, 3, 4)
512 CX_EXPORT int cxMapDifference(CxMap *dst, const CxMap *minuend, const CxMap *subtrahend, 524 CX_EXPORT int cxMapDifference(CxMap *dst, const CxMap *minuend, const CxMap *subtrahend,
513 cx_clone_func clone_func, const CxAllocator *clone_allocator, void *data); 525 cx_clone_func clone_func, const CxAllocator *clone_allocator, void *data);
514 526
527 /**
528 * Clones entries of a map if their key is not present in a list.
529 *
530 * Note that the list must contain keys of type @c CxKey
531 * (or pointers to such keys).
532 * Generic key types cannot be processed in this case.
533 *
534 * @param dst the destination map
535 * @param src the source map
536 * @param keys the list of @c CxKey items
537 * @param clone_func the clone function for the values
538 * @param clone_allocator the allocator that is passed to the clone function
539 * @param data optional additional data that is passed to the clone function
540 * @retval zero when the elements were successfully cloned
541 * @retval non-zero when an allocation error occurred
542 */
515 cx_attr_nonnull_arg(1, 2, 3, 4) 543 cx_attr_nonnull_arg(1, 2, 3, 4)
516 CX_EXPORT int cxMapListDifference(CxMap *dst, const CxMap *src, const CxList *keys, 544 CX_EXPORT int cxMapListDifference(CxMap *dst, const CxMap *src, const CxList *keys,
517 cx_clone_func clone_func, const CxAllocator *clone_allocator, void *data); 545 cx_clone_func clone_func, const CxAllocator *clone_allocator, void *data);
518 546
519 #ifdef __cplusplus 547 #ifdef __cplusplus

mercurial