diff options
author | Nikias Bassen | 2021-12-23 03:09:07 +0100 |
---|---|---|
committer | Nikias Bassen | 2021-12-23 03:09:07 +0100 |
commit | 429cbc660ae14d4998715803b44c71abf0e4a339 (patch) | |
tree | 12fe08f5dcb00a380536198bac3fffd4eb7dd19b /src/plist.c | |
parent | 70002721443dabaa99b56301b537980e137b6249 (diff) | |
download | libplist-429cbc660ae14d4998715803b44c71abf0e4a339.tar.gz libplist-429cbc660ae14d4998715803b44c71abf0e4a339.tar.bz2 |
Add support for JSON format
Diffstat (limited to 'src/plist.c')
-rw-r--r-- | src/plist.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/plist.c b/src/plist.c index 61b2913..9f3c8f4 100644 --- a/src/plist.c +++ b/src/plist.c @@ -49,17 +49,21 @@ extern void plist_xml_init(void); extern void plist_xml_deinit(void); extern void plist_bin_init(void); extern void plist_bin_deinit(void); +extern void plist_json_init(void); +extern void plist_json_deinit(void); static void internal_plist_init(void) { plist_bin_init(); plist_xml_init(); + plist_json_init(); } static void internal_plist_deinit(void) { plist_bin_deinit(); plist_xml_deinit(); + plist_json_deinit(); } #ifdef WIN32 @@ -195,6 +199,8 @@ PLIST_API plist_err_t plist_from_memory(const char *plist_data, uint32_t length, } if (plist_is_binary(plist_data, length)) { res = plist_from_bin(plist_data, length, plist); + } else if (plist_data[0] == '[' || plist_data[0] == '{') { + res = plist_from_json(plist_data, length, plist); } else { res = plist_from_xml(plist_data, length, plist); } |