Set the nth item in a PLIST_ARRAY node.
The previous item at index n will be freed using plist_free
- Parameters
-
| node | the node of type PLIST_ARRAY |
| item | the new item at index n. The array is responsible for freeing item when it is no longer needed. |
| n | the index of the item to get. Range is [0, array_size[. |
- Returns
- PLIST_ERR_SUCCESS on success.
- PLIST_ERR_INVALID_ARG if node is not an array, item is NULL, item is already attached to a parent, or n is outside the valid range.
- PLIST_ERR_NO_MEM if replacing the item fails due to memory allocation failure and the original array element was restored successfully.
- PLIST_ERR_UNKNOWN if an unexpected internal error occurred, including failure to restore the original array element after insertion of the replacement failed.