From 60d291941fadb72b66d11502710add5899e21a2d Mon Sep 17 00:00:00 2001 From: Nikias Bassen Date: Sun, 8 Jan 2023 05:29:22 +0100 Subject: Add support for OpenStep plist format --- include/plist/plist.h | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'include') diff --git a/include/plist/plist.h b/include/plist/plist.h index c0eae1c..0ae8889 100644 --- a/include/plist/plist.h +++ b/include/plist/plist.h @@ -697,6 +697,20 @@ extern "C" */ plist_err_t plist_to_json(plist_t plist, char **plist_json, uint32_t* length, int prettify); + /** + * Export the #plist_t structure to OpenStep format. + * + * @param plist the root node to export + * @param plist_openstep a pointer to a char* buffer. This function allocates the memory, + * caller is responsible for freeing it. + * @param length a pointer to an uint32_t variable. Represents the length of the allocated buffer. + * @param prettify pretty print the output if != 0 + * @return PLIST_ERR_SUCCESS on success or a #plist_err_t on failure + * @note Use plist_mem_free() to free the allocated memory. + */ + plist_err_t plist_to_openstep(plist_t plist, char **plist_openstep, uint32_t* length, int prettify); + + /** * Import the #plist_t structure from XML format. * @@ -727,6 +741,16 @@ extern "C" */ plist_err_t plist_from_json(const char *json, uint32_t length, plist_t * plist); + /** + * Import the #plist_t structure from OpenStep plist format. + * + * @param openstep a pointer to the OpenStep plist buffer. + * @param length length of the buffer to read. + * @param plist a pointer to the imported plist. + * @return PLIST_ERR_SUCCESS on success or a #plist_err_t on failure + */ + plist_err_t plist_from_openstep(const char *openstep, uint32_t length, plist_t * plist); + /** * Import the #plist_t structure from memory data. * This method will look at the first bytes of plist_data -- cgit v1.1-32-gdbae