diff options
| author | 2014-05-20 21:01:11 +0200 | |
|---|---|---|
| committer | 2014-05-20 21:01:11 +0200 | |
| commit | a9ec8fa5ceaa082e36150814f0b9b4d123b00f26 (patch) | |
| tree | fc7454e702066b632f0b96b9a49ce2dcb2db22ad | |
| parent | c51d1a77b04872020234af49384a4ebd22ddd5f0 (diff) | |
| download | libplist-a9ec8fa5ceaa082e36150814f0b9b4d123b00f26.tar.gz libplist-a9ec8fa5ceaa082e36150814f0b9b4d123b00f26.tar.bz2 | |
Removed plist_set_type() as it should not be used.
| -rw-r--r-- | include/plist/plist.h | 8 | ||||
| -rw-r--r-- | src/plist.c | 30 |
2 files changed, 0 insertions, 38 deletions
diff --git a/include/plist/plist.h b/include/plist/plist.h index f7df832..5678cfb 100644 --- a/include/plist/plist.h +++ b/include/plist/plist.h | |||
| @@ -489,14 +489,6 @@ extern "C" | |||
| 489 | ********************************************/ | 489 | ********************************************/ |
| 490 | 490 | ||
| 491 | /** | 491 | /** |
| 492 | * Forces type of node. Changing type of structured nodes is only allowed if node is empty. | ||
| 493 | * Reset value of node; | ||
| 494 | * @param node the node | ||
| 495 | * @param type the key value | ||
| 496 | */ | ||
| 497 | PLIST_API void plist_set_type(plist_t node, plist_type type); | ||
| 498 | |||
| 499 | /** | ||
| 500 | * Set the value of a node. | 492 | * Set the value of a node. |
| 501 | * Forces type of node to #PLIST_KEY | 493 | * Forces type of node to #PLIST_KEY |
| 502 | * | 494 | * |
diff --git a/src/plist.c b/src/plist.c index 137188e..317a758 100644 --- a/src/plist.c +++ b/src/plist.c | |||
| @@ -757,36 +757,6 @@ static void plist_set_element_val(plist_t node, plist_type type, const void *val | |||
| 757 | } | 757 | } |
| 758 | } | 758 | } |
| 759 | 759 | ||
| 760 | void plist_set_type(plist_t node, plist_type type) | ||
| 761 | { | ||
| 762 | if ( node_n_children(node) == 0 ) | ||
| 763 | { | ||
| 764 | plist_data_t data = plist_get_data(node); | ||
| 765 | plist_free_data( data ); | ||
| 766 | data = plist_new_plist_data(); | ||
| 767 | data->type = type; | ||
| 768 | switch (type) | ||
| 769 | { | ||
| 770 | case PLIST_BOOLEAN: | ||
| 771 | data->length = sizeof(uint8_t); | ||
| 772 | break; | ||
| 773 | case PLIST_UINT: | ||
| 774 | case PLIST_UID: | ||
| 775 | data->length = sizeof(uint64_t); | ||
| 776 | break; | ||
| 777 | case PLIST_REAL: | ||
| 778 | data->length = sizeof(double); | ||
| 779 | break; | ||
| 780 | case PLIST_DATE: | ||
| 781 | data->length = sizeof(struct timeval); | ||
| 782 | break; | ||
| 783 | default: | ||
| 784 | data->length = 0; | ||
| 785 | break; | ||
| 786 | } | ||
| 787 | } | ||
| 788 | } | ||
| 789 | |||
| 790 | void plist_set_key_val(plist_t node, const char *val) | 760 | void plist_set_key_val(plist_t node, const char *val) |
| 791 | { | 761 | { |
| 792 | plist_set_element_val(node, PLIST_KEY, val, strlen(val)); | 762 | plist_set_element_val(node, PLIST_KEY, val, strlen(val)); |
