diff options
| author | 2023-05-13 19:53:26 +0200 | |
|---|---|---|
| committer | 2023-05-13 19:53:26 +0200 | |
| commit | 91c0aa8fa82d3fb42c64b0e46bfa861cada5e47d (patch) | |
| tree | 41d3ff96c3dfcd46b5172db9bd418dd62cb780f9 /src/plist.c | |
| parent | 834bb313405bce621610862e76891377ab6601d5 (diff) | |
| download | libplist-91c0aa8fa82d3fb42c64b0e46bfa861cada5e47d.tar.gz libplist-91c0aa8fa82d3fb42c64b0e46bfa861cada5e47d.tar.bz2 | |
Move PLIST_API to the headers
Diffstat (limited to 'src/plist.c')
| -rw-r--r-- | src/plist.c | 166 |
1 files changed, 83 insertions, 83 deletions
diff --git a/src/plist.c b/src/plist.c index e0cb86a..677e398 100644 --- a/src/plist.c +++ b/src/plist.c | |||
| @@ -183,7 +183,7 @@ void* memmem(const void* haystack, size_t haystack_len, const void* needle, size | |||
| 183 | } | 183 | } |
| 184 | #endif | 184 | #endif |
| 185 | 185 | ||
| 186 | PLIST_API int plist_is_binary(const char *plist_data, uint32_t length) | 186 | int plist_is_binary(const char *plist_data, uint32_t length) |
| 187 | { | 187 | { |
| 188 | if (length < 8) { | 188 | if (length < 8) { |
| 189 | return 0; | 189 | return 0; |
| @@ -197,7 +197,7 @@ PLIST_API int plist_is_binary(const char *plist_data, uint32_t length) | |||
| 197 | #define FIND_NEXT(blob, pos, len, chr) \ | 197 | #define FIND_NEXT(blob, pos, len, chr) \ |
| 198 | while (pos < len && (blob[pos] != chr)) pos++; | 198 | while (pos < len && (blob[pos] != chr)) pos++; |
| 199 | 199 | ||
| 200 | PLIST_API plist_err_t plist_from_memory(const char *plist_data, uint32_t length, plist_t *plist, plist_format_t *format) | 200 | plist_err_t plist_from_memory(const char *plist_data, uint32_t length, plist_t *plist, plist_format_t *format) |
| 201 | { | 201 | { |
| 202 | int res = -1; | 202 | int res = -1; |
| 203 | if (!plist) { | 203 | if (!plist) { |
| @@ -266,7 +266,7 @@ PLIST_API plist_err_t plist_from_memory(const char *plist_data, uint32_t length, | |||
| 266 | return res; | 266 | return res; |
| 267 | } | 267 | } |
| 268 | 268 | ||
| 269 | PLIST_API plist_err_t plist_read_from_file(const char *filename, plist_t *plist, plist_format_t *format) | 269 | plist_err_t plist_read_from_file(const char *filename, plist_t *plist, plist_format_t *format) |
| 270 | { | 270 | { |
| 271 | if (!filename || !plist) { | 271 | if (!filename || !plist) { |
| 272 | return PLIST_ERR_INVALID_ARG; | 272 | return PLIST_ERR_INVALID_ARG; |
| @@ -396,14 +396,14 @@ static int plist_free_node(node_t node) | |||
| 396 | return node_index; | 396 | return node_index; |
| 397 | } | 397 | } |
| 398 | 398 | ||
| 399 | PLIST_API plist_t plist_new_dict(void) | 399 | plist_t plist_new_dict(void) |
| 400 | { | 400 | { |
| 401 | plist_data_t data = plist_new_plist_data(); | 401 | plist_data_t data = plist_new_plist_data(); |
| 402 | data->type = PLIST_DICT; | 402 | data->type = PLIST_DICT; |
| 403 | return plist_new_node(data); | 403 | return plist_new_node(data); |
| 404 | } | 404 | } |
| 405 | 405 | ||
| 406 | PLIST_API plist_t plist_new_array(void) | 406 | plist_t plist_new_array(void) |
| 407 | { | 407 | { |
| 408 | plist_data_t data = plist_new_plist_data(); | 408 | plist_data_t data = plist_new_plist_data(); |
| 409 | data->type = PLIST_ARRAY; | 409 | data->type = PLIST_ARRAY; |
| @@ -420,7 +420,7 @@ static plist_t plist_new_key(const char *val) | |||
| 420 | return plist_new_node(data); | 420 | return plist_new_node(data); |
| 421 | } | 421 | } |
| 422 | 422 | ||
| 423 | PLIST_API plist_t plist_new_string(const char *val) | 423 | plist_t plist_new_string(const char *val) |
| 424 | { | 424 | { |
| 425 | plist_data_t data = plist_new_plist_data(); | 425 | plist_data_t data = plist_new_plist_data(); |
| 426 | data->type = PLIST_STRING; | 426 | data->type = PLIST_STRING; |
| @@ -429,7 +429,7 @@ PLIST_API plist_t plist_new_string(const char *val) | |||
| 429 | return plist_new_node(data); | 429 | return plist_new_node(data); |
| 430 | } | 430 | } |
| 431 | 431 | ||
| 432 | PLIST_API plist_t plist_new_bool(uint8_t val) | 432 | plist_t plist_new_bool(uint8_t val) |
| 433 | { | 433 | { |
| 434 | plist_data_t data = plist_new_plist_data(); | 434 | plist_data_t data = plist_new_plist_data(); |
| 435 | data->type = PLIST_BOOLEAN; | 435 | data->type = PLIST_BOOLEAN; |
| @@ -438,7 +438,7 @@ PLIST_API plist_t plist_new_bool(uint8_t val) | |||
| 438 | return plist_new_node(data); | 438 | return plist_new_node(data); |
| 439 | } | 439 | } |
| 440 | 440 | ||
| 441 | PLIST_API plist_t plist_new_uint(uint64_t val) | 441 | plist_t plist_new_uint(uint64_t val) |
| 442 | { | 442 | { |
| 443 | plist_data_t data = plist_new_plist_data(); | 443 | plist_data_t data = plist_new_plist_data(); |
| 444 | data->type = PLIST_INT; | 444 | data->type = PLIST_INT; |
| @@ -447,7 +447,7 @@ PLIST_API plist_t plist_new_uint(uint64_t val) | |||
| 447 | return plist_new_node(data); | 447 | return plist_new_node(data); |
| 448 | } | 448 | } |
| 449 | 449 | ||
| 450 | PLIST_API plist_t plist_new_int(int64_t val) | 450 | plist_t plist_new_int(int64_t val) |
| 451 | { | 451 | { |
| 452 | plist_data_t data = plist_new_plist_data(); | 452 | plist_data_t data = plist_new_plist_data(); |
| 453 | data->type = PLIST_INT; | 453 | data->type = PLIST_INT; |
| @@ -456,7 +456,7 @@ PLIST_API plist_t plist_new_int(int64_t val) | |||
| 456 | return plist_new_node(data); | 456 | return plist_new_node(data); |
| 457 | } | 457 | } |
| 458 | 458 | ||
| 459 | PLIST_API plist_t plist_new_uid(uint64_t val) | 459 | plist_t plist_new_uid(uint64_t val) |
| 460 | { | 460 | { |
| 461 | plist_data_t data = plist_new_plist_data(); | 461 | plist_data_t data = plist_new_plist_data(); |
| 462 | data->type = PLIST_UID; | 462 | data->type = PLIST_UID; |
| @@ -465,7 +465,7 @@ PLIST_API plist_t plist_new_uid(uint64_t val) | |||
| 465 | return plist_new_node(data); | 465 | return plist_new_node(data); |
| 466 | } | 466 | } |
| 467 | 467 | ||
| 468 | PLIST_API plist_t plist_new_real(double val) | 468 | plist_t plist_new_real(double val) |
| 469 | { | 469 | { |
| 470 | plist_data_t data = plist_new_plist_data(); | 470 | plist_data_t data = plist_new_plist_data(); |
| 471 | data->type = PLIST_REAL; | 471 | data->type = PLIST_REAL; |
| @@ -474,7 +474,7 @@ PLIST_API plist_t plist_new_real(double val) | |||
| 474 | return plist_new_node(data); | 474 | return plist_new_node(data); |
| 475 | } | 475 | } |
| 476 | 476 | ||
| 477 | PLIST_API plist_t plist_new_data(const char *val, uint64_t length) | 477 | plist_t plist_new_data(const char *val, uint64_t length) |
| 478 | { | 478 | { |
| 479 | plist_data_t data = plist_new_plist_data(); | 479 | plist_data_t data = plist_new_plist_data(); |
| 480 | data->type = PLIST_DATA; | 480 | data->type = PLIST_DATA; |
| @@ -484,7 +484,7 @@ PLIST_API plist_t plist_new_data(const char *val, uint64_t length) | |||
| 484 | return plist_new_node(data); | 484 | return plist_new_node(data); |
| 485 | } | 485 | } |
| 486 | 486 | ||
| 487 | PLIST_API plist_t plist_new_date(int32_t sec, int32_t usec) | 487 | plist_t plist_new_date(int32_t sec, int32_t usec) |
| 488 | { | 488 | { |
| 489 | plist_data_t data = plist_new_plist_data(); | 489 | plist_data_t data = plist_new_plist_data(); |
| 490 | data->type = PLIST_DATE; | 490 | data->type = PLIST_DATE; |
| @@ -493,7 +493,7 @@ PLIST_API plist_t plist_new_date(int32_t sec, int32_t usec) | |||
| 493 | return plist_new_node(data); | 493 | return plist_new_node(data); |
| 494 | } | 494 | } |
| 495 | 495 | ||
| 496 | PLIST_API plist_t plist_new_null(void) | 496 | plist_t plist_new_null(void) |
| 497 | { | 497 | { |
| 498 | plist_data_t data = plist_new_plist_data(); | 498 | plist_data_t data = plist_new_plist_data(); |
| 499 | data->type = PLIST_NULL; | 499 | data->type = PLIST_NULL; |
| @@ -502,7 +502,7 @@ PLIST_API plist_t plist_new_null(void) | |||
| 502 | return plist_new_node(data); | 502 | return plist_new_node(data); |
| 503 | } | 503 | } |
| 504 | 504 | ||
| 505 | PLIST_API void plist_free(plist_t plist) | 505 | void plist_free(plist_t plist) |
| 506 | { | 506 | { |
| 507 | if (plist) | 507 | if (plist) |
| 508 | { | 508 | { |
| @@ -510,7 +510,7 @@ PLIST_API void plist_free(plist_t plist) | |||
| 510 | } | 510 | } |
| 511 | } | 511 | } |
| 512 | 512 | ||
| 513 | PLIST_API void plist_mem_free(void* ptr) | 513 | void plist_mem_free(void* ptr) |
| 514 | { | 514 | { |
| 515 | if (ptr) | 515 | if (ptr) |
| 516 | { | 516 | { |
| @@ -586,12 +586,12 @@ static plist_t plist_copy_node(node_t node) | |||
| 586 | return newnode; | 586 | return newnode; |
| 587 | } | 587 | } |
| 588 | 588 | ||
| 589 | PLIST_API plist_t plist_copy(plist_t node) | 589 | plist_t plist_copy(plist_t node) |
| 590 | { | 590 | { |
| 591 | return node ? plist_copy_node(node) : NULL; | 591 | return node ? plist_copy_node(node) : NULL; |
| 592 | } | 592 | } |
| 593 | 593 | ||
| 594 | PLIST_API uint32_t plist_array_get_size(plist_t node) | 594 | uint32_t plist_array_get_size(plist_t node) |
| 595 | { | 595 | { |
| 596 | uint32_t ret = 0; | 596 | uint32_t ret = 0; |
| 597 | if (node && PLIST_ARRAY == plist_get_node_type(node)) | 597 | if (node && PLIST_ARRAY == plist_get_node_type(node)) |
| @@ -601,7 +601,7 @@ PLIST_API uint32_t plist_array_get_size(plist_t node) | |||
| 601 | return ret; | 601 | return ret; |
| 602 | } | 602 | } |
| 603 | 603 | ||
| 604 | PLIST_API plist_t plist_array_get_item(plist_t node, uint32_t n) | 604 | plist_t plist_array_get_item(plist_t node, uint32_t n) |
| 605 | { | 605 | { |
| 606 | plist_t ret = NULL; | 606 | plist_t ret = NULL; |
| 607 | if (node && PLIST_ARRAY == plist_get_node_type(node) && n < INT_MAX) | 607 | if (node && PLIST_ARRAY == plist_get_node_type(node) && n < INT_MAX) |
| @@ -616,7 +616,7 @@ PLIST_API plist_t plist_array_get_item(plist_t node, uint32_t n) | |||
| 616 | return ret; | 616 | return ret; |
| 617 | } | 617 | } |
| 618 | 618 | ||
| 619 | PLIST_API uint32_t plist_array_get_item_index(plist_t node) | 619 | uint32_t plist_array_get_item_index(plist_t node) |
| 620 | { | 620 | { |
| 621 | plist_t father = plist_get_parent(node); | 621 | plist_t father = plist_get_parent(node); |
| 622 | if (PLIST_ARRAY == plist_get_node_type(father)) | 622 | if (PLIST_ARRAY == plist_get_node_type(father)) |
| @@ -648,7 +648,7 @@ static void _plist_array_post_insert(plist_t node, plist_t item, long n) | |||
| 648 | } | 648 | } |
| 649 | } | 649 | } |
| 650 | 650 | ||
| 651 | PLIST_API void plist_array_set_item(plist_t node, plist_t item, uint32_t n) | 651 | void plist_array_set_item(plist_t node, plist_t item, uint32_t n) |
| 652 | { | 652 | { |
| 653 | if (node && PLIST_ARRAY == plist_get_node_type(node) && n < INT_MAX) | 653 | if (node && PLIST_ARRAY == plist_get_node_type(node) && n < INT_MAX) |
| 654 | { | 654 | { |
| @@ -669,7 +669,7 @@ PLIST_API void plist_array_set_item(plist_t node, plist_t item, uint32_t n) | |||
| 669 | } | 669 | } |
| 670 | } | 670 | } |
| 671 | 671 | ||
| 672 | PLIST_API void plist_array_append_item(plist_t node, plist_t item) | 672 | void plist_array_append_item(plist_t node, plist_t item) |
| 673 | { | 673 | { |
| 674 | if (node && PLIST_ARRAY == plist_get_node_type(node)) | 674 | if (node && PLIST_ARRAY == plist_get_node_type(node)) |
| 675 | { | 675 | { |
| @@ -678,7 +678,7 @@ PLIST_API void plist_array_append_item(plist_t node, plist_t item) | |||
| 678 | } | 678 | } |
| 679 | } | 679 | } |
| 680 | 680 | ||
| 681 | PLIST_API void plist_array_insert_item(plist_t node, plist_t item, uint32_t n) | 681 | void plist_array_insert_item(plist_t node, plist_t item, uint32_t n) |
| 682 | { | 682 | { |
| 683 | if (node && PLIST_ARRAY == plist_get_node_type(node) && n < INT_MAX) | 683 | if (node && PLIST_ARRAY == plist_get_node_type(node) && n < INT_MAX) |
| 684 | { | 684 | { |
| @@ -687,7 +687,7 @@ PLIST_API void plist_array_insert_item(plist_t node, plist_t item, uint32_t n) | |||
| 687 | } | 687 | } |
| 688 | } | 688 | } |
| 689 | 689 | ||
| 690 | PLIST_API void plist_array_remove_item(plist_t node, uint32_t n) | 690 | void plist_array_remove_item(plist_t node, uint32_t n) |
| 691 | { | 691 | { |
| 692 | if (node && PLIST_ARRAY == plist_get_node_type(node) && n < INT_MAX) | 692 | if (node && PLIST_ARRAY == plist_get_node_type(node) && n < INT_MAX) |
| 693 | { | 693 | { |
| @@ -703,7 +703,7 @@ PLIST_API void plist_array_remove_item(plist_t node, uint32_t n) | |||
| 703 | } | 703 | } |
| 704 | } | 704 | } |
| 705 | 705 | ||
| 706 | PLIST_API void plist_array_item_remove(plist_t node) | 706 | void plist_array_item_remove(plist_t node) |
| 707 | { | 707 | { |
| 708 | plist_t father = plist_get_parent(node); | 708 | plist_t father = plist_get_parent(node); |
| 709 | if (PLIST_ARRAY == plist_get_node_type(father)) | 709 | if (PLIST_ARRAY == plist_get_node_type(father)) |
| @@ -718,7 +718,7 @@ PLIST_API void plist_array_item_remove(plist_t node) | |||
| 718 | } | 718 | } |
| 719 | } | 719 | } |
| 720 | 720 | ||
| 721 | PLIST_API void plist_array_new_iter(plist_t node, plist_array_iter *iter) | 721 | void plist_array_new_iter(plist_t node, plist_array_iter *iter) |
| 722 | { | 722 | { |
| 723 | if (iter) | 723 | if (iter) |
| 724 | { | 724 | { |
| @@ -727,7 +727,7 @@ PLIST_API void plist_array_new_iter(plist_t node, plist_array_iter *iter) | |||
| 727 | } | 727 | } |
| 728 | } | 728 | } |
| 729 | 729 | ||
| 730 | PLIST_API void plist_array_next_item(plist_t node, plist_array_iter iter, plist_t *item) | 730 | void plist_array_next_item(plist_t node, plist_array_iter iter, plist_t *item) |
| 731 | { | 731 | { |
| 732 | node_t* iter_node = (node_t*)iter; | 732 | node_t* iter_node = (node_t*)iter; |
| 733 | 733 | ||
| @@ -746,7 +746,7 @@ PLIST_API void plist_array_next_item(plist_t node, plist_array_iter iter, plist_ | |||
| 746 | } | 746 | } |
| 747 | } | 747 | } |
| 748 | 748 | ||
| 749 | PLIST_API uint32_t plist_dict_get_size(plist_t node) | 749 | uint32_t plist_dict_get_size(plist_t node) |
| 750 | { | 750 | { |
| 751 | uint32_t ret = 0; | 751 | uint32_t ret = 0; |
| 752 | if (node && PLIST_DICT == plist_get_node_type(node)) | 752 | if (node && PLIST_DICT == plist_get_node_type(node)) |
| @@ -756,7 +756,7 @@ PLIST_API uint32_t plist_dict_get_size(plist_t node) | |||
| 756 | return ret; | 756 | return ret; |
| 757 | } | 757 | } |
| 758 | 758 | ||
| 759 | PLIST_API void plist_dict_new_iter(plist_t node, plist_dict_iter *iter) | 759 | void plist_dict_new_iter(plist_t node, plist_dict_iter *iter) |
| 760 | { | 760 | { |
| 761 | if (iter) | 761 | if (iter) |
| 762 | { | 762 | { |
| @@ -765,7 +765,7 @@ PLIST_API void plist_dict_new_iter(plist_t node, plist_dict_iter *iter) | |||
| 765 | } | 765 | } |
| 766 | } | 766 | } |
| 767 | 767 | ||
| 768 | PLIST_API void plist_dict_next_item(plist_t node, plist_dict_iter iter, char **key, plist_t *val) | 768 | void plist_dict_next_item(plist_t node, plist_dict_iter iter, char **key, plist_t *val) |
| 769 | { | 769 | { |
| 770 | node_t* iter_node = (node_t*)iter; | 770 | node_t* iter_node = (node_t*)iter; |
| 771 | 771 | ||
| @@ -793,7 +793,7 @@ PLIST_API void plist_dict_next_item(plist_t node, plist_dict_iter iter, char **k | |||
| 793 | } | 793 | } |
| 794 | } | 794 | } |
| 795 | 795 | ||
| 796 | PLIST_API void plist_dict_get_item_key(plist_t node, char **key) | 796 | void plist_dict_get_item_key(plist_t node, char **key) |
| 797 | { | 797 | { |
| 798 | plist_t father = plist_get_parent(node); | 798 | plist_t father = plist_get_parent(node); |
| 799 | if (PLIST_DICT == plist_get_node_type(father)) | 799 | if (PLIST_DICT == plist_get_node_type(father)) |
| @@ -802,7 +802,7 @@ PLIST_API void plist_dict_get_item_key(plist_t node, char **key) | |||
| 802 | } | 802 | } |
| 803 | } | 803 | } |
| 804 | 804 | ||
| 805 | PLIST_API plist_t plist_dict_item_get_key(plist_t node) | 805 | plist_t plist_dict_item_get_key(plist_t node) |
| 806 | { | 806 | { |
| 807 | plist_t ret = NULL; | 807 | plist_t ret = NULL; |
| 808 | plist_t father = plist_get_parent(node); | 808 | plist_t father = plist_get_parent(node); |
| @@ -813,7 +813,7 @@ PLIST_API plist_t plist_dict_item_get_key(plist_t node) | |||
| 813 | return ret; | 813 | return ret; |
| 814 | } | 814 | } |
| 815 | 815 | ||
| 816 | PLIST_API plist_t plist_dict_get_item(plist_t node, const char* key) | 816 | plist_t plist_dict_get_item(plist_t node, const char* key) |
| 817 | { | 817 | { |
| 818 | plist_t ret = NULL; | 818 | plist_t ret = NULL; |
| 819 | 819 | ||
| @@ -846,7 +846,7 @@ PLIST_API plist_t plist_dict_get_item(plist_t node, const char* key) | |||
| 846 | return ret; | 846 | return ret; |
| 847 | } | 847 | } |
| 848 | 848 | ||
| 849 | PLIST_API void plist_dict_set_item(plist_t node, const char* key, plist_t item) | 849 | void plist_dict_set_item(plist_t node, const char* key, plist_t item) |
| 850 | { | 850 | { |
| 851 | if (node && PLIST_DICT == plist_get_node_type(node)) { | 851 | if (node && PLIST_DICT == plist_get_node_type(node)) { |
| 852 | node_t old_item = plist_dict_get_item(node, key); | 852 | node_t old_item = plist_dict_get_item(node, key); |
| @@ -887,7 +887,7 @@ PLIST_API void plist_dict_set_item(plist_t node, const char* key, plist_t item) | |||
| 887 | } | 887 | } |
| 888 | } | 888 | } |
| 889 | 889 | ||
| 890 | PLIST_API void plist_dict_remove_item(plist_t node, const char* key) | 890 | void plist_dict_remove_item(plist_t node, const char* key) |
| 891 | { | 891 | { |
| 892 | if (node && PLIST_DICT == plist_get_node_type(node)) | 892 | if (node && PLIST_DICT == plist_get_node_type(node)) |
| 893 | { | 893 | { |
| @@ -905,7 +905,7 @@ PLIST_API void plist_dict_remove_item(plist_t node, const char* key) | |||
| 905 | } | 905 | } |
| 906 | } | 906 | } |
| 907 | 907 | ||
| 908 | PLIST_API void plist_dict_merge(plist_t *target, plist_t source) | 908 | void plist_dict_merge(plist_t *target, plist_t source) |
| 909 | { | 909 | { |
| 910 | if (!target || !*target || (plist_get_node_type(*target) != PLIST_DICT) || !source || (plist_get_node_type(source) != PLIST_DICT)) | 910 | if (!target || !*target || (plist_get_node_type(*target) != PLIST_DICT) || !source || (plist_get_node_type(source) != PLIST_DICT)) |
| 911 | return; | 911 | return; |
| @@ -929,7 +929,7 @@ PLIST_API void plist_dict_merge(plist_t *target, plist_t source) | |||
| 929 | free(it); | 929 | free(it); |
| 930 | } | 930 | } |
| 931 | 931 | ||
| 932 | PLIST_API plist_t plist_access_pathv(plist_t plist, uint32_t length, va_list v) | 932 | plist_t plist_access_pathv(plist_t plist, uint32_t length, va_list v) |
| 933 | { | 933 | { |
| 934 | plist_t current = plist; | 934 | plist_t current = plist; |
| 935 | plist_type type = PLIST_NONE; | 935 | plist_type type = PLIST_NONE; |
| @@ -953,7 +953,7 @@ PLIST_API plist_t plist_access_pathv(plist_t plist, uint32_t length, va_list v) | |||
| 953 | return current; | 953 | return current; |
| 954 | } | 954 | } |
| 955 | 955 | ||
| 956 | PLIST_API plist_t plist_access_path(plist_t plist, uint32_t length, ...) | 956 | plist_t plist_access_path(plist_t plist, uint32_t length, ...) |
| 957 | { | 957 | { |
| 958 | plist_t ret = NULL; | 958 | plist_t ret = NULL; |
| 959 | va_list v; | 959 | va_list v; |
| @@ -1004,12 +1004,12 @@ static void plist_get_type_and_value(plist_t node, plist_type * type, void *valu | |||
| 1004 | } | 1004 | } |
| 1005 | } | 1005 | } |
| 1006 | 1006 | ||
| 1007 | PLIST_API plist_t plist_get_parent(plist_t node) | 1007 | plist_t plist_get_parent(plist_t node) |
| 1008 | { | 1008 | { |
| 1009 | return node ? (plist_t) ((node_t) node)->parent : NULL; | 1009 | return node ? (plist_t) ((node_t) node)->parent : NULL; |
| 1010 | } | 1010 | } |
| 1011 | 1011 | ||
| 1012 | PLIST_API plist_type plist_get_node_type(plist_t node) | 1012 | plist_type plist_get_node_type(plist_t node) |
| 1013 | { | 1013 | { |
| 1014 | if (node) | 1014 | if (node) |
| 1015 | { | 1015 | { |
| @@ -1020,7 +1020,7 @@ PLIST_API plist_type plist_get_node_type(plist_t node) | |||
| 1020 | return PLIST_NONE; | 1020 | return PLIST_NONE; |
| 1021 | } | 1021 | } |
| 1022 | 1022 | ||
| 1023 | PLIST_API void plist_get_key_val(plist_t node, char **val) | 1023 | void plist_get_key_val(plist_t node, char **val) |
| 1024 | { | 1024 | { |
| 1025 | if (!node || !val) | 1025 | if (!node || !val) |
| 1026 | return; | 1026 | return; |
| @@ -1034,7 +1034,7 @@ PLIST_API void plist_get_key_val(plist_t node, char **val) | |||
| 1034 | assert(length == strlen(*val)); | 1034 | assert(length == strlen(*val)); |
| 1035 | } | 1035 | } |
| 1036 | 1036 | ||
| 1037 | PLIST_API void plist_get_string_val(plist_t node, char **val) | 1037 | void plist_get_string_val(plist_t node, char **val) |
| 1038 | { | 1038 | { |
| 1039 | if (!node || !val) | 1039 | if (!node || !val) |
| 1040 | return; | 1040 | return; |
| @@ -1048,7 +1048,7 @@ PLIST_API void plist_get_string_val(plist_t node, char **val) | |||
| 1048 | assert(length == strlen(*val)); | 1048 | assert(length == strlen(*val)); |
| 1049 | } | 1049 | } |
| 1050 | 1050 | ||
| 1051 | PLIST_API const char* plist_get_string_ptr(plist_t node, uint64_t* length) | 1051 | const char* plist_get_string_ptr(plist_t node, uint64_t* length) |
| 1052 | { | 1052 | { |
| 1053 | if (!node) | 1053 | if (!node) |
| 1054 | return NULL; | 1054 | return NULL; |
| @@ -1061,7 +1061,7 @@ PLIST_API const char* plist_get_string_ptr(plist_t node, uint64_t* length) | |||
| 1061 | return (const char*)data->strval; | 1061 | return (const char*)data->strval; |
| 1062 | } | 1062 | } |
| 1063 | 1063 | ||
| 1064 | PLIST_API void plist_get_bool_val(plist_t node, uint8_t * val) | 1064 | void plist_get_bool_val(plist_t node, uint8_t * val) |
| 1065 | { | 1065 | { |
| 1066 | if (!node || !val) | 1066 | if (!node || !val) |
| 1067 | return; | 1067 | return; |
| @@ -1073,7 +1073,7 @@ PLIST_API void plist_get_bool_val(plist_t node, uint8_t * val) | |||
| 1073 | assert(length == sizeof(uint8_t)); | 1073 | assert(length == sizeof(uint8_t)); |
| 1074 | } | 1074 | } |
| 1075 | 1075 | ||
| 1076 | PLIST_API void plist_get_uint_val(plist_t node, uint64_t * val) | 1076 | void plist_get_uint_val(plist_t node, uint64_t * val) |
| 1077 | { | 1077 | { |
| 1078 | if (!node || !val) | 1078 | if (!node || !val) |
| 1079 | return; | 1079 | return; |
| @@ -1085,12 +1085,12 @@ PLIST_API void plist_get_uint_val(plist_t node, uint64_t * val) | |||
| 1085 | assert(length == sizeof(uint64_t) || length == 16); | 1085 | assert(length == sizeof(uint64_t) || length == 16); |
| 1086 | } | 1086 | } |
| 1087 | 1087 | ||
| 1088 | PLIST_API void plist_get_int_val(plist_t node, int64_t * val) | 1088 | void plist_get_int_val(plist_t node, int64_t * val) |
| 1089 | { | 1089 | { |
| 1090 | plist_get_uint_val(node, (uint64_t*)val); | 1090 | plist_get_uint_val(node, (uint64_t*)val); |
| 1091 | } | 1091 | } |
| 1092 | 1092 | ||
| 1093 | PLIST_API void plist_get_uid_val(plist_t node, uint64_t * val) | 1093 | void plist_get_uid_val(plist_t node, uint64_t * val) |
| 1094 | { | 1094 | { |
| 1095 | if (!node || !val) | 1095 | if (!node || !val) |
| 1096 | return; | 1096 | return; |
| @@ -1102,7 +1102,7 @@ PLIST_API void plist_get_uid_val(plist_t node, uint64_t * val) | |||
| 1102 | assert(length == sizeof(uint64_t)); | 1102 | assert(length == sizeof(uint64_t)); |
| 1103 | } | 1103 | } |
| 1104 | 1104 | ||
| 1105 | PLIST_API void plist_get_real_val(plist_t node, double *val) | 1105 | void plist_get_real_val(plist_t node, double *val) |
| 1106 | { | 1106 | { |
| 1107 | if (!node || !val) | 1107 | if (!node || !val) |
| 1108 | return; | 1108 | return; |
| @@ -1114,7 +1114,7 @@ PLIST_API void plist_get_real_val(plist_t node, double *val) | |||
| 1114 | assert(length == sizeof(double)); | 1114 | assert(length == sizeof(double)); |
| 1115 | } | 1115 | } |
| 1116 | 1116 | ||
| 1117 | PLIST_API void plist_get_data_val(plist_t node, char **val, uint64_t * length) | 1117 | void plist_get_data_val(plist_t node, char **val, uint64_t * length) |
| 1118 | { | 1118 | { |
| 1119 | if (!node || !val || !length) | 1119 | if (!node || !val || !length) |
| 1120 | return; | 1120 | return; |
| @@ -1124,7 +1124,7 @@ PLIST_API void plist_get_data_val(plist_t node, char **val, uint64_t * length) | |||
| 1124 | plist_get_type_and_value(node, &type, (void *) val, length); | 1124 | plist_get_type_and_value(node, &type, (void *) val, length); |
| 1125 | } | 1125 | } |
| 1126 | 1126 | ||
| 1127 | PLIST_API const char* plist_get_data_ptr(plist_t node, uint64_t* length) | 1127 | const char* plist_get_data_ptr(plist_t node, uint64_t* length) |
| 1128 | { | 1128 | { |
| 1129 | if (!node || !length) | 1129 | if (!node || !length) |
| 1130 | return NULL; | 1130 | return NULL; |
| @@ -1136,7 +1136,7 @@ PLIST_API const char* plist_get_data_ptr(plist_t node, uint64_t* length) | |||
| 1136 | return (const char*)data->buff; | 1136 | return (const char*)data->buff; |
| 1137 | } | 1137 | } |
| 1138 | 1138 | ||
| 1139 | PLIST_API void plist_get_date_val(plist_t node, int32_t * sec, int32_t * usec) | 1139 | void plist_get_date_val(plist_t node, int32_t * sec, int32_t * usec) |
| 1140 | { | 1140 | { |
| 1141 | if (!node) | 1141 | if (!node) |
| 1142 | return; | 1142 | return; |
| @@ -1205,7 +1205,7 @@ int plist_data_compare(const void *a, const void *b) | |||
| 1205 | return FALSE; | 1205 | return FALSE; |
| 1206 | } | 1206 | } |
| 1207 | 1207 | ||
| 1208 | PLIST_API char plist_compare_node_value(plist_t node_l, plist_t node_r) | 1208 | char plist_compare_node_value(plist_t node_l, plist_t node_r) |
| 1209 | { | 1209 | { |
| 1210 | return plist_data_compare(node_l, node_r); | 1210 | return plist_data_compare(node_l, node_r); |
| 1211 | } | 1211 | } |
| @@ -1264,7 +1264,7 @@ static void plist_set_element_val(plist_t node, plist_type type, const void *val | |||
| 1264 | } | 1264 | } |
| 1265 | } | 1265 | } |
| 1266 | 1266 | ||
| 1267 | PLIST_API void plist_set_key_val(plist_t node, const char *val) | 1267 | void plist_set_key_val(plist_t node, const char *val) |
| 1268 | { | 1268 | { |
| 1269 | plist_t father = plist_get_parent(node); | 1269 | plist_t father = plist_get_parent(node); |
| 1270 | plist_t item = plist_dict_get_item(father, val); | 1270 | plist_t item = plist_dict_get_item(father, val); |
| @@ -1274,48 +1274,48 @@ PLIST_API void plist_set_key_val(plist_t node, const char *val) | |||
| 1274 | plist_set_element_val(node, PLIST_KEY, val, strlen(val)); | 1274 | plist_set_element_val(node, PLIST_KEY, val, strlen(val)); |
| 1275 | } | 1275 | } |
| 1276 | 1276 | ||
| 1277 | PLIST_API void plist_set_string_val(plist_t node, const char *val) | 1277 | void plist_set_string_val(plist_t node, const char *val) |
| 1278 | { | 1278 | { |
| 1279 | plist_set_element_val(node, PLIST_STRING, val, strlen(val)); | 1279 | plist_set_element_val(node, PLIST_STRING, val, strlen(val)); |
| 1280 | } | 1280 | } |
| 1281 | 1281 | ||
| 1282 | PLIST_API void plist_set_bool_val(plist_t node, uint8_t val) | 1282 | void plist_set_bool_val(plist_t node, uint8_t val) |
| 1283 | { | 1283 | { |
| 1284 | plist_set_element_val(node, PLIST_BOOLEAN, &val, sizeof(uint8_t)); | 1284 | plist_set_element_val(node, PLIST_BOOLEAN, &val, sizeof(uint8_t)); |
| 1285 | } | 1285 | } |
| 1286 | 1286 | ||
| 1287 | PLIST_API void plist_set_uint_val(plist_t node, uint64_t val) | 1287 | void plist_set_uint_val(plist_t node, uint64_t val) |
| 1288 | { | 1288 | { |
| 1289 | plist_set_element_val(node, PLIST_INT, &val, (val > INT64_MAX) ? sizeof(uint64_t)*2 : sizeof(uint64_t)); | 1289 | plist_set_element_val(node, PLIST_INT, &val, (val > INT64_MAX) ? sizeof(uint64_t)*2 : sizeof(uint64_t)); |
| 1290 | } | 1290 | } |
| 1291 | 1291 | ||
| 1292 | PLIST_API void plist_set_int_val(plist_t node, int64_t val) | 1292 | void plist_set_int_val(plist_t node, int64_t val) |
| 1293 | { | 1293 | { |
| 1294 | plist_set_element_val(node, PLIST_INT, &val, sizeof(uint64_t)); | 1294 | plist_set_element_val(node, PLIST_INT, &val, sizeof(uint64_t)); |
| 1295 | } | 1295 | } |
| 1296 | 1296 | ||
| 1297 | PLIST_API void plist_set_uid_val(plist_t node, uint64_t val) | 1297 | void plist_set_uid_val(plist_t node, uint64_t val) |
| 1298 | { | 1298 | { |
| 1299 | plist_set_element_val(node, PLIST_UID, &val, sizeof(uint64_t)); | 1299 | plist_set_element_val(node, PLIST_UID, &val, sizeof(uint64_t)); |
| 1300 | } | 1300 | } |
| 1301 | 1301 | ||
| 1302 | PLIST_API void plist_set_real_val(plist_t node, double val) | 1302 | void plist_set_real_val(plist_t node, double val) |
| 1303 | { | 1303 | { |
| 1304 | plist_set_element_val(node, PLIST_REAL, &val, sizeof(double)); | 1304 | plist_set_element_val(node, PLIST_REAL, &val, sizeof(double)); |
| 1305 | } | 1305 | } |
| 1306 | 1306 | ||
| 1307 | PLIST_API void plist_set_data_val(plist_t node, const char *val, uint64_t length) | 1307 | void plist_set_data_val(plist_t node, const char *val, uint64_t length) |
| 1308 | { | 1308 | { |
| 1309 | plist_set_element_val(node, PLIST_DATA, val, length); | 1309 | plist_set_element_val(node, PLIST_DATA, val, length); |
| 1310 | } | 1310 | } |
| 1311 | 1311 | ||
| 1312 | PLIST_API void plist_set_date_val(plist_t node, int32_t sec, int32_t usec) | 1312 | void plist_set_date_val(plist_t node, int32_t sec, int32_t usec) |
| 1313 | { | 1313 | { |
| 1314 | double val = (double)sec + (double)usec / 1000000; | 1314 | double val = (double)sec + (double)usec / 1000000; |
| 1315 | plist_set_element_val(node, PLIST_DATE, &val, sizeof(struct timeval)); | 1315 | plist_set_element_val(node, PLIST_DATE, &val, sizeof(struct timeval)); |
| 1316 | } | 1316 | } |
| 1317 | 1317 | ||
| 1318 | PLIST_API int plist_bool_val_is_true(plist_t boolnode) | 1318 | int plist_bool_val_is_true(plist_t boolnode) |
| 1319 | { | 1319 | { |
| 1320 | if (!PLIST_IS_BOOLEAN(boolnode)) { | 1320 | if (!PLIST_IS_BOOLEAN(boolnode)) { |
| 1321 | return 0; | 1321 | return 0; |
| @@ -1325,7 +1325,7 @@ PLIST_API int plist_bool_val_is_true(plist_t boolnode) | |||
| 1325 | return (bv == 1); | 1325 | return (bv == 1); |
| 1326 | } | 1326 | } |
| 1327 | 1327 | ||
| 1328 | PLIST_API int plist_int_val_is_negative(plist_t intnode) | 1328 | int plist_int_val_is_negative(plist_t intnode) |
| 1329 | { | 1329 | { |
| 1330 | if (!PLIST_IS_INT(intnode)) { | 1330 | if (!PLIST_IS_INT(intnode)) { |
| 1331 | return 0; | 1331 | return 0; |
| @@ -1340,7 +1340,7 @@ PLIST_API int plist_int_val_is_negative(plist_t intnode) | |||
| 1340 | return 0; | 1340 | return 0; |
| 1341 | } | 1341 | } |
| 1342 | 1342 | ||
| 1343 | PLIST_API int plist_int_val_compare(plist_t uintnode, int64_t cmpval) | 1343 | int plist_int_val_compare(plist_t uintnode, int64_t cmpval) |
| 1344 | { | 1344 | { |
| 1345 | if (!PLIST_IS_INT(uintnode)) { | 1345 | if (!PLIST_IS_INT(uintnode)) { |
| 1346 | return -1; | 1346 | return -1; |
| @@ -1358,7 +1358,7 @@ PLIST_API int plist_int_val_compare(plist_t uintnode, int64_t cmpval) | |||
| 1358 | return 1; | 1358 | return 1; |
| 1359 | } | 1359 | } |
| 1360 | 1360 | ||
| 1361 | PLIST_API int plist_uint_val_compare(plist_t uintnode, uint64_t cmpval) | 1361 | int plist_uint_val_compare(plist_t uintnode, uint64_t cmpval) |
| 1362 | { | 1362 | { |
| 1363 | if (!PLIST_IS_INT(uintnode)) { | 1363 | if (!PLIST_IS_INT(uintnode)) { |
| 1364 | return -1; | 1364 | return -1; |
| @@ -1376,7 +1376,7 @@ PLIST_API int plist_uint_val_compare(plist_t uintnode, uint64_t cmpval) | |||
| 1376 | return 1; | 1376 | return 1; |
| 1377 | } | 1377 | } |
| 1378 | 1378 | ||
| 1379 | PLIST_API int plist_uid_val_compare(plist_t uidnode, uint64_t cmpval) | 1379 | int plist_uid_val_compare(plist_t uidnode, uint64_t cmpval) |
| 1380 | { | 1380 | { |
| 1381 | if (!PLIST_IS_UID(uidnode)) { | 1381 | if (!PLIST_IS_UID(uidnode)) { |
| 1382 | return -1; | 1382 | return -1; |
| @@ -1394,7 +1394,7 @@ PLIST_API int plist_uid_val_compare(plist_t uidnode, uint64_t cmpval) | |||
| 1394 | return 1; | 1394 | return 1; |
| 1395 | } | 1395 | } |
| 1396 | 1396 | ||
| 1397 | PLIST_API int plist_real_val_compare(plist_t realnode, double cmpval) | 1397 | int plist_real_val_compare(plist_t realnode, double cmpval) |
| 1398 | { | 1398 | { |
| 1399 | if (!PLIST_IS_REAL(realnode)) { | 1399 | if (!PLIST_IS_REAL(realnode)) { |
| 1400 | return -1; | 1400 | return -1; |
| @@ -1429,7 +1429,7 @@ PLIST_API int plist_real_val_compare(plist_t realnode, double cmpval) | |||
| 1429 | return 1; | 1429 | return 1; |
| 1430 | } | 1430 | } |
| 1431 | 1431 | ||
| 1432 | PLIST_API int plist_date_val_compare(plist_t datenode, int32_t cmpsec, int32_t cmpusec) | 1432 | int plist_date_val_compare(plist_t datenode, int32_t cmpsec, int32_t cmpusec) |
| 1433 | { | 1433 | { |
| 1434 | if (!PLIST_IS_DATE(datenode)) { | 1434 | if (!PLIST_IS_DATE(datenode)) { |
| 1435 | return -1; | 1435 | return -1; |
| @@ -1450,7 +1450,7 @@ PLIST_API int plist_date_val_compare(plist_t datenode, int32_t cmpsec, int32_t c | |||
| 1450 | return 1; | 1450 | return 1; |
| 1451 | } | 1451 | } |
| 1452 | 1452 | ||
| 1453 | PLIST_API int plist_string_val_compare(plist_t strnode, const char* cmpval) | 1453 | int plist_string_val_compare(plist_t strnode, const char* cmpval) |
| 1454 | { | 1454 | { |
| 1455 | if (!PLIST_IS_STRING(strnode)) { | 1455 | if (!PLIST_IS_STRING(strnode)) { |
| 1456 | return -1; | 1456 | return -1; |
| @@ -1459,7 +1459,7 @@ PLIST_API int plist_string_val_compare(plist_t strnode, const char* cmpval) | |||
| 1459 | return strcmp(data->strval, cmpval); | 1459 | return strcmp(data->strval, cmpval); |
| 1460 | } | 1460 | } |
| 1461 | 1461 | ||
| 1462 | PLIST_API int plist_string_val_compare_with_size(plist_t strnode, const char* cmpval, size_t n) | 1462 | int plist_string_val_compare_with_size(plist_t strnode, const char* cmpval, size_t n) |
| 1463 | { | 1463 | { |
| 1464 | if (!PLIST_IS_STRING(strnode)) { | 1464 | if (!PLIST_IS_STRING(strnode)) { |
| 1465 | return -1; | 1465 | return -1; |
| @@ -1468,7 +1468,7 @@ PLIST_API int plist_string_val_compare_with_size(plist_t strnode, const char* cm | |||
| 1468 | return strncmp(data->strval, cmpval, n); | 1468 | return strncmp(data->strval, cmpval, n); |
| 1469 | } | 1469 | } |
| 1470 | 1470 | ||
| 1471 | PLIST_API int plist_string_val_contains(plist_t strnode, const char* substr) | 1471 | int plist_string_val_contains(plist_t strnode, const char* substr) |
| 1472 | { | 1472 | { |
| 1473 | if (!PLIST_IS_STRING(strnode)) { | 1473 | if (!PLIST_IS_STRING(strnode)) { |
| 1474 | return 0; | 1474 | return 0; |
| @@ -1477,7 +1477,7 @@ PLIST_API int plist_string_val_contains(plist_t strnode, const char* substr) | |||
| 1477 | return (strstr(data->strval, substr) != NULL); | 1477 | return (strstr(data->strval, substr) != NULL); |
| 1478 | } | 1478 | } |
| 1479 | 1479 | ||
| 1480 | PLIST_API int plist_key_val_compare(plist_t keynode, const char* cmpval) | 1480 | int plist_key_val_compare(plist_t keynode, const char* cmpval) |
| 1481 | { | 1481 | { |
| 1482 | if (!PLIST_IS_KEY(keynode)) { | 1482 | if (!PLIST_IS_KEY(keynode)) { |
| 1483 | return -1; | 1483 | return -1; |
| @@ -1486,7 +1486,7 @@ PLIST_API int plist_key_val_compare(plist_t keynode, const char* cmpval) | |||
| 1486 | return strcmp(data->strval, cmpval); | 1486 | return strcmp(data->strval, cmpval); |
| 1487 | } | 1487 | } |
| 1488 | 1488 | ||
| 1489 | PLIST_API int plist_key_val_compare_with_size(plist_t keynode, const char* cmpval, size_t n) | 1489 | int plist_key_val_compare_with_size(plist_t keynode, const char* cmpval, size_t n) |
| 1490 | { | 1490 | { |
| 1491 | if (!PLIST_IS_KEY(keynode)) { | 1491 | if (!PLIST_IS_KEY(keynode)) { |
| 1492 | return -1; | 1492 | return -1; |
| @@ -1495,7 +1495,7 @@ PLIST_API int plist_key_val_compare_with_size(plist_t keynode, const char* cmpva | |||
| 1495 | return strncmp(data->strval, cmpval, n); | 1495 | return strncmp(data->strval, cmpval, n); |
| 1496 | } | 1496 | } |
| 1497 | 1497 | ||
| 1498 | PLIST_API int plist_key_val_contains(plist_t keynode, const char* substr) | 1498 | int plist_key_val_contains(plist_t keynode, const char* substr) |
| 1499 | { | 1499 | { |
| 1500 | if (!PLIST_IS_KEY(keynode)) { | 1500 | if (!PLIST_IS_KEY(keynode)) { |
| 1501 | return 0; | 1501 | return 0; |
| @@ -1504,7 +1504,7 @@ PLIST_API int plist_key_val_contains(plist_t keynode, const char* substr) | |||
| 1504 | return (strstr(data->strval, substr) != NULL); | 1504 | return (strstr(data->strval, substr) != NULL); |
| 1505 | } | 1505 | } |
| 1506 | 1506 | ||
| 1507 | PLIST_API int plist_data_val_compare(plist_t datanode, const uint8_t* cmpval, size_t n) | 1507 | int plist_data_val_compare(plist_t datanode, const uint8_t* cmpval, size_t n) |
| 1508 | { | 1508 | { |
| 1509 | if (!PLIST_IS_DATA(datanode)) { | 1509 | if (!PLIST_IS_DATA(datanode)) { |
| 1510 | return -1; | 1510 | return -1; |
| @@ -1521,7 +1521,7 @@ PLIST_API int plist_data_val_compare(plist_t datanode, const uint8_t* cmpval, si | |||
| 1521 | return memcmp(data->buff, cmpval, n); | 1521 | return memcmp(data->buff, cmpval, n); |
| 1522 | } | 1522 | } |
| 1523 | 1523 | ||
| 1524 | PLIST_API int plist_data_val_compare_with_size(plist_t datanode, const uint8_t* cmpval, size_t n) | 1524 | int plist_data_val_compare_with_size(plist_t datanode, const uint8_t* cmpval, size_t n) |
| 1525 | { | 1525 | { |
| 1526 | if (!PLIST_IS_DATA(datanode)) { | 1526 | if (!PLIST_IS_DATA(datanode)) { |
| 1527 | return -1; | 1527 | return -1; |
| @@ -1533,7 +1533,7 @@ PLIST_API int plist_data_val_compare_with_size(plist_t datanode, const uint8_t* | |||
| 1533 | return memcmp(data->buff, cmpval, n); | 1533 | return memcmp(data->buff, cmpval, n); |
| 1534 | } | 1534 | } |
| 1535 | 1535 | ||
| 1536 | PLIST_API int plist_data_val_contains(plist_t datanode, const uint8_t* cmpval, size_t n) | 1536 | int plist_data_val_contains(plist_t datanode, const uint8_t* cmpval, size_t n) |
| 1537 | { | 1537 | { |
| 1538 | if (!PLIST_IS_DATA(datanode)) { | 1538 | if (!PLIST_IS_DATA(datanode)) { |
| 1539 | return -1; | 1539 | return -1; |
| @@ -1547,7 +1547,7 @@ extern void plist_bin_set_debug(int debug); | |||
| 1547 | extern void plist_json_set_debug(int debug); | 1547 | extern void plist_json_set_debug(int debug); |
| 1548 | extern void plist_ostep_set_debug(int debug); | 1548 | extern void plist_ostep_set_debug(int debug); |
| 1549 | 1549 | ||
| 1550 | PLIST_API void plist_set_debug(int debug) | 1550 | void plist_set_debug(int debug) |
| 1551 | { | 1551 | { |
| 1552 | plist_xml_set_debug(debug); | 1552 | plist_xml_set_debug(debug); |
| 1553 | plist_bin_set_debug(debug); | 1553 | plist_bin_set_debug(debug); |
| @@ -1555,7 +1555,7 @@ PLIST_API void plist_set_debug(int debug) | |||
| 1555 | plist_ostep_set_debug(debug); | 1555 | plist_ostep_set_debug(debug); |
| 1556 | } | 1556 | } |
| 1557 | 1557 | ||
| 1558 | PLIST_API void plist_sort(plist_t plist) | 1558 | void plist_sort(plist_t plist) |
| 1559 | { | 1559 | { |
| 1560 | if (!plist) { | 1560 | if (!plist) { |
| 1561 | return; | 1561 | return; |
| @@ -1619,7 +1619,7 @@ PLIST_API void plist_sort(plist_t plist) | |||
| 1619 | } | 1619 | } |
| 1620 | } | 1620 | } |
| 1621 | 1621 | ||
| 1622 | PLIST_API plist_err_t plist_write_to_string(plist_t plist, char **output, uint32_t* length, plist_format_t format, plist_write_options_t options) | 1622 | plist_err_t plist_write_to_string(plist_t plist, char **output, uint32_t* length, plist_format_t format, plist_write_options_t options) |
| 1623 | { | 1623 | { |
| 1624 | plist_err_t err = PLIST_ERR_UNKNOWN; | 1624 | plist_err_t err = PLIST_ERR_UNKNOWN; |
| 1625 | switch (format) { | 1625 | switch (format) { |
| @@ -1649,7 +1649,7 @@ PLIST_API plist_err_t plist_write_to_string(plist_t plist, char **output, uint32 | |||
| 1649 | return err; | 1649 | return err; |
| 1650 | } | 1650 | } |
| 1651 | 1651 | ||
| 1652 | PLIST_API plist_err_t plist_write_to_stream(plist_t plist, FILE *stream, plist_format_t format, plist_write_options_t options) | 1652 | plist_err_t plist_write_to_stream(plist_t plist, FILE *stream, plist_format_t format, plist_write_options_t options) |
| 1653 | { | 1653 | { |
| 1654 | if (!plist || !stream) { | 1654 | if (!plist || !stream) { |
| 1655 | return PLIST_ERR_INVALID_ARG; | 1655 | return PLIST_ERR_INVALID_ARG; |
| @@ -1692,7 +1692,7 @@ PLIST_API plist_err_t plist_write_to_stream(plist_t plist, FILE *stream, plist_f | |||
| 1692 | return err; | 1692 | return err; |
| 1693 | } | 1693 | } |
| 1694 | 1694 | ||
| 1695 | PLIST_API plist_err_t plist_write_to_file(plist_t plist, const char* filename, plist_format_t format, plist_write_options_t options) | 1695 | plist_err_t plist_write_to_file(plist_t plist, const char* filename, plist_format_t format, plist_write_options_t options) |
| 1696 | { | 1696 | { |
| 1697 | if (!plist || !filename) { | 1697 | if (!plist || !filename) { |
| 1698 | return PLIST_ERR_INVALID_ARG; | 1698 | return PLIST_ERR_INVALID_ARG; |
| @@ -1706,7 +1706,7 @@ PLIST_API plist_err_t plist_write_to_file(plist_t plist, const char* filename, p | |||
| 1706 | return err; | 1706 | return err; |
| 1707 | } | 1707 | } |
| 1708 | 1708 | ||
| 1709 | PLIST_API void plist_print(plist_t plist) | 1709 | void plist_print(plist_t plist) |
| 1710 | { | 1710 | { |
| 1711 | plist_write_to_stream(plist, stdout, PLIST_FORMAT_PRINT, PLIST_OPT_PARTIAL_DATA); | 1711 | plist_write_to_stream(plist, stdout, PLIST_FORMAT_PRINT, PLIST_OPT_PARTIAL_DATA); |
| 1712 | } | 1712 | } |
