diff options
Diffstat (limited to 'src/plist.c')
| -rw-r--r-- | src/plist.c | 96 |
1 files changed, 48 insertions, 48 deletions
diff --git a/src/plist.c b/src/plist.c index 317a758..c38b6eb 100644 --- a/src/plist.c +++ b/src/plist.c | |||
| @@ -87,14 +87,14 @@ static int plist_free_node(node_t* node) | |||
| 87 | return node_index; | 87 | return node_index; |
| 88 | } | 88 | } |
| 89 | 89 | ||
| 90 | plist_t plist_new_dict(void) | 90 | PLIST_API plist_t plist_new_dict(void) |
| 91 | { | 91 | { |
| 92 | plist_data_t data = plist_new_plist_data(); | 92 | plist_data_t data = plist_new_plist_data(); |
| 93 | data->type = PLIST_DICT; | 93 | data->type = PLIST_DICT; |
| 94 | return plist_new_node(data); | 94 | return plist_new_node(data); |
| 95 | } | 95 | } |
| 96 | 96 | ||
| 97 | plist_t plist_new_array(void) | 97 | PLIST_API plist_t plist_new_array(void) |
| 98 | { | 98 | { |
| 99 | plist_data_t data = plist_new_plist_data(); | 99 | plist_data_t data = plist_new_plist_data(); |
| 100 | data->type = PLIST_ARRAY; | 100 | data->type = PLIST_ARRAY; |
| @@ -111,7 +111,7 @@ static plist_t plist_new_key(const char *val) | |||
| 111 | return plist_new_node(data); | 111 | return plist_new_node(data); |
| 112 | } | 112 | } |
| 113 | 113 | ||
| 114 | plist_t plist_new_string(const char *val) | 114 | PLIST_API plist_t plist_new_string(const char *val) |
| 115 | { | 115 | { |
| 116 | plist_data_t data = plist_new_plist_data(); | 116 | plist_data_t data = plist_new_plist_data(); |
| 117 | data->type = PLIST_STRING; | 117 | data->type = PLIST_STRING; |
| @@ -120,7 +120,7 @@ plist_t plist_new_string(const char *val) | |||
| 120 | return plist_new_node(data); | 120 | return plist_new_node(data); |
| 121 | } | 121 | } |
| 122 | 122 | ||
| 123 | plist_t plist_new_bool(uint8_t val) | 123 | PLIST_API plist_t plist_new_bool(uint8_t val) |
| 124 | { | 124 | { |
| 125 | plist_data_t data = plist_new_plist_data(); | 125 | plist_data_t data = plist_new_plist_data(); |
| 126 | data->type = PLIST_BOOLEAN; | 126 | data->type = PLIST_BOOLEAN; |
| @@ -129,7 +129,7 @@ plist_t plist_new_bool(uint8_t val) | |||
| 129 | return plist_new_node(data); | 129 | return plist_new_node(data); |
| 130 | } | 130 | } |
| 131 | 131 | ||
| 132 | plist_t plist_new_uint(uint64_t val) | 132 | PLIST_API plist_t plist_new_uint(uint64_t val) |
| 133 | { | 133 | { |
| 134 | plist_data_t data = plist_new_plist_data(); | 134 | plist_data_t data = plist_new_plist_data(); |
| 135 | data->type = PLIST_UINT; | 135 | data->type = PLIST_UINT; |
| @@ -138,7 +138,7 @@ plist_t plist_new_uint(uint64_t val) | |||
| 138 | return plist_new_node(data); | 138 | return plist_new_node(data); |
| 139 | } | 139 | } |
| 140 | 140 | ||
| 141 | plist_t plist_new_uid(uint64_t val) | 141 | PLIST_API plist_t plist_new_uid(uint64_t val) |
| 142 | { | 142 | { |
| 143 | plist_data_t data = plist_new_plist_data(); | 143 | plist_data_t data = plist_new_plist_data(); |
| 144 | data->type = PLIST_UID; | 144 | data->type = PLIST_UID; |
| @@ -147,7 +147,7 @@ plist_t plist_new_uid(uint64_t val) | |||
| 147 | return plist_new_node(data); | 147 | return plist_new_node(data); |
| 148 | } | 148 | } |
| 149 | 149 | ||
| 150 | plist_t plist_new_real(double val) | 150 | PLIST_API plist_t plist_new_real(double val) |
| 151 | { | 151 | { |
| 152 | plist_data_t data = plist_new_plist_data(); | 152 | plist_data_t data = plist_new_plist_data(); |
| 153 | data->type = PLIST_REAL; | 153 | data->type = PLIST_REAL; |
| @@ -156,7 +156,7 @@ plist_t plist_new_real(double val) | |||
| 156 | return plist_new_node(data); | 156 | return plist_new_node(data); |
| 157 | } | 157 | } |
| 158 | 158 | ||
| 159 | plist_t plist_new_data(const char *val, uint64_t length) | 159 | PLIST_API plist_t plist_new_data(const char *val, uint64_t length) |
| 160 | { | 160 | { |
| 161 | plist_data_t data = plist_new_plist_data(); | 161 | plist_data_t data = plist_new_plist_data(); |
| 162 | data->type = PLIST_DATA; | 162 | data->type = PLIST_DATA; |
| @@ -166,7 +166,7 @@ plist_t plist_new_data(const char *val, uint64_t length) | |||
| 166 | return plist_new_node(data); | 166 | return plist_new_node(data); |
| 167 | } | 167 | } |
| 168 | 168 | ||
| 169 | plist_t plist_new_date(int32_t sec, int32_t usec) | 169 | PLIST_API plist_t plist_new_date(int32_t sec, int32_t usec) |
| 170 | { | 170 | { |
| 171 | plist_data_t data = plist_new_plist_data(); | 171 | plist_data_t data = plist_new_plist_data(); |
| 172 | data->type = PLIST_DATE; | 172 | data->type = PLIST_DATE; |
| @@ -176,7 +176,7 @@ plist_t plist_new_date(int32_t sec, int32_t usec) | |||
| 176 | return plist_new_node(data); | 176 | return plist_new_node(data); |
| 177 | } | 177 | } |
| 178 | 178 | ||
| 179 | void plist_free(plist_t plist) | 179 | PLIST_API void plist_free(plist_t plist) |
| 180 | { | 180 | { |
| 181 | if (plist) | 181 | if (plist) |
| 182 | { | 182 | { |
| @@ -231,14 +231,14 @@ static void plist_copy_node(node_t *node, void *parent_node_ptr) | |||
| 231 | node_iterator_destroy(ni); | 231 | node_iterator_destroy(ni); |
| 232 | } | 232 | } |
| 233 | 233 | ||
| 234 | plist_t plist_copy(plist_t node) | 234 | PLIST_API plist_t plist_copy(plist_t node) |
| 235 | { | 235 | { |
| 236 | plist_t copied = NULL; | 236 | plist_t copied = NULL; |
| 237 | plist_copy_node(node, &copied); | 237 | plist_copy_node(node, &copied); |
| 238 | return copied; | 238 | return copied; |
| 239 | } | 239 | } |
| 240 | 240 | ||
| 241 | uint32_t plist_array_get_size(plist_t node) | 241 | PLIST_API uint32_t plist_array_get_size(plist_t node) |
| 242 | { | 242 | { |
| 243 | uint32_t ret = 0; | 243 | uint32_t ret = 0; |
| 244 | if (node && PLIST_ARRAY == plist_get_node_type(node)) | 244 | if (node && PLIST_ARRAY == plist_get_node_type(node)) |
| @@ -248,7 +248,7 @@ uint32_t plist_array_get_size(plist_t node) | |||
| 248 | return ret; | 248 | return ret; |
| 249 | } | 249 | } |
| 250 | 250 | ||
| 251 | plist_t plist_array_get_item(plist_t node, uint32_t n) | 251 | PLIST_API plist_t plist_array_get_item(plist_t node, uint32_t n) |
| 252 | { | 252 | { |
| 253 | plist_t ret = NULL; | 253 | plist_t ret = NULL; |
| 254 | if (node && PLIST_ARRAY == plist_get_node_type(node)) | 254 | if (node && PLIST_ARRAY == plist_get_node_type(node)) |
| @@ -258,7 +258,7 @@ plist_t plist_array_get_item(plist_t node, uint32_t n) | |||
| 258 | return ret; | 258 | return ret; |
| 259 | } | 259 | } |
| 260 | 260 | ||
| 261 | uint32_t plist_array_get_item_index(plist_t node) | 261 | PLIST_API uint32_t plist_array_get_item_index(plist_t node) |
| 262 | { | 262 | { |
| 263 | plist_t father = plist_get_parent(node); | 263 | plist_t father = plist_get_parent(node); |
| 264 | if (PLIST_ARRAY == plist_get_node_type(father)) | 264 | if (PLIST_ARRAY == plist_get_node_type(father)) |
| @@ -268,7 +268,7 @@ uint32_t plist_array_get_item_index(plist_t node) | |||
| 268 | return 0; | 268 | return 0; |
| 269 | } | 269 | } |
| 270 | 270 | ||
| 271 | void plist_array_set_item(plist_t node, plist_t item, uint32_t n) | 271 | PLIST_API void plist_array_set_item(plist_t node, plist_t item, uint32_t n) |
| 272 | { | 272 | { |
| 273 | if (node && PLIST_ARRAY == plist_get_node_type(node)) | 273 | if (node && PLIST_ARRAY == plist_get_node_type(node)) |
| 274 | { | 274 | { |
| @@ -286,7 +286,7 @@ void plist_array_set_item(plist_t node, plist_t item, uint32_t n) | |||
| 286 | return; | 286 | return; |
| 287 | } | 287 | } |
| 288 | 288 | ||
| 289 | void plist_array_append_item(plist_t node, plist_t item) | 289 | PLIST_API void plist_array_append_item(plist_t node, plist_t item) |
| 290 | { | 290 | { |
| 291 | if (node && PLIST_ARRAY == plist_get_node_type(node)) | 291 | if (node && PLIST_ARRAY == plist_get_node_type(node)) |
| 292 | { | 292 | { |
| @@ -295,7 +295,7 @@ void plist_array_append_item(plist_t node, plist_t item) | |||
| 295 | return; | 295 | return; |
| 296 | } | 296 | } |
| 297 | 297 | ||
| 298 | void plist_array_insert_item(plist_t node, plist_t item, uint32_t n) | 298 | PLIST_API void plist_array_insert_item(plist_t node, plist_t item, uint32_t n) |
| 299 | { | 299 | { |
| 300 | if (node && PLIST_ARRAY == plist_get_node_type(node)) | 300 | if (node && PLIST_ARRAY == plist_get_node_type(node)) |
| 301 | { | 301 | { |
| @@ -304,7 +304,7 @@ void plist_array_insert_item(plist_t node, plist_t item, uint32_t n) | |||
| 304 | return; | 304 | return; |
| 305 | } | 305 | } |
| 306 | 306 | ||
| 307 | void plist_array_remove_item(plist_t node, uint32_t n) | 307 | PLIST_API void plist_array_remove_item(plist_t node, uint32_t n) |
| 308 | { | 308 | { |
| 309 | if (node && PLIST_ARRAY == plist_get_node_type(node)) | 309 | if (node && PLIST_ARRAY == plist_get_node_type(node)) |
| 310 | { | 310 | { |
| @@ -317,7 +317,7 @@ void plist_array_remove_item(plist_t node, uint32_t n) | |||
| 317 | return; | 317 | return; |
| 318 | } | 318 | } |
| 319 | 319 | ||
| 320 | uint32_t plist_dict_get_size(plist_t node) | 320 | PLIST_API uint32_t plist_dict_get_size(plist_t node) |
| 321 | { | 321 | { |
| 322 | uint32_t ret = 0; | 322 | uint32_t ret = 0; |
| 323 | if (node && PLIST_DICT == plist_get_node_type(node)) | 323 | if (node && PLIST_DICT == plist_get_node_type(node)) |
| @@ -327,7 +327,7 @@ uint32_t plist_dict_get_size(plist_t node) | |||
| 327 | return ret; | 327 | return ret; |
| 328 | } | 328 | } |
| 329 | 329 | ||
| 330 | void plist_dict_new_iter(plist_t node, plist_dict_iter *iter) | 330 | PLIST_API void plist_dict_new_iter(plist_t node, plist_dict_iter *iter) |
| 331 | { | 331 | { |
| 332 | if (iter && *iter == NULL) | 332 | if (iter && *iter == NULL) |
| 333 | { | 333 | { |
| @@ -337,7 +337,7 @@ void plist_dict_new_iter(plist_t node, plist_dict_iter *iter) | |||
| 337 | return; | 337 | return; |
| 338 | } | 338 | } |
| 339 | 339 | ||
| 340 | void plist_dict_next_item(plist_t node, plist_dict_iter iter, char **key, plist_t *val) | 340 | PLIST_API void plist_dict_next_item(plist_t node, plist_dict_iter iter, char **key, plist_t *val) |
| 341 | { | 341 | { |
| 342 | uint32_t* iter_int = (uint32_t*) iter; | 342 | uint32_t* iter_int = (uint32_t*) iter; |
| 343 | 343 | ||
| @@ -368,7 +368,7 @@ void plist_dict_next_item(plist_t node, plist_dict_iter iter, char **key, plist_ | |||
| 368 | return; | 368 | return; |
| 369 | } | 369 | } |
| 370 | 370 | ||
| 371 | void plist_dict_get_item_key(plist_t node, char **key) | 371 | PLIST_API void plist_dict_get_item_key(plist_t node, char **key) |
| 372 | { | 372 | { |
| 373 | plist_t father = plist_get_parent(node); | 373 | plist_t father = plist_get_parent(node); |
| 374 | if (PLIST_DICT == plist_get_node_type(father)) | 374 | if (PLIST_DICT == plist_get_node_type(father)) |
| @@ -377,7 +377,7 @@ void plist_dict_get_item_key(plist_t node, char **key) | |||
| 377 | } | 377 | } |
| 378 | } | 378 | } |
| 379 | 379 | ||
| 380 | plist_t plist_dict_get_item(plist_t node, const char* key) | 380 | PLIST_API plist_t plist_dict_get_item(plist_t node, const char* key) |
| 381 | { | 381 | { |
| 382 | plist_t ret = NULL; | 382 | plist_t ret = NULL; |
| 383 | 383 | ||
| @@ -403,7 +403,7 @@ plist_t plist_dict_get_item(plist_t node, const char* key) | |||
| 403 | return ret; | 403 | return ret; |
| 404 | } | 404 | } |
| 405 | 405 | ||
| 406 | void plist_dict_set_item(plist_t node, const char* key, plist_t item) | 406 | PLIST_API void plist_dict_set_item(plist_t node, const char* key, plist_t item) |
| 407 | { | 407 | { |
| 408 | if (node && PLIST_DICT == plist_get_node_type(node)) { | 408 | if (node && PLIST_DICT == plist_get_node_type(node)) { |
| 409 | node_t* old_item = plist_dict_get_item(node, key); | 409 | node_t* old_item = plist_dict_get_item(node, key); |
| @@ -422,12 +422,12 @@ void plist_dict_set_item(plist_t node, const char* key, plist_t item) | |||
| 422 | return; | 422 | return; |
| 423 | } | 423 | } |
| 424 | 424 | ||
| 425 | void plist_dict_insert_item(plist_t node, const char* key, plist_t item) | 425 | PLIST_API void plist_dict_insert_item(plist_t node, const char* key, plist_t item) |
| 426 | { | 426 | { |
| 427 | plist_dict_set_item(node, key, item); | 427 | plist_dict_set_item(node, key, item); |
| 428 | } | 428 | } |
| 429 | 429 | ||
| 430 | void plist_dict_remove_item(plist_t node, const char* key) | 430 | PLIST_API void plist_dict_remove_item(plist_t node, const char* key) |
| 431 | { | 431 | { |
| 432 | if (node && PLIST_DICT == plist_get_node_type(node)) | 432 | if (node && PLIST_DICT == plist_get_node_type(node)) |
| 433 | { | 433 | { |
| @@ -442,7 +442,7 @@ void plist_dict_remove_item(plist_t node, const char* key) | |||
| 442 | return; | 442 | return; |
| 443 | } | 443 | } |
| 444 | 444 | ||
| 445 | void plist_dict_merge(plist_t *target, plist_t source) | 445 | PLIST_API void plist_dict_merge(plist_t *target, plist_t source) |
| 446 | { | 446 | { |
| 447 | if (!target || !*target || (plist_get_node_type(*target) != PLIST_DICT) || !source || (plist_get_node_type(source) != PLIST_DICT)) | 447 | if (!target || !*target || (plist_get_node_type(*target) != PLIST_DICT) || !source || (plist_get_node_type(source) != PLIST_DICT)) |
| 448 | return; | 448 | return; |
| @@ -466,7 +466,7 @@ void plist_dict_merge(plist_t *target, plist_t source) | |||
| 466 | free(it); | 466 | free(it); |
| 467 | } | 467 | } |
| 468 | 468 | ||
| 469 | plist_t plist_access_pathv(plist_t plist, uint32_t length, va_list v) | 469 | PLIST_API plist_t plist_access_pathv(plist_t plist, uint32_t length, va_list v) |
| 470 | { | 470 | { |
| 471 | plist_t current = plist; | 471 | plist_t current = plist; |
| 472 | plist_type type = PLIST_NONE; | 472 | plist_type type = PLIST_NONE; |
| @@ -490,7 +490,7 @@ plist_t plist_access_pathv(plist_t plist, uint32_t length, va_list v) | |||
| 490 | return current; | 490 | return current; |
| 491 | } | 491 | } |
| 492 | 492 | ||
| 493 | plist_t plist_access_path(plist_t plist, uint32_t length, ...) | 493 | PLIST_API plist_t plist_access_path(plist_t plist, uint32_t length, ...) |
| 494 | { | 494 | { |
| 495 | plist_t ret = NULL; | 495 | plist_t ret = NULL; |
| 496 | va_list v; | 496 | va_list v; |
| @@ -545,12 +545,12 @@ static void plist_get_type_and_value(plist_t node, plist_type * type, void *valu | |||
| 545 | } | 545 | } |
| 546 | } | 546 | } |
| 547 | 547 | ||
| 548 | plist_t plist_get_parent(plist_t node) | 548 | PLIST_API plist_t plist_get_parent(plist_t node) |
| 549 | { | 549 | { |
| 550 | return node ? (plist_t) ((node_t*) node)->parent : NULL; | 550 | return node ? (plist_t) ((node_t*) node)->parent : NULL; |
| 551 | } | 551 | } |
| 552 | 552 | ||
| 553 | plist_type plist_get_node_type(plist_t node) | 553 | PLIST_API plist_type plist_get_node_type(plist_t node) |
| 554 | { | 554 | { |
| 555 | if (node) | 555 | if (node) |
| 556 | { | 556 | { |
| @@ -561,7 +561,7 @@ plist_type plist_get_node_type(plist_t node) | |||
| 561 | return PLIST_NONE; | 561 | return PLIST_NONE; |
| 562 | } | 562 | } |
| 563 | 563 | ||
| 564 | void plist_get_key_val(plist_t node, char **val) | 564 | PLIST_API void plist_get_key_val(plist_t node, char **val) |
| 565 | { | 565 | { |
| 566 | plist_type type = plist_get_node_type(node); | 566 | plist_type type = plist_get_node_type(node); |
| 567 | uint64_t length = 0; | 567 | uint64_t length = 0; |
| @@ -570,7 +570,7 @@ void plist_get_key_val(plist_t node, char **val) | |||
| 570 | assert(length == strlen(*val)); | 570 | assert(length == strlen(*val)); |
| 571 | } | 571 | } |
| 572 | 572 | ||
| 573 | void plist_get_string_val(plist_t node, char **val) | 573 | PLIST_API void plist_get_string_val(plist_t node, char **val) |
| 574 | { | 574 | { |
| 575 | plist_type type = plist_get_node_type(node); | 575 | plist_type type = plist_get_node_type(node); |
| 576 | uint64_t length = 0; | 576 | uint64_t length = 0; |
| @@ -579,7 +579,7 @@ void plist_get_string_val(plist_t node, char **val) | |||
| 579 | assert(length == strlen(*val)); | 579 | assert(length == strlen(*val)); |
| 580 | } | 580 | } |
| 581 | 581 | ||
| 582 | void plist_get_bool_val(plist_t node, uint8_t * val) | 582 | PLIST_API void plist_get_bool_val(plist_t node, uint8_t * val) |
| 583 | { | 583 | { |
| 584 | plist_type type = plist_get_node_type(node); | 584 | plist_type type = plist_get_node_type(node); |
| 585 | uint64_t length = 0; | 585 | uint64_t length = 0; |
| @@ -588,7 +588,7 @@ void plist_get_bool_val(plist_t node, uint8_t * val) | |||
| 588 | assert(length == sizeof(uint8_t)); | 588 | assert(length == sizeof(uint8_t)); |
| 589 | } | 589 | } |
| 590 | 590 | ||
| 591 | void plist_get_uint_val(plist_t node, uint64_t * val) | 591 | PLIST_API void plist_get_uint_val(plist_t node, uint64_t * val) |
| 592 | { | 592 | { |
| 593 | plist_type type = plist_get_node_type(node); | 593 | plist_type type = plist_get_node_type(node); |
| 594 | uint64_t length = 0; | 594 | uint64_t length = 0; |
| @@ -597,7 +597,7 @@ void plist_get_uint_val(plist_t node, uint64_t * val) | |||
| 597 | assert(length == sizeof(uint64_t)); | 597 | assert(length == sizeof(uint64_t)); |
| 598 | } | 598 | } |
| 599 | 599 | ||
| 600 | void plist_get_uid_val(plist_t node, uint64_t * val) | 600 | PLIST_API void plist_get_uid_val(plist_t node, uint64_t * val) |
| 601 | { | 601 | { |
| 602 | plist_type type = plist_get_node_type(node); | 602 | plist_type type = plist_get_node_type(node); |
| 603 | uint64_t length = 0; | 603 | uint64_t length = 0; |
| @@ -606,7 +606,7 @@ void plist_get_uid_val(plist_t node, uint64_t * val) | |||
| 606 | assert(length == sizeof(uint64_t)); | 606 | assert(length == sizeof(uint64_t)); |
| 607 | } | 607 | } |
| 608 | 608 | ||
| 609 | void plist_get_real_val(plist_t node, double *val) | 609 | PLIST_API void plist_get_real_val(plist_t node, double *val) |
| 610 | { | 610 | { |
| 611 | plist_type type = plist_get_node_type(node); | 611 | plist_type type = plist_get_node_type(node); |
| 612 | uint64_t length = 0; | 612 | uint64_t length = 0; |
| @@ -615,14 +615,14 @@ void plist_get_real_val(plist_t node, double *val) | |||
| 615 | assert(length == sizeof(double)); | 615 | assert(length == sizeof(double)); |
| 616 | } | 616 | } |
| 617 | 617 | ||
| 618 | void plist_get_data_val(plist_t node, char **val, uint64_t * length) | 618 | PLIST_API void plist_get_data_val(plist_t node, char **val, uint64_t * length) |
| 619 | { | 619 | { |
| 620 | plist_type type = plist_get_node_type(node); | 620 | plist_type type = plist_get_node_type(node); |
| 621 | if (PLIST_DATA == type) | 621 | if (PLIST_DATA == type) |
| 622 | plist_get_type_and_value(node, &type, (void *) val, length); | 622 | plist_get_type_and_value(node, &type, (void *) val, length); |
| 623 | } | 623 | } |
| 624 | 624 | ||
| 625 | void plist_get_date_val(plist_t node, int32_t * sec, int32_t * usec) | 625 | PLIST_API void plist_get_date_val(plist_t node, int32_t * sec, int32_t * usec) |
| 626 | { | 626 | { |
| 627 | plist_type type = plist_get_node_type(node); | 627 | plist_type type = plist_get_node_type(node); |
| 628 | uint64_t length = 0; | 628 | uint64_t length = 0; |
| @@ -695,7 +695,7 @@ int plist_data_compare(const void *a, const void *b) | |||
| 695 | return FALSE; | 695 | return FALSE; |
| 696 | } | 696 | } |
| 697 | 697 | ||
| 698 | char plist_compare_node_value(plist_t node_l, plist_t node_r) | 698 | PLIST_API char plist_compare_node_value(plist_t node_l, plist_t node_r) |
| 699 | { | 699 | { |
| 700 | return plist_data_compare(node_l, node_r); | 700 | return plist_data_compare(node_l, node_r); |
| 701 | } | 701 | } |
| @@ -757,42 +757,42 @@ 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_key_val(plist_t node, const char *val) | 760 | PLIST_API void plist_set_key_val(plist_t node, const char *val) |
| 761 | { | 761 | { |
| 762 | plist_set_element_val(node, PLIST_KEY, val, strlen(val)); | 762 | plist_set_element_val(node, PLIST_KEY, val, strlen(val)); |
| 763 | } | 763 | } |
| 764 | 764 | ||
| 765 | void plist_set_string_val(plist_t node, const char *val) | 765 | PLIST_API void plist_set_string_val(plist_t node, const char *val) |
| 766 | { | 766 | { |
| 767 | plist_set_element_val(node, PLIST_STRING, val, strlen(val)); | 767 | plist_set_element_val(node, PLIST_STRING, val, strlen(val)); |
| 768 | } | 768 | } |
| 769 | 769 | ||
| 770 | void plist_set_bool_val(plist_t node, uint8_t val) | 770 | PLIST_API void plist_set_bool_val(plist_t node, uint8_t val) |
| 771 | { | 771 | { |
| 772 | plist_set_element_val(node, PLIST_BOOLEAN, &val, sizeof(uint8_t)); | 772 | plist_set_element_val(node, PLIST_BOOLEAN, &val, sizeof(uint8_t)); |
| 773 | } | 773 | } |
| 774 | 774 | ||
| 775 | void plist_set_uint_val(plist_t node, uint64_t val) | 775 | PLIST_API void plist_set_uint_val(plist_t node, uint64_t val) |
| 776 | { | 776 | { |
| 777 | plist_set_element_val(node, PLIST_UINT, &val, sizeof(uint64_t)); | 777 | plist_set_element_val(node, PLIST_UINT, &val, sizeof(uint64_t)); |
| 778 | } | 778 | } |
| 779 | 779 | ||
| 780 | void plist_set_uid_val(plist_t node, uint64_t val) | 780 | PLIST_API void plist_set_uid_val(plist_t node, uint64_t val) |
| 781 | { | 781 | { |
| 782 | plist_set_element_val(node, PLIST_UID, &val, sizeof(uint64_t)); | 782 | plist_set_element_val(node, PLIST_UID, &val, sizeof(uint64_t)); |
| 783 | } | 783 | } |
| 784 | 784 | ||
| 785 | void plist_set_real_val(plist_t node, double val) | 785 | PLIST_API void plist_set_real_val(plist_t node, double val) |
| 786 | { | 786 | { |
| 787 | plist_set_element_val(node, PLIST_REAL, &val, sizeof(double)); | 787 | plist_set_element_val(node, PLIST_REAL, &val, sizeof(double)); |
| 788 | } | 788 | } |
| 789 | 789 | ||
| 790 | void plist_set_data_val(plist_t node, const char *val, uint64_t length) | 790 | PLIST_API void plist_set_data_val(plist_t node, const char *val, uint64_t length) |
| 791 | { | 791 | { |
| 792 | plist_set_element_val(node, PLIST_DATA, val, length); | 792 | plist_set_element_val(node, PLIST_DATA, val, length); |
| 793 | } | 793 | } |
| 794 | 794 | ||
| 795 | void plist_set_date_val(plist_t node, int32_t sec, int32_t usec) | 795 | PLIST_API void plist_set_date_val(plist_t node, int32_t sec, int32_t usec) |
| 796 | { | 796 | { |
| 797 | struct timeval val = { sec, usec }; | 797 | struct timeval val = { sec, usec }; |
| 798 | plist_set_element_val(node, PLIST_DATE, &val, sizeof(struct timeval)); | 798 | plist_set_element_val(node, PLIST_DATE, &val, sizeof(struct timeval)); |
