diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/plist.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/plist.c b/src/plist.c index 3e69e2a..1ff17fc 100644 --- a/src/plist.c +++ b/src/plist.c | |||
| @@ -58,6 +58,21 @@ PLIST_API int plist_is_binary(const char *plist_data, uint32_t length) | |||
| 58 | return (memcmp(plist_data, "bplist00", 8) == 0); | 58 | return (memcmp(plist_data, "bplist00", 8) == 0); |
| 59 | } | 59 | } |
| 60 | 60 | ||
| 61 | |||
| 62 | PLIST_API void plist_from_memory(const char *plist_data, uint32_t length, plist_t * plist) | ||
| 63 | { | ||
| 64 | if (length < 8) { | ||
| 65 | *plist = NULL; | ||
| 66 | return; | ||
| 67 | } | ||
| 68 | |||
| 69 | if (plist_is_binary(plist_data, length)) { | ||
| 70 | plist_from_bin(plist_data, length, plist); | ||
| 71 | } else { | ||
| 72 | plist_from_xml(plist_data, length, plist); | ||
| 73 | } | ||
| 74 | } | ||
| 75 | |||
| 61 | plist_t plist_new_node(plist_data_t data) | 76 | plist_t plist_new_node(plist_data_t data) |
| 62 | { | 77 | { |
| 63 | return (plist_t) node_create(NULL, data); | 78 | return (plist_t) node_create(NULL, data); |
