libplist  2.8.0
API Documentation - Return to Homepage

◆ plist_dict_merge()

PLIST_API plist_err_t plist_dict_merge ( plist_t * target,
plist_t source )

Merge a dictionary into another.

This will add all key/value pairs from the source dictionary to the target dictionary, overwriting any existing key/value pairs that are already present in target.

Parameters
targetpointer to an existing node of type PLIST_DICT
sourcenode of type PLIST_DICT that should be merged into target
Returns
  • PLIST_ERR_SUCCESS on success.
  • PLIST_ERR_INVALID_ARG if target is NULL, source is NULL, source is not a dictionary, or *target is not NULL and does not point to a dictionary.
  • PLIST_ERR_NO_MEM if memory allocation failed while creating the target dictionary or copying items from source.
  • PLIST_ERR_UNKNOWN if an unexpected internal error occurred.