src/cx/map.h

changeset 1465
dc886f1a6155
parent 1448
0f0fe7311b76
equal deleted inserted replaced
1464:9a10af83cfab 1465:dc886f1a6155
543 */ 543 */
544 cx_attr_nonnull_arg(1, 2, 3, 4) 544 cx_attr_nonnull_arg(1, 2, 3, 4)
545 CX_EXPORT int cxMapListDifference(CxMap *dst, const CxMap *src, const CxList *keys, 545 CX_EXPORT int cxMapListDifference(CxMap *dst, const CxMap *src, const CxList *keys,
546 cx_clone_func clone_func, const CxAllocator *clone_allocator, void *data); 546 cx_clone_func clone_func, const CxAllocator *clone_allocator, void *data);
547 547
548
549 /**
550 * Clones entries of a map only if their key is present in another map.
551 *
552 * @param dst the destination map
553 * @param src the map to clone the entries from
554 * @param other the map to check for existence of the keys
555 * @param clone_func the clone function for the values
556 * @param clone_allocator the allocator that is passed to the clone function
557 * @param data optional additional data that is passed to the clone function
558 * @retval zero when the elements were successfully cloned
559 * @retval non-zero when an allocation error occurred
560 */
561 cx_attr_nonnull_arg(1, 2, 3, 4)
562 CX_EXPORT int cxMapIntersection(CxMap *dst, const CxMap *src, const CxMap *other,
563 cx_clone_func clone_func, const CxAllocator *clone_allocator, void *data);
564
565 /**
566 * Clones entries of a map only if their key is present in a list.
567 *
568 * Note that the list must contain keys of type @c CxKey
569 * (or pointers to such keys) and must use @c cx_hash_key_cmp
570 * as the compare function.
571 * Generic key types cannot be processed in this case.
572 *
573 * @param dst the destination map
574 * @param src the source map
575 * @param keys the list of @c CxKey items
576 * @param clone_func the clone function for the values
577 * @param clone_allocator the allocator that is passed to the clone function
578 * @param data optional additional data that is passed to the clone function
579 * @retval zero when the elements were successfully cloned
580 * @retval non-zero when an allocation error occurred
581 */
582 cx_attr_nonnull_arg(1, 2, 3, 4)
583 CX_EXPORT int cxMapListIntersection(CxMap *dst, const CxMap *src, const CxList *keys,
584 cx_clone_func clone_func, const CxAllocator *clone_allocator, void *data);
585
548 #ifdef __cplusplus 586 #ifdef __cplusplus
549 } // extern "C" 587 } // extern "C"
550 #endif 588 #endif
551 589
552 #endif // UCX_MAP_H 590 #endif // UCX_MAP_H

mercurial