diff options
| -rw-r--r-- | include/plist/plist.h | 14 | ||||
| -rw-r--r-- | src/bplist.c | 5 | ||||
| -rw-r--r-- | src/xplist.c | 5 |
3 files changed, 24 insertions, 0 deletions
diff --git a/include/plist/plist.h b/include/plist/plist.h index 7a41fb4..824ba43 100644 --- a/include/plist/plist.h +++ b/include/plist/plist.h | |||
| @@ -620,6 +620,13 @@ extern "C" | |||
| 620 | void plist_to_xml(plist_t plist, char **plist_xml, uint32_t * length); | 620 | void plist_to_xml(plist_t plist, char **plist_xml, uint32_t * length); |
| 621 | 621 | ||
| 622 | /** | 622 | /** |
| 623 | * Frees the memory allocated by plist_to_xml(). | ||
| 624 | * | ||
| 625 | * @param plist_xml The buffer allocated by plist_to_xml(). | ||
| 626 | */ | ||
| 627 | void plist_to_xml_free(char *plist_xml); | ||
| 628 | |||
| 629 | /** | ||
| 623 | * Export the #plist_t structure to binary format. | 630 | * Export the #plist_t structure to binary format. |
| 624 | * | 631 | * |
| 625 | * @param plist the root node to export | 632 | * @param plist the root node to export |
| @@ -630,6 +637,13 @@ extern "C" | |||
| 630 | void plist_to_bin(plist_t plist, char **plist_bin, uint32_t * length); | 637 | void plist_to_bin(plist_t plist, char **plist_bin, uint32_t * length); |
| 631 | 638 | ||
| 632 | /** | 639 | /** |
| 640 | * Frees the memory allocated by plist_to_bin(). | ||
| 641 | * | ||
| 642 | * @param plist_bin The buffer allocated by plist_to_bin(). | ||
| 643 | */ | ||
| 644 | void plist_to_bin_free(char *plist_bin); | ||
| 645 | |||
| 646 | /** | ||
| 633 | * Import the #plist_t structure from XML format. | 647 | * Import the #plist_t structure from XML format. |
| 634 | * | 648 | * |
| 635 | * @param plist_xml a pointer to the xml buffer. | 649 | * @param plist_xml a pointer to the xml buffer. |
diff --git a/src/bplist.c b/src/bplist.c index e0e7622..f0b8f0e 100644 --- a/src/bplist.c +++ b/src/bplist.c | |||
| @@ -1379,3 +1379,8 @@ PLIST_API void plist_to_bin(plist_t plist, char **plist_bin, uint32_t * length) | |||
| 1379 | bplist_buff->data = NULL; // make sure we don't free the output buffer | 1379 | bplist_buff->data = NULL; // make sure we don't free the output buffer |
| 1380 | byte_array_free(bplist_buff); | 1380 | byte_array_free(bplist_buff); |
| 1381 | } | 1381 | } |
| 1382 | |||
| 1383 | PLIST_API void plist_to_bin_free(char *plist_bin) | ||
| 1384 | { | ||
| 1385 | free(plist_bin); | ||
| 1386 | } | ||
diff --git a/src/xplist.c b/src/xplist.c index 0cf4663..fa6bb6d 100644 --- a/src/xplist.c +++ b/src/xplist.c | |||
| @@ -531,6 +531,11 @@ PLIST_API void plist_to_xml(plist_t plist, char **plist_xml, uint32_t * length) | |||
| 531 | str_buf_free(outbuf); | 531 | str_buf_free(outbuf); |
| 532 | } | 532 | } |
| 533 | 533 | ||
| 534 | PLIST_API void plist_to_xml_free(char *plist_xml) | ||
| 535 | { | ||
| 536 | free(plist_xml); | ||
| 537 | } | ||
| 538 | |||
| 534 | struct _parse_ctx { | 539 | struct _parse_ctx { |
| 535 | const char *pos; | 540 | const char *pos; |
| 536 | const char *end; | 541 | const char *end; |
