libplist  2.7.0
API Documentation - Return to Homepage

◆ plist_dict_copy_item()

PLIST_API plist_err_t plist_dict_copy_item ( plist_t  target_dict,
plist_t  source_dict,
const char *  key,
const char *  alt_source_key 
)

Copy a node from source_dict to target_dict.

The node is looked up in source_dict with given key, unless alt_source_key is non-NULL, in which case it is looked up with alt_source_key. The entry in target_dict is always created with key.

Parameters
target_dictThe target dictionary to copy to.
source_dictThe source dictionary to copy from.
keyThe key for the node to copy.
alt_source_keyThe alternative source key for lookup in source_dict or NULL.
Returns
PLIST_ERR_SUCCESS on success or PLIST_ERR_INVALID_ARG if the source dictionary does not contain any entry with given key or alt_source_key.