diff options
| author | 2023-05-13 19:53:26 +0200 | |
|---|---|---|
| committer | 2023-05-13 19:53:26 +0200 | |
| commit | 91c0aa8fa82d3fb42c64b0e46bfa861cada5e47d (patch) | |
| tree | 41d3ff96c3dfcd46b5172db9bd418dd62cb780f9 | |
| parent | 834bb313405bce621610862e76891377ab6601d5 (diff) | |
| download | libplist-91c0aa8fa82d3fb42c64b0e46bfa861cada5e47d.tar.gz libplist-91c0aa8fa82d3fb42c64b0e46bfa861cada5e47d.tar.bz2 | |
Move PLIST_API to the headers
| -rw-r--r-- | include/plist/plist.h | 198 | ||||
| -rw-r--r-- | src/bplist.c | 4 | ||||
| -rw-r--r-- | src/jplist.c | 4 | ||||
| -rw-r--r-- | src/oplist.c | 4 | ||||
| -rw-r--r-- | src/plist.c | 166 | ||||
| -rw-r--r-- | src/plist.h | 10 | ||||
| -rw-r--r-- | src/xplist.c | 4 |
7 files changed, 198 insertions, 192 deletions
diff --git a/include/plist/plist.h b/include/plist/plist.h index 953ecad..7605975 100644 --- a/include/plist/plist.h +++ b/include/plist/plist.h | |||
| @@ -75,6 +75,22 @@ extern "C" | |||
| 75 | #endif | 75 | #endif |
| 76 | /*}}}*/ | 76 | /*}}}*/ |
| 77 | 77 | ||
| 78 | #ifdef LIBPLIST_STATIC | ||
| 79 | #define PLIST_API | ||
| 80 | #elif defined(_WIN32) | ||
| 81 | #ifdef DLL_EXPORT | ||
| 82 | #define PLIST_API __declspec(dllexport) | ||
| 83 | #else | ||
| 84 | #define PLIST_API __declspec(dllimport) | ||
| 85 | #endif | ||
| 86 | #else | ||
| 87 | #if __GNUC__ >= 4 | ||
| 88 | #define PLIST_API __attribute__((visibility("default"))) | ||
| 89 | #else | ||
| 90 | #define PLIST_API | ||
| 91 | #endif | ||
| 92 | #endif | ||
| 93 | |||
| 78 | #include <sys/types.h> | 94 | #include <sys/types.h> |
| 79 | #include <stdarg.h> | 95 | #include <stdarg.h> |
| 80 | #include <stdio.h> | 96 | #include <stdio.h> |
| @@ -180,7 +196,7 @@ extern "C" | |||
| 180 | * @return the created plist | 196 | * @return the created plist |
| 181 | * @sa #plist_type | 197 | * @sa #plist_type |
| 182 | */ | 198 | */ |
| 183 | plist_t plist_new_dict(void); | 199 | PLIST_API plist_t plist_new_dict(void); |
| 184 | 200 | ||
| 185 | /** | 201 | /** |
| 186 | * Create a new root plist_t type #PLIST_ARRAY | 202 | * Create a new root plist_t type #PLIST_ARRAY |
| @@ -188,7 +204,7 @@ extern "C" | |||
| 188 | * @return the created plist | 204 | * @return the created plist |
| 189 | * @sa #plist_type | 205 | * @sa #plist_type |
| 190 | */ | 206 | */ |
| 191 | plist_t plist_new_array(void); | 207 | PLIST_API plist_t plist_new_array(void); |
| 192 | 208 | ||
| 193 | /** | 209 | /** |
| 194 | * Create a new plist_t type #PLIST_STRING | 210 | * Create a new plist_t type #PLIST_STRING |
| @@ -197,7 +213,7 @@ extern "C" | |||
| 197 | * @return the created item | 213 | * @return the created item |
| 198 | * @sa #plist_type | 214 | * @sa #plist_type |
| 199 | */ | 215 | */ |
| 200 | plist_t plist_new_string(const char *val); | 216 | PLIST_API plist_t plist_new_string(const char *val); |
| 201 | 217 | ||
| 202 | /** | 218 | /** |
| 203 | * Create a new plist_t type #PLIST_BOOLEAN | 219 | * Create a new plist_t type #PLIST_BOOLEAN |
| @@ -206,7 +222,7 @@ extern "C" | |||
| 206 | * @return the created item | 222 | * @return the created item |
| 207 | * @sa #plist_type | 223 | * @sa #plist_type |
| 208 | */ | 224 | */ |
| 209 | plist_t plist_new_bool(uint8_t val); | 225 | PLIST_API plist_t plist_new_bool(uint8_t val); |
| 210 | 226 | ||
| 211 | /** | 227 | /** |
| 212 | * Create a new plist_t type #PLIST_INT with an unsigned integer value | 228 | * Create a new plist_t type #PLIST_INT with an unsigned integer value |
| @@ -217,7 +233,7 @@ extern "C" | |||
| 217 | * @note The value is always stored as uint64_t internally. | 233 | * @note The value is always stored as uint64_t internally. |
| 218 | * Use #plist_get_uint_val or #plist_get_int_val to get the unsigned or signed value. | 234 | * Use #plist_get_uint_val or #plist_get_int_val to get the unsigned or signed value. |
| 219 | */ | 235 | */ |
| 220 | plist_t plist_new_uint(uint64_t val); | 236 | PLIST_API plist_t plist_new_uint(uint64_t val); |
| 221 | 237 | ||
| 222 | /** | 238 | /** |
| 223 | * Create a new plist_t type #PLIST_INT with a signed integer value | 239 | * Create a new plist_t type #PLIST_INT with a signed integer value |
| @@ -228,7 +244,7 @@ extern "C" | |||
| 228 | * @note The value is always stored as uint64_t internally. | 244 | * @note The value is always stored as uint64_t internally. |
| 229 | * Use #plist_get_uint_val or #plist_get_int_val to get the unsigned or signed value. | 245 | * Use #plist_get_uint_val or #plist_get_int_val to get the unsigned or signed value. |
| 230 | */ | 246 | */ |
| 231 | plist_t plist_new_int(int64_t val); | 247 | PLIST_API plist_t plist_new_int(int64_t val); |
| 232 | 248 | ||
| 233 | /** | 249 | /** |
| 234 | * Create a new plist_t type #PLIST_REAL | 250 | * Create a new plist_t type #PLIST_REAL |
| @@ -237,7 +253,7 @@ extern "C" | |||
| 237 | * @return the created item | 253 | * @return the created item |
| 238 | * @sa #plist_type | 254 | * @sa #plist_type |
| 239 | */ | 255 | */ |
| 240 | plist_t plist_new_real(double val); | 256 | PLIST_API plist_t plist_new_real(double val); |
| 241 | 257 | ||
| 242 | /** | 258 | /** |
| 243 | * Create a new plist_t type #PLIST_DATA | 259 | * Create a new plist_t type #PLIST_DATA |
| @@ -247,7 +263,7 @@ extern "C" | |||
| 247 | * @return the created item | 263 | * @return the created item |
| 248 | * @sa #plist_type | 264 | * @sa #plist_type |
| 249 | */ | 265 | */ |
| 250 | plist_t plist_new_data(const char *val, uint64_t length); | 266 | PLIST_API plist_t plist_new_data(const char *val, uint64_t length); |
| 251 | 267 | ||
| 252 | /** | 268 | /** |
| 253 | * Create a new plist_t type #PLIST_DATE | 269 | * Create a new plist_t type #PLIST_DATE |
| @@ -257,7 +273,7 @@ extern "C" | |||
| 257 | * @return the created item | 273 | * @return the created item |
| 258 | * @sa #plist_type | 274 | * @sa #plist_type |
| 259 | */ | 275 | */ |
| 260 | plist_t plist_new_date(int32_t sec, int32_t usec); | 276 | PLIST_API plist_t plist_new_date(int32_t sec, int32_t usec); |
| 261 | 277 | ||
| 262 | /** | 278 | /** |
| 263 | * Create a new plist_t type #PLIST_UID | 279 | * Create a new plist_t type #PLIST_UID |
| @@ -266,7 +282,7 @@ extern "C" | |||
| 266 | * @return the created item | 282 | * @return the created item |
| 267 | * @sa #plist_type | 283 | * @sa #plist_type |
| 268 | */ | 284 | */ |
| 269 | plist_t plist_new_uid(uint64_t val); | 285 | PLIST_API plist_t plist_new_uid(uint64_t val); |
| 270 | 286 | ||
| 271 | /** | 287 | /** |
| 272 | * Create a new plist_t type #PLIST_NULL | 288 | * Create a new plist_t type #PLIST_NULL |
| @@ -275,14 +291,14 @@ extern "C" | |||
| 275 | * @note This type is not valid for all formats, e.g. the XML format | 291 | * @note This type is not valid for all formats, e.g. the XML format |
| 276 | * does not support it. | 292 | * does not support it. |
| 277 | */ | 293 | */ |
| 278 | plist_t plist_new_null(void); | 294 | PLIST_API plist_t plist_new_null(void); |
| 279 | 295 | ||
| 280 | /** | 296 | /** |
| 281 | * Destruct a plist_t node and all its children recursively | 297 | * Destruct a plist_t node and all its children recursively |
| 282 | * | 298 | * |
| 283 | * @param plist the plist to free | 299 | * @param plist the plist to free |
| 284 | */ | 300 | */ |
| 285 | void plist_free(plist_t plist); | 301 | PLIST_API void plist_free(plist_t plist); |
| 286 | 302 | ||
| 287 | /** | 303 | /** |
| 288 | * Return a copy of passed node and it's children | 304 | * Return a copy of passed node and it's children |
| @@ -290,7 +306,7 @@ extern "C" | |||
| 290 | * @param node the plist to copy | 306 | * @param node the plist to copy |
| 291 | * @return copied plist | 307 | * @return copied plist |
| 292 | */ | 308 | */ |
| 293 | plist_t plist_copy(plist_t node); | 309 | PLIST_API plist_t plist_copy(plist_t node); |
| 294 | 310 | ||
| 295 | 311 | ||
| 296 | /******************************************** | 312 | /******************************************** |
| @@ -305,7 +321,7 @@ extern "C" | |||
| 305 | * @param node the node of type #PLIST_ARRAY | 321 | * @param node the node of type #PLIST_ARRAY |
| 306 | * @return size of the #PLIST_ARRAY node | 322 | * @return size of the #PLIST_ARRAY node |
| 307 | */ | 323 | */ |
| 308 | uint32_t plist_array_get_size(plist_t node); | 324 | PLIST_API uint32_t plist_array_get_size(plist_t node); |
| 309 | 325 | ||
| 310 | /** | 326 | /** |
| 311 | * Get the nth item in a #PLIST_ARRAY node. | 327 | * Get the nth item in a #PLIST_ARRAY node. |
| @@ -314,7 +330,7 @@ extern "C" | |||
| 314 | * @param n the index of the item to get. Range is [0, array_size[ | 330 | * @param n the index of the item to get. Range is [0, array_size[ |
| 315 | * @return the nth item or NULL if node is not of type #PLIST_ARRAY | 331 | * @return the nth item or NULL if node is not of type #PLIST_ARRAY |
| 316 | */ | 332 | */ |
| 317 | plist_t plist_array_get_item(plist_t node, uint32_t n); | 333 | PLIST_API plist_t plist_array_get_item(plist_t node, uint32_t n); |
| 318 | 334 | ||
| 319 | /** | 335 | /** |
| 320 | * Get the index of an item. item must be a member of a #PLIST_ARRAY node. | 336 | * Get the index of an item. item must be a member of a #PLIST_ARRAY node. |
| @@ -322,7 +338,7 @@ extern "C" | |||
| 322 | * @param node the node | 338 | * @param node the node |
| 323 | * @return the node index or UINT_MAX if node index can't be determined | 339 | * @return the node index or UINT_MAX if node index can't be determined |
| 324 | */ | 340 | */ |
| 325 | uint32_t plist_array_get_item_index(plist_t node); | 341 | PLIST_API uint32_t plist_array_get_item_index(plist_t node); |
| 326 | 342 | ||
| 327 | /** | 343 | /** |
| 328 | * Set the nth item in a #PLIST_ARRAY node. | 344 | * Set the nth item in a #PLIST_ARRAY node. |
| @@ -332,7 +348,7 @@ extern "C" | |||
| 332 | * @param item the new item at index n. The array is responsible for freeing item when it is no longer needed. | 348 | * @param item the new item at index n. The array is responsible for freeing item when it is no longer needed. |
| 333 | * @param n the index of the item to get. Range is [0, array_size[. Assert if n is not in range. | 349 | * @param n the index of the item to get. Range is [0, array_size[. Assert if n is not in range. |
| 334 | */ | 350 | */ |
| 335 | void plist_array_set_item(plist_t node, plist_t item, uint32_t n); | 351 | PLIST_API void plist_array_set_item(plist_t node, plist_t item, uint32_t n); |
| 336 | 352 | ||
| 337 | /** | 353 | /** |
| 338 | * Append a new item at the end of a #PLIST_ARRAY node. | 354 | * Append a new item at the end of a #PLIST_ARRAY node. |
| @@ -340,7 +356,7 @@ extern "C" | |||
| 340 | * @param node the node of type #PLIST_ARRAY | 356 | * @param node the node of type #PLIST_ARRAY |
| 341 | * @param item the new item. The array is responsible for freeing item when it is no longer needed. | 357 | * @param item the new item. The array is responsible for freeing item when it is no longer needed. |
| 342 | */ | 358 | */ |
| 343 | void plist_array_append_item(plist_t node, plist_t item); | 359 | PLIST_API void plist_array_append_item(plist_t node, plist_t item); |
| 344 | 360 | ||
| 345 | /** | 361 | /** |
| 346 | * Insert a new item at position n in a #PLIST_ARRAY node. | 362 | * Insert a new item at position n in a #PLIST_ARRAY node. |
| @@ -349,7 +365,7 @@ extern "C" | |||
| 349 | * @param item the new item to insert. The array is responsible for freeing item when it is no longer needed. | 365 | * @param item the new item to insert. The array is responsible for freeing item when it is no longer needed. |
| 350 | * @param n The position at which the node will be stored. Range is [0, array_size[. Assert if n is not in range. | 366 | * @param n The position at which the node will be stored. Range is [0, array_size[. Assert if n is not in range. |
| 351 | */ | 367 | */ |
| 352 | void plist_array_insert_item(plist_t node, plist_t item, uint32_t n); | 368 | PLIST_API void plist_array_insert_item(plist_t node, plist_t item, uint32_t n); |
| 353 | 369 | ||
| 354 | /** | 370 | /** |
| 355 | * Remove an existing position in a #PLIST_ARRAY node. | 371 | * Remove an existing position in a #PLIST_ARRAY node. |
| @@ -358,7 +374,7 @@ extern "C" | |||
| 358 | * @param node the node of type #PLIST_ARRAY | 374 | * @param node the node of type #PLIST_ARRAY |
| 359 | * @param n The position to remove. Range is [0, array_size[. Assert if n is not in range. | 375 | * @param n The position to remove. Range is [0, array_size[. Assert if n is not in range. |
| 360 | */ | 376 | */ |
| 361 | void plist_array_remove_item(plist_t node, uint32_t n); | 377 | PLIST_API void plist_array_remove_item(plist_t node, uint32_t n); |
| 362 | 378 | ||
| 363 | /** | 379 | /** |
| 364 | * Remove a node that is a child node of a #PLIST_ARRAY node. | 380 | * Remove a node that is a child node of a #PLIST_ARRAY node. |
| @@ -366,7 +382,7 @@ extern "C" | |||
| 366 | * | 382 | * |
| 367 | * @param node The node to be removed from its #PLIST_ARRAY parent. | 383 | * @param node The node to be removed from its #PLIST_ARRAY parent. |
| 368 | */ | 384 | */ |
| 369 | void plist_array_item_remove(plist_t node); | 385 | PLIST_API void plist_array_item_remove(plist_t node); |
| 370 | 386 | ||
| 371 | /** | 387 | /** |
| 372 | * Create an iterator of a #PLIST_ARRAY node. | 388 | * Create an iterator of a #PLIST_ARRAY node. |
| @@ -375,7 +391,7 @@ extern "C" | |||
| 375 | * @param node The node of type #PLIST_ARRAY | 391 | * @param node The node of type #PLIST_ARRAY |
| 376 | * @param iter Location to store the iterator for the array. | 392 | * @param iter Location to store the iterator for the array. |
| 377 | */ | 393 | */ |
| 378 | void plist_array_new_iter(plist_t node, plist_array_iter *iter); | 394 | PLIST_API void plist_array_new_iter(plist_t node, plist_array_iter *iter); |
| 379 | 395 | ||
| 380 | /** | 396 | /** |
| 381 | * Increment iterator of a #PLIST_ARRAY node. | 397 | * Increment iterator of a #PLIST_ARRAY node. |
| @@ -386,7 +402,7 @@ extern "C" | |||
| 386 | * returned item. Will be set to NULL when no more items are left | 402 | * returned item. Will be set to NULL when no more items are left |
| 387 | * to iterate. | 403 | * to iterate. |
| 388 | */ | 404 | */ |
| 389 | void plist_array_next_item(plist_t node, plist_array_iter iter, plist_t *item); | 405 | PLIST_API void plist_array_next_item(plist_t node, plist_array_iter iter, plist_t *item); |
| 390 | 406 | ||
| 391 | 407 | ||
| 392 | /******************************************** | 408 | /******************************************** |
| @@ -401,7 +417,7 @@ extern "C" | |||
| 401 | * @param node the node of type #PLIST_DICT | 417 | * @param node the node of type #PLIST_DICT |
| 402 | * @return size of the #PLIST_DICT node | 418 | * @return size of the #PLIST_DICT node |
| 403 | */ | 419 | */ |
| 404 | uint32_t plist_dict_get_size(plist_t node); | 420 | PLIST_API uint32_t plist_dict_get_size(plist_t node); |
| 405 | 421 | ||
| 406 | /** | 422 | /** |
| 407 | * Create an iterator of a #PLIST_DICT node. | 423 | * Create an iterator of a #PLIST_DICT node. |
| @@ -410,7 +426,7 @@ extern "C" | |||
| 410 | * @param node The node of type #PLIST_DICT. | 426 | * @param node The node of type #PLIST_DICT. |
| 411 | * @param iter Location to store the iterator for the dictionary. | 427 | * @param iter Location to store the iterator for the dictionary. |
| 412 | */ | 428 | */ |
| 413 | void plist_dict_new_iter(plist_t node, plist_dict_iter *iter); | 429 | PLIST_API void plist_dict_new_iter(plist_t node, plist_dict_iter *iter); |
| 414 | 430 | ||
| 415 | /** | 431 | /** |
| 416 | * Increment iterator of a #PLIST_DICT node. | 432 | * Increment iterator of a #PLIST_DICT node. |
| @@ -423,7 +439,7 @@ extern "C" | |||
| 423 | * free the returned value. Will be set to NULL when no more | 439 | * free the returned value. Will be set to NULL when no more |
| 424 | * key/value pairs are left to iterate. | 440 | * key/value pairs are left to iterate. |
| 425 | */ | 441 | */ |
| 426 | void plist_dict_next_item(plist_t node, plist_dict_iter iter, char **key, plist_t *val); | 442 | PLIST_API void plist_dict_next_item(plist_t node, plist_dict_iter iter, char **key, plist_t *val); |
| 427 | 443 | ||
| 428 | /** | 444 | /** |
| 429 | * Get key associated key to an item. Item must be member of a dictionary. | 445 | * Get key associated key to an item. Item must be member of a dictionary. |
| @@ -431,7 +447,7 @@ extern "C" | |||
| 431 | * @param node the item | 447 | * @param node the item |
| 432 | * @param key a location to store the key. The caller is responsible for freeing the returned string. | 448 | * @param key a location to store the key. The caller is responsible for freeing the returned string. |
| 433 | */ | 449 | */ |
| 434 | void plist_dict_get_item_key(plist_t node, char **key); | 450 | PLIST_API void plist_dict_get_item_key(plist_t node, char **key); |
| 435 | 451 | ||
| 436 | /** | 452 | /** |
| 437 | * Get the nth item in a #PLIST_DICT node. | 453 | * Get the nth item in a #PLIST_DICT node. |
| @@ -441,7 +457,7 @@ extern "C" | |||
| 441 | * @return the item or NULL if node is not of type #PLIST_DICT. The caller should not free | 457 | * @return the item or NULL if node is not of type #PLIST_DICT. The caller should not free |
| 442 | * the returned node. | 458 | * the returned node. |
| 443 | */ | 459 | */ |
| 444 | plist_t plist_dict_get_item(plist_t node, const char* key); | 460 | PLIST_API plist_t plist_dict_get_item(plist_t node, const char* key); |
| 445 | 461 | ||
| 446 | /** | 462 | /** |
| 447 | * Get key node associated to an item. Item must be member of a dictionary. | 463 | * Get key node associated to an item. Item must be member of a dictionary. |
| @@ -449,7 +465,7 @@ extern "C" | |||
| 449 | * @param node the item | 465 | * @param node the item |
| 450 | * @return the key node of the given item, or NULL. | 466 | * @return the key node of the given item, or NULL. |
| 451 | */ | 467 | */ |
| 452 | plist_t plist_dict_item_get_key(plist_t node); | 468 | PLIST_API plist_t plist_dict_item_get_key(plist_t node); |
| 453 | 469 | ||
| 454 | /** | 470 | /** |
| 455 | * Set item identified by key in a #PLIST_DICT node. | 471 | * Set item identified by key in a #PLIST_DICT node. |
| @@ -460,7 +476,7 @@ extern "C" | |||
| 460 | * @param item the new item associated to key | 476 | * @param item the new item associated to key |
| 461 | * @param key the identifier of the item to set. | 477 | * @param key the identifier of the item to set. |
| 462 | */ | 478 | */ |
| 463 | void plist_dict_set_item(plist_t node, const char* key, plist_t item); | 479 | PLIST_API void plist_dict_set_item(plist_t node, const char* key, plist_t item); |
| 464 | 480 | ||
| 465 | /** | 481 | /** |
| 466 | * Remove an existing position in a #PLIST_DICT node. | 482 | * Remove an existing position in a #PLIST_DICT node. |
| @@ -469,7 +485,7 @@ extern "C" | |||
| 469 | * @param node the node of type #PLIST_DICT | 485 | * @param node the node of type #PLIST_DICT |
| 470 | * @param key The identifier of the item to remove. Assert if identifier is not present. | 486 | * @param key The identifier of the item to remove. Assert if identifier is not present. |
| 471 | */ | 487 | */ |
| 472 | void plist_dict_remove_item(plist_t node, const char* key); | 488 | PLIST_API void plist_dict_remove_item(plist_t node, const char* key); |
| 473 | 489 | ||
| 474 | /** | 490 | /** |
| 475 | * Merge a dictionary into another. This will add all key/value pairs | 491 | * Merge a dictionary into another. This will add all key/value pairs |
| @@ -479,7 +495,7 @@ extern "C" | |||
| 479 | * @param target pointer to an existing node of type #PLIST_DICT | 495 | * @param target pointer to an existing node of type #PLIST_DICT |
| 480 | * @param source node of type #PLIST_DICT that should be merged into target | 496 | * @param source node of type #PLIST_DICT that should be merged into target |
| 481 | */ | 497 | */ |
| 482 | void plist_dict_merge(plist_t *target, plist_t source); | 498 | PLIST_API void plist_dict_merge(plist_t *target, plist_t source); |
| 483 | 499 | ||
| 484 | 500 | ||
| 485 | /******************************************** | 501 | /******************************************** |
| @@ -493,7 +509,7 @@ extern "C" | |||
| 493 | * | 509 | * |
| 494 | * @param node the parent (NULL if node is root) | 510 | * @param node the parent (NULL if node is root) |
| 495 | */ | 511 | */ |
| 496 | plist_t plist_get_parent(plist_t node); | 512 | PLIST_API plist_t plist_get_parent(plist_t node); |
| 497 | 513 | ||
| 498 | /** | 514 | /** |
| 499 | * Get the #plist_type of a node. | 515 | * Get the #plist_type of a node. |
| @@ -501,7 +517,7 @@ extern "C" | |||
| 501 | * @param node the node | 517 | * @param node the node |
| 502 | * @return the type of the node | 518 | * @return the type of the node |
| 503 | */ | 519 | */ |
| 504 | plist_type plist_get_node_type(plist_t node); | 520 | PLIST_API plist_type plist_get_node_type(plist_t node); |
| 505 | 521 | ||
| 506 | /** | 522 | /** |
| 507 | * Get the value of a #PLIST_KEY node. | 523 | * Get the value of a #PLIST_KEY node. |
| @@ -512,7 +528,7 @@ extern "C" | |||
| 512 | * caller is responsible for freeing it. | 528 | * caller is responsible for freeing it. |
| 513 | * @note Use plist_mem_free() to free the allocated memory. | 529 | * @note Use plist_mem_free() to free the allocated memory. |
| 514 | */ | 530 | */ |
| 515 | void plist_get_key_val(plist_t node, char **val); | 531 | PLIST_API void plist_get_key_val(plist_t node, char **val); |
| 516 | 532 | ||
| 517 | /** | 533 | /** |
| 518 | * Get the value of a #PLIST_STRING node. | 534 | * Get the value of a #PLIST_STRING node. |
| @@ -523,7 +539,7 @@ extern "C" | |||
| 523 | * caller is responsible for freeing it. Data is UTF-8 encoded. | 539 | * caller is responsible for freeing it. Data is UTF-8 encoded. |
| 524 | * @note Use plist_mem_free() to free the allocated memory. | 540 | * @note Use plist_mem_free() to free the allocated memory. |
| 525 | */ | 541 | */ |
| 526 | void plist_get_string_val(plist_t node, char **val); | 542 | PLIST_API void plist_get_string_val(plist_t node, char **val); |
| 527 | 543 | ||
| 528 | /** | 544 | /** |
| 529 | * Get a pointer to the buffer of a #PLIST_STRING node. | 545 | * Get a pointer to the buffer of a #PLIST_STRING node. |
| @@ -536,7 +552,7 @@ extern "C" | |||
| 536 | * | 552 | * |
| 537 | * @return Pointer to the NULL-terminated buffer. | 553 | * @return Pointer to the NULL-terminated buffer. |
| 538 | */ | 554 | */ |
| 539 | const char* plist_get_string_ptr(plist_t node, uint64_t* length); | 555 | PLIST_API const char* plist_get_string_ptr(plist_t node, uint64_t* length); |
| 540 | 556 | ||
| 541 | /** | 557 | /** |
| 542 | * Get the value of a #PLIST_BOOLEAN node. | 558 | * Get the value of a #PLIST_BOOLEAN node. |
| @@ -545,7 +561,7 @@ extern "C" | |||
| 545 | * @param node the node | 561 | * @param node the node |
| 546 | * @param val a pointer to a uint8_t variable. | 562 | * @param val a pointer to a uint8_t variable. |
| 547 | */ | 563 | */ |
| 548 | void plist_get_bool_val(plist_t node, uint8_t * val); | 564 | PLIST_API void plist_get_bool_val(plist_t node, uint8_t * val); |
| 549 | 565 | ||
| 550 | /** | 566 | /** |
| 551 | * Get the unsigned integer value of a #PLIST_INT node. | 567 | * Get the unsigned integer value of a #PLIST_INT node. |
| @@ -554,7 +570,7 @@ extern "C" | |||
| 554 | * @param node the node | 570 | * @param node the node |
| 555 | * @param val a pointer to a uint64_t variable. | 571 | * @param val a pointer to a uint64_t variable. |
| 556 | */ | 572 | */ |
| 557 | void plist_get_uint_val(plist_t node, uint64_t * val); | 573 | PLIST_API void plist_get_uint_val(plist_t node, uint64_t * val); |
| 558 | 574 | ||
| 559 | /** | 575 | /** |
| 560 | * Get the signed integer value of a #PLIST_INT node. | 576 | * Get the signed integer value of a #PLIST_INT node. |
| @@ -563,7 +579,7 @@ extern "C" | |||
| 563 | * @param node the node | 579 | * @param node the node |
| 564 | * @param val a pointer to a int64_t variable. | 580 | * @param val a pointer to a int64_t variable. |
| 565 | */ | 581 | */ |
| 566 | void plist_get_int_val(plist_t node, int64_t * val); | 582 | PLIST_API void plist_get_int_val(plist_t node, int64_t * val); |
| 567 | 583 | ||
| 568 | /** | 584 | /** |
| 569 | * Get the value of a #PLIST_REAL node. | 585 | * Get the value of a #PLIST_REAL node. |
| @@ -572,7 +588,7 @@ extern "C" | |||
| 572 | * @param node the node | 588 | * @param node the node |
| 573 | * @param val a pointer to a double variable. | 589 | * @param val a pointer to a double variable. |
| 574 | */ | 590 | */ |
| 575 | void plist_get_real_val(plist_t node, double *val); | 591 | PLIST_API void plist_get_real_val(plist_t node, double *val); |
| 576 | 592 | ||
| 577 | /** | 593 | /** |
| 578 | * Get the value of a #PLIST_DATA node. | 594 | * Get the value of a #PLIST_DATA node. |
| @@ -584,7 +600,7 @@ extern "C" | |||
| 584 | * @param length the length of the buffer | 600 | * @param length the length of the buffer |
| 585 | * @note Use plist_mem_free() to free the allocated memory. | 601 | * @note Use plist_mem_free() to free the allocated memory. |
| 586 | */ | 602 | */ |
| 587 | void plist_get_data_val(plist_t node, char **val, uint64_t * length); | 603 | PLIST_API void plist_get_data_val(plist_t node, char **val, uint64_t * length); |
| 588 | 604 | ||
| 589 | /** | 605 | /** |
| 590 | * Get a pointer to the data buffer of a #PLIST_DATA node. | 606 | * Get a pointer to the data buffer of a #PLIST_DATA node. |
| @@ -597,7 +613,7 @@ extern "C" | |||
| 597 | * | 613 | * |
| 598 | * @return Pointer to the buffer | 614 | * @return Pointer to the buffer |
| 599 | */ | 615 | */ |
| 600 | const char* plist_get_data_ptr(plist_t node, uint64_t* length); | 616 | PLIST_API const char* plist_get_data_ptr(plist_t node, uint64_t* length); |
| 601 | 617 | ||
| 602 | /** | 618 | /** |
| 603 | * Get the value of a #PLIST_DATE node. | 619 | * Get the value of a #PLIST_DATE node. |
| @@ -607,7 +623,7 @@ extern "C" | |||
| 607 | * @param sec a pointer to an int32_t variable. Represents the number of seconds since 01/01/2001. | 623 | * @param sec a pointer to an int32_t variable. Represents the number of seconds since 01/01/2001. |
| 608 | * @param usec a pointer to an int32_t variable. Represents the number of microseconds | 624 | * @param usec a pointer to an int32_t variable. Represents the number of microseconds |
| 609 | */ | 625 | */ |
| 610 | void plist_get_date_val(plist_t node, int32_t * sec, int32_t * usec); | 626 | PLIST_API void plist_get_date_val(plist_t node, int32_t * sec, int32_t * usec); |
| 611 | 627 | ||
| 612 | /** | 628 | /** |
| 613 | * Get the value of a #PLIST_UID node. | 629 | * Get the value of a #PLIST_UID node. |
| @@ -616,7 +632,7 @@ extern "C" | |||
| 616 | * @param node the node | 632 | * @param node the node |
| 617 | * @param val a pointer to a uint64_t variable. | 633 | * @param val a pointer to a uint64_t variable. |
| 618 | */ | 634 | */ |
| 619 | void plist_get_uid_val(plist_t node, uint64_t * val); | 635 | PLIST_API void plist_get_uid_val(plist_t node, uint64_t * val); |
| 620 | 636 | ||
| 621 | 637 | ||
| 622 | /******************************************** | 638 | /******************************************** |
| @@ -632,7 +648,7 @@ extern "C" | |||
| 632 | * @param node the node | 648 | * @param node the node |
| 633 | * @param val the key value | 649 | * @param val the key value |
| 634 | */ | 650 | */ |
| 635 | void plist_set_key_val(plist_t node, const char *val); | 651 | PLIST_API void plist_set_key_val(plist_t node, const char *val); |
| 636 | 652 | ||
| 637 | /** | 653 | /** |
| 638 | * Set the value of a node. | 654 | * Set the value of a node. |
| @@ -642,7 +658,7 @@ extern "C" | |||
| 642 | * @param val the string value. The string is copied when set and will be | 658 | * @param val the string value. The string is copied when set and will be |
| 643 | * freed by the node. | 659 | * freed by the node. |
| 644 | */ | 660 | */ |
| 645 | void plist_set_string_val(plist_t node, const char *val); | 661 | PLIST_API void plist_set_string_val(plist_t node, const char *val); |
| 646 | 662 | ||
| 647 | /** | 663 | /** |
| 648 | * Set the value of a node. | 664 | * Set the value of a node. |
| @@ -651,7 +667,7 @@ extern "C" | |||
| 651 | * @param node the node | 667 | * @param node the node |
| 652 | * @param val the boolean value | 668 | * @param val the boolean value |
| 653 | */ | 669 | */ |
| 654 | void plist_set_bool_val(plist_t node, uint8_t val); | 670 | PLIST_API void plist_set_bool_val(plist_t node, uint8_t val); |
| 655 | 671 | ||
| 656 | /** | 672 | /** |
| 657 | * Set the value of a node. | 673 | * Set the value of a node. |
| @@ -660,7 +676,7 @@ extern "C" | |||
| 660 | * @param node the node | 676 | * @param node the node |
| 661 | * @param val the unsigned integer value | 677 | * @param val the unsigned integer value |
| 662 | */ | 678 | */ |
| 663 | void plist_set_uint_val(plist_t node, uint64_t val); | 679 | PLIST_API void plist_set_uint_val(plist_t node, uint64_t val); |
| 664 | 680 | ||
| 665 | /** | 681 | /** |
| 666 | * Set the value of a node. | 682 | * Set the value of a node. |
| @@ -669,7 +685,7 @@ extern "C" | |||
| 669 | * @param node the node | 685 | * @param node the node |
| 670 | * @param val the signed integer value | 686 | * @param val the signed integer value |
| 671 | */ | 687 | */ |
| 672 | void plist_set_int_val(plist_t node, int64_t val); | 688 | PLIST_API void plist_set_int_val(plist_t node, int64_t val); |
| 673 | 689 | ||
| 674 | /** | 690 | /** |
| 675 | * Set the value of a node. | 691 | * Set the value of a node. |
| @@ -678,7 +694,7 @@ extern "C" | |||
| 678 | * @param node the node | 694 | * @param node the node |
| 679 | * @param val the real value | 695 | * @param val the real value |
| 680 | */ | 696 | */ |
| 681 | void plist_set_real_val(plist_t node, double val); | 697 | PLIST_API void plist_set_real_val(plist_t node, double val); |
| 682 | 698 | ||
| 683 | /** | 699 | /** |
| 684 | * Set the value of a node. | 700 | * Set the value of a node. |
| @@ -689,7 +705,7 @@ extern "C" | |||
| 689 | * be freed by the node. | 705 | * be freed by the node. |
| 690 | * @param length the length of the buffer | 706 | * @param length the length of the buffer |
| 691 | */ | 707 | */ |
| 692 | void plist_set_data_val(plist_t node, const char *val, uint64_t length); | 708 | PLIST_API void plist_set_data_val(plist_t node, const char *val, uint64_t length); |
| 693 | 709 | ||
| 694 | /** | 710 | /** |
| 695 | * Set the value of a node. | 711 | * Set the value of a node. |
| @@ -699,7 +715,7 @@ extern "C" | |||
| 699 | * @param sec the number of seconds since 01/01/2001 | 715 | * @param sec the number of seconds since 01/01/2001 |
| 700 | * @param usec the number of microseconds | 716 | * @param usec the number of microseconds |
| 701 | */ | 717 | */ |
| 702 | void plist_set_date_val(plist_t node, int32_t sec, int32_t usec); | 718 | PLIST_API void plist_set_date_val(plist_t node, int32_t sec, int32_t usec); |
| 703 | 719 | ||
| 704 | /** | 720 | /** |
| 705 | * Set the value of a node. | 721 | * Set the value of a node. |
| @@ -708,7 +724,7 @@ extern "C" | |||
| 708 | * @param node the node | 724 | * @param node the node |
| 709 | * @param val the unsigned integer value | 725 | * @param val the unsigned integer value |
| 710 | */ | 726 | */ |
| 711 | void plist_set_uid_val(plist_t node, uint64_t val); | 727 | PLIST_API void plist_set_uid_val(plist_t node, uint64_t val); |
| 712 | 728 | ||
| 713 | 729 | ||
| 714 | /******************************************** | 730 | /******************************************** |
| @@ -727,7 +743,7 @@ extern "C" | |||
| 727 | * @return PLIST_ERR_SUCCESS on success or a #plist_err_t on failure | 743 | * @return PLIST_ERR_SUCCESS on success or a #plist_err_t on failure |
| 728 | * @note Use plist_mem_free() to free the allocated memory. | 744 | * @note Use plist_mem_free() to free the allocated memory. |
| 729 | */ | 745 | */ |
| 730 | plist_err_t plist_to_xml(plist_t plist, char **plist_xml, uint32_t * length); | 746 | PLIST_API plist_err_t plist_to_xml(plist_t plist, char **plist_xml, uint32_t * length); |
| 731 | 747 | ||
| 732 | /** | 748 | /** |
| 733 | * Export the #plist_t structure to binary format. | 749 | * Export the #plist_t structure to binary format. |
| @@ -739,7 +755,7 @@ extern "C" | |||
| 739 | * @return PLIST_ERR_SUCCESS on success or a #plist_err_t on failure | 755 | * @return PLIST_ERR_SUCCESS on success or a #plist_err_t on failure |
| 740 | * @note Use plist_mem_free() to free the allocated memory. | 756 | * @note Use plist_mem_free() to free the allocated memory. |
| 741 | */ | 757 | */ |
| 742 | plist_err_t plist_to_bin(plist_t plist, char **plist_bin, uint32_t * length); | 758 | PLIST_API plist_err_t plist_to_bin(plist_t plist, char **plist_bin, uint32_t * length); |
| 743 | 759 | ||
| 744 | /** | 760 | /** |
| 745 | * Export the #plist_t structure to JSON format. | 761 | * Export the #plist_t structure to JSON format. |
| @@ -752,7 +768,7 @@ extern "C" | |||
| 752 | * @return PLIST_ERR_SUCCESS on success or a #plist_err_t on failure | 768 | * @return PLIST_ERR_SUCCESS on success or a #plist_err_t on failure |
| 753 | * @note Use plist_mem_free() to free the allocated memory. | 769 | * @note Use plist_mem_free() to free the allocated memory. |
| 754 | */ | 770 | */ |
| 755 | plist_err_t plist_to_json(plist_t plist, char **plist_json, uint32_t* length, int prettify); | 771 | PLIST_API plist_err_t plist_to_json(plist_t plist, char **plist_json, uint32_t* length, int prettify); |
| 756 | 772 | ||
| 757 | /** | 773 | /** |
| 758 | * Export the #plist_t structure to OpenStep format. | 774 | * Export the #plist_t structure to OpenStep format. |
| @@ -765,7 +781,7 @@ extern "C" | |||
| 765 | * @return PLIST_ERR_SUCCESS on success or a #plist_err_t on failure | 781 | * @return PLIST_ERR_SUCCESS on success or a #plist_err_t on failure |
| 766 | * @note Use plist_mem_free() to free the allocated memory. | 782 | * @note Use plist_mem_free() to free the allocated memory. |
| 767 | */ | 783 | */ |
| 768 | plist_err_t plist_to_openstep(plist_t plist, char **plist_openstep, uint32_t* length, int prettify); | 784 | PLIST_API plist_err_t plist_to_openstep(plist_t plist, char **plist_openstep, uint32_t* length, int prettify); |
| 769 | 785 | ||
| 770 | 786 | ||
| 771 | /** | 787 | /** |
| @@ -776,7 +792,7 @@ extern "C" | |||
| 776 | * @param plist a pointer to the imported plist. | 792 | * @param plist a pointer to the imported plist. |
| 777 | * @return PLIST_ERR_SUCCESS on success or a #plist_err_t on failure | 793 | * @return PLIST_ERR_SUCCESS on success or a #plist_err_t on failure |
| 778 | */ | 794 | */ |
| 779 | plist_err_t plist_from_xml(const char *plist_xml, uint32_t length, plist_t * plist); | 795 | PLIST_API plist_err_t plist_from_xml(const char *plist_xml, uint32_t length, plist_t * plist); |
| 780 | 796 | ||
| 781 | /** | 797 | /** |
| 782 | * Import the #plist_t structure from binary format. | 798 | * Import the #plist_t structure from binary format. |
| @@ -786,7 +802,7 @@ extern "C" | |||
| 786 | * @param plist a pointer to the imported plist. | 802 | * @param plist a pointer to the imported plist. |
| 787 | * @return PLIST_ERR_SUCCESS on success or a #plist_err_t on failure | 803 | * @return PLIST_ERR_SUCCESS on success or a #plist_err_t on failure |
| 788 | */ | 804 | */ |
| 789 | plist_err_t plist_from_bin(const char *plist_bin, uint32_t length, plist_t * plist); | 805 | PLIST_API plist_err_t plist_from_bin(const char *plist_bin, uint32_t length, plist_t * plist); |
| 790 | 806 | ||
| 791 | /** | 807 | /** |
| 792 | * Import the #plist_t structure from JSON format. | 808 | * Import the #plist_t structure from JSON format. |
| @@ -796,7 +812,7 @@ extern "C" | |||
| 796 | * @param plist a pointer to the imported plist. | 812 | * @param plist a pointer to the imported plist. |
| 797 | * @return PLIST_ERR_SUCCESS on success or a #plist_err_t on failure | 813 | * @return PLIST_ERR_SUCCESS on success or a #plist_err_t on failure |
| 798 | */ | 814 | */ |
| 799 | plist_err_t plist_from_json(const char *json, uint32_t length, plist_t * plist); | 815 | PLIST_API plist_err_t plist_from_json(const char *json, uint32_t length, plist_t * plist); |
| 800 | 816 | ||
| 801 | /** | 817 | /** |
| 802 | * Import the #plist_t structure from OpenStep plist format. | 818 | * Import the #plist_t structure from OpenStep plist format. |
| @@ -806,7 +822,7 @@ extern "C" | |||
| 806 | * @param plist a pointer to the imported plist. | 822 | * @param plist a pointer to the imported plist. |
| 807 | * @return PLIST_ERR_SUCCESS on success or a #plist_err_t on failure | 823 | * @return PLIST_ERR_SUCCESS on success or a #plist_err_t on failure |
| 808 | */ | 824 | */ |
| 809 | plist_err_t plist_from_openstep(const char *openstep, uint32_t length, plist_t * plist); | 825 | PLIST_API plist_err_t plist_from_openstep(const char *openstep, uint32_t length, plist_t * plist); |
| 810 | 826 | ||
| 811 | /** | 827 | /** |
| 812 | * Import the #plist_t structure from memory data. | 828 | * Import the #plist_t structure from memory data. |
| @@ -826,7 +842,7 @@ extern "C" | |||
| 826 | * @param format If non-NULL, the #plist_format_t value pointed to will be set to the parsed format. | 842 | * @param format If non-NULL, the #plist_format_t value pointed to will be set to the parsed format. |
| 827 | * @return PLIST_ERR_SUCCESS on success or a #plist_err_t on failure | 843 | * @return PLIST_ERR_SUCCESS on success or a #plist_err_t on failure |
| 828 | */ | 844 | */ |
| 829 | plist_err_t plist_from_memory(const char *plist_data, uint32_t length, plist_t *plist, plist_format_t *format); | 845 | PLIST_API plist_err_t plist_from_memory(const char *plist_data, uint32_t length, plist_t *plist, plist_format_t *format); |
| 830 | 846 | ||
| 831 | /** | 847 | /** |
| 832 | * Import the #plist_t structure directly from file. | 848 | * Import the #plist_t structure directly from file. |
| @@ -841,7 +857,7 @@ extern "C" | |||
| 841 | * @param format If non-NULL, the #plist_format_t value pointed to will be set to the parsed format. | 857 | * @param format If non-NULL, the #plist_format_t value pointed to will be set to the parsed format. |
| 842 | * @return PLIST_ERR_SUCCESS on success or a #plist_err_t on failure | 858 | * @return PLIST_ERR_SUCCESS on success or a #plist_err_t on failure |
| 843 | */ | 859 | */ |
| 844 | plist_err_t plist_read_from_file(const char *filename, plist_t *plist, plist_format_t *format); | 860 | PLIST_API plist_err_t plist_read_from_file(const char *filename, plist_t *plist, plist_format_t *format); |
| 845 | 861 | ||
| 846 | /** | 862 | /** |
| 847 | * Write the #plist_t structure to a NULL-terminated string using the given format and options. | 863 | * Write the #plist_t structure to a NULL-terminated string using the given format and options. |
| @@ -856,7 +872,7 @@ extern "C" | |||
| 856 | * @note Use plist_mem_free() to free the allocated memory. | 872 | * @note Use plist_mem_free() to free the allocated memory. |
| 857 | * @note #PLIST_FORMAT_BINARY is not supported by this function. | 873 | * @note #PLIST_FORMAT_BINARY is not supported by this function. |
| 858 | */ | 874 | */ |
| 859 | plist_err_t plist_write_to_string(plist_t plist, char **output, uint32_t* length, plist_format_t format, plist_write_options_t options); | 875 | 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); |
| 860 | 876 | ||
| 861 | /** | 877 | /** |
| 862 | * Write the #plist_t structure to a FILE* stream using the given format and options. | 878 | * Write the #plist_t structure to a FILE* stream using the given format and options. |
| @@ -871,7 +887,7 @@ extern "C" | |||
| 871 | * (basically all output-only formats) are directly and efficiently written to the stream; | 887 | * (basically all output-only formats) are directly and efficiently written to the stream; |
| 872 | * the other formats are written to a memory buffer first. | 888 | * the other formats are written to a memory buffer first. |
| 873 | */ | 889 | */ |
| 874 | plist_err_t plist_write_to_stream(plist_t plist, FILE* stream, plist_format_t format, plist_write_options_t options); | 890 | PLIST_API plist_err_t plist_write_to_stream(plist_t plist, FILE* stream, plist_format_t format, plist_write_options_t options); |
| 875 | 891 | ||
| 876 | /** | 892 | /** |
| 877 | * Write the #plist_t structure to a file at given path using the given format and options. | 893 | * Write the #plist_t structure to a file at given path using the given format and options. |
| @@ -883,7 +899,7 @@ extern "C" | |||
| 883 | * @return PLIST_ERR_SUCCESS on success or a #plist_err_t on failure. | 899 | * @return PLIST_ERR_SUCCESS on success or a #plist_err_t on failure. |
| 884 | * @note Use plist_mem_free() to free the allocated memory. | 900 | * @note Use plist_mem_free() to free the allocated memory. |
| 885 | */ | 901 | */ |
| 886 | plist_err_t plist_write_to_file(plist_t plist, const char *filename, plist_format_t format, plist_write_options_t options); | 902 | PLIST_API plist_err_t plist_write_to_file(plist_t plist, const char *filename, plist_format_t format, plist_write_options_t options); |
| 887 | 903 | ||
| 888 | /** | 904 | /** |
| 889 | * Print the given plist in human-readable format to standard output. | 905 | * Print the given plist in human-readable format to standard output. |
| @@ -892,7 +908,7 @@ extern "C" | |||
| 892 | * @param plist The #plist_t structure to print | 908 | * @param plist The #plist_t structure to print |
| 893 | * @note For #PLIST_DATA nodes, only a maximum of 24 bytes (first 16 and last 8) are written. | 909 | * @note For #PLIST_DATA nodes, only a maximum of 24 bytes (first 16 and last 8) are written. |
| 894 | */ | 910 | */ |
| 895 | void plist_print(plist_t plist); | 911 | PLIST_API void plist_print(plist_t plist); |
| 896 | 912 | ||
| 897 | /** | 913 | /** |
| 898 | * Test if in-memory plist data is in binary format. | 914 | * Test if in-memory plist data is in binary format. |
| @@ -906,7 +922,7 @@ extern "C" | |||
| 906 | * @param length length of the buffer to read. | 922 | * @param length length of the buffer to read. |
| 907 | * @return 1 if the buffer is a binary plist, 0 otherwise. | 923 | * @return 1 if the buffer is a binary plist, 0 otherwise. |
| 908 | */ | 924 | */ |
| 909 | int plist_is_binary(const char *plist_data, uint32_t length); | 925 | PLIST_API int plist_is_binary(const char *plist_data, uint32_t length); |
| 910 | 926 | ||
| 911 | /******************************************** | 927 | /******************************************** |
| 912 | * * | 928 | * * |
| @@ -923,7 +939,7 @@ extern "C" | |||
| 923 | * @param length length of the path to access | 939 | * @param length length of the path to access |
| 924 | * @return the value to access. | 940 | * @return the value to access. |
| 925 | */ | 941 | */ |
| 926 | plist_t plist_access_path(plist_t plist, uint32_t length, ...); | 942 | PLIST_API plist_t plist_access_path(plist_t plist, uint32_t length, ...); |
| 927 | 943 | ||
| 928 | /** | 944 | /** |
| 929 | * Variadic version of #plist_access_path. | 945 | * Variadic version of #plist_access_path. |
| @@ -933,7 +949,7 @@ extern "C" | |||
| 933 | * @param v list of array's index and dic'st key | 949 | * @param v list of array's index and dic'st key |
| 934 | * @return the value to access. | 950 | * @return the value to access. |
| 935 | */ | 951 | */ |
| 936 | plist_t plist_access_pathv(plist_t plist, uint32_t length, va_list v); | 952 | PLIST_API plist_t plist_access_pathv(plist_t plist, uint32_t length, va_list v); |
| 937 | 953 | ||
| 938 | /** | 954 | /** |
| 939 | * Compare two node values | 955 | * Compare two node values |
| @@ -942,7 +958,7 @@ extern "C" | |||
| 942 | * @param node_r rigth node to compare | 958 | * @param node_r rigth node to compare |
| 943 | * @return TRUE is type and value match, FALSE otherwise. | 959 | * @return TRUE is type and value match, FALSE otherwise. |
| 944 | */ | 960 | */ |
| 945 | char plist_compare_node_value(plist_t node_l, plist_t node_r); | 961 | PLIST_API char plist_compare_node_value(plist_t node_l, plist_t node_r); |
| 946 | 962 | ||
| 947 | /** Helper macro used by PLIST_IS_* macros that will evaluate the type of a plist node. */ | 963 | /** Helper macro used by PLIST_IS_* macros that will evaluate the type of a plist node. */ |
| 948 | #define _PLIST_IS_TYPE(__plist, __plist_type) (__plist && (plist_get_node_type(__plist) == PLIST_##__plist_type)) | 964 | #define _PLIST_IS_TYPE(__plist, __plist_type) (__plist && (plist_get_node_type(__plist) == PLIST_##__plist_type)) |
| @@ -977,7 +993,7 @@ extern "C" | |||
| 977 | * @param boolnode node of type PLIST_BOOL | 993 | * @param boolnode node of type PLIST_BOOL |
| 978 | * @return 1 if the boolean node has a value of TRUE or 0 if FALSE. | 994 | * @return 1 if the boolean node has a value of TRUE or 0 if FALSE. |
| 979 | */ | 995 | */ |
| 980 | int plist_bool_val_is_true(plist_t boolnode); | 996 | PLIST_API int plist_bool_val_is_true(plist_t boolnode); |
| 981 | 997 | ||
| 982 | /** | 998 | /** |
| 983 | * Helper function to test if a given #PLIST_INT node's value is negative | 999 | * Helper function to test if a given #PLIST_INT node's value is negative |
| @@ -985,7 +1001,7 @@ extern "C" | |||
| 985 | * @param intnode node of type PLIST_INT | 1001 | * @param intnode node of type PLIST_INT |
| 986 | * @return 1 if the node's value is negative, or 0 if positive. | 1002 | * @return 1 if the node's value is negative, or 0 if positive. |
| 987 | */ | 1003 | */ |
| 988 | int plist_int_val_is_negative(plist_t intnode); | 1004 | PLIST_API int plist_int_val_is_negative(plist_t intnode); |
| 989 | 1005 | ||
| 990 | /** | 1006 | /** |
| 991 | * Helper function to compare the value of a PLIST_INT node against | 1007 | * Helper function to compare the value of a PLIST_INT node against |
| @@ -997,7 +1013,7 @@ extern "C" | |||
| 997 | * 1 if the node's value is greater than cmpval, | 1013 | * 1 if the node's value is greater than cmpval, |
| 998 | * or -1 if the node's value is less than cmpval. | 1014 | * or -1 if the node's value is less than cmpval. |
| 999 | */ | 1015 | */ |
| 1000 | int plist_int_val_compare(plist_t uintnode, int64_t cmpval); | 1016 | PLIST_API int plist_int_val_compare(plist_t uintnode, int64_t cmpval); |
| 1001 | 1017 | ||
| 1002 | /** | 1018 | /** |
| 1003 | * Helper function to compare the value of a PLIST_INT node against | 1019 | * Helper function to compare the value of a PLIST_INT node against |
| @@ -1009,7 +1025,7 @@ extern "C" | |||
| 1009 | * 1 if the node's value is greater than cmpval, | 1025 | * 1 if the node's value is greater than cmpval, |
| 1010 | * or -1 if the node's value is less than cmpval. | 1026 | * or -1 if the node's value is less than cmpval. |
| 1011 | */ | 1027 | */ |
| 1012 | int plist_uint_val_compare(plist_t uintnode, uint64_t cmpval); | 1028 | PLIST_API int plist_uint_val_compare(plist_t uintnode, uint64_t cmpval); |
| 1013 | 1029 | ||
| 1014 | /** | 1030 | /** |
| 1015 | * Helper function to compare the value of a PLIST_UID node against | 1031 | * Helper function to compare the value of a PLIST_UID node against |
| @@ -1021,7 +1037,7 @@ extern "C" | |||
| 1021 | * 1 if the node's value is greater than cmpval, | 1037 | * 1 if the node's value is greater than cmpval, |
| 1022 | * or -1 if the node's value is less than cmpval. | 1038 | * or -1 if the node's value is less than cmpval. |
| 1023 | */ | 1039 | */ |
| 1024 | int plist_uid_val_compare(plist_t uidnode, uint64_t cmpval); | 1040 | PLIST_API int plist_uid_val_compare(plist_t uidnode, uint64_t cmpval); |
| 1025 | 1041 | ||
| 1026 | /** | 1042 | /** |
| 1027 | * Helper function to compare the value of a PLIST_REAL node against | 1043 | * Helper function to compare the value of a PLIST_REAL node against |
| @@ -1038,7 +1054,7 @@ extern "C" | |||
| 1038 | * 1 if the node's value is greater than cmpval, | 1054 | * 1 if the node's value is greater than cmpval, |
| 1039 | * or -1 if the node's value is less than cmpval. | 1055 | * or -1 if the node's value is less than cmpval. |
| 1040 | */ | 1056 | */ |
| 1041 | int plist_real_val_compare(plist_t realnode, double cmpval); | 1057 | PLIST_API int plist_real_val_compare(plist_t realnode, double cmpval); |
| 1042 | 1058 | ||
| 1043 | /** | 1059 | /** |
| 1044 | * Helper function to compare the value of a PLIST_DATE node against | 1060 | * Helper function to compare the value of a PLIST_DATE node against |
| @@ -1051,7 +1067,7 @@ extern "C" | |||
| 1051 | * 1 if the node's date is greater than the supplied values, | 1067 | * 1 if the node's date is greater than the supplied values, |
| 1052 | * or -1 if the node's date is less than the supplied values. | 1068 | * or -1 if the node's date is less than the supplied values. |
| 1053 | */ | 1069 | */ |
| 1054 | int plist_date_val_compare(plist_t datenode, int32_t cmpsec, int32_t cmpusec); | 1070 | PLIST_API int plist_date_val_compare(plist_t datenode, int32_t cmpsec, int32_t cmpusec); |
| 1055 | 1071 | ||
| 1056 | /** | 1072 | /** |
| 1057 | * Helper function to compare the value of a PLIST_STRING node against | 1073 | * Helper function to compare the value of a PLIST_STRING node against |
| @@ -1064,7 +1080,7 @@ extern "C" | |||
| 1064 | * > 0 if the node's value is lexicographically greater than cmpval, | 1080 | * > 0 if the node's value is lexicographically greater than cmpval, |
| 1065 | * or < 0 if the node's value is lexicographically less than cmpval. | 1081 | * or < 0 if the node's value is lexicographically less than cmpval. |
| 1066 | */ | 1082 | */ |
| 1067 | int plist_string_val_compare(plist_t strnode, const char* cmpval); | 1083 | PLIST_API int plist_string_val_compare(plist_t strnode, const char* cmpval); |
| 1068 | 1084 | ||
| 1069 | /** | 1085 | /** |
| 1070 | * Helper function to compare the value of a PLIST_STRING node against | 1086 | * Helper function to compare the value of a PLIST_STRING node against |
| @@ -1078,7 +1094,7 @@ extern "C" | |||
| 1078 | * > 0 if the node's value is lexicographically greater than cmpval, | 1094 | * > 0 if the node's value is lexicographically greater than cmpval, |
| 1079 | * or < 0 if the node's value is lexicographically less than cmpval. | 1095 | * or < 0 if the node's value is lexicographically less than cmpval. |
| 1080 | */ | 1096 | */ |
| 1081 | int plist_string_val_compare_with_size(plist_t strnode, const char* cmpval, size_t n); | 1097 | PLIST_API int plist_string_val_compare_with_size(plist_t strnode, const char* cmpval, size_t n); |
| 1082 | 1098 | ||
| 1083 | /** | 1099 | /** |
| 1084 | * Helper function to match a given substring in the value of a | 1100 | * Helper function to match a given substring in the value of a |
| @@ -1089,7 +1105,7 @@ extern "C" | |||
| 1089 | * @return 1 if the node's value contains the given substring, | 1105 | * @return 1 if the node's value contains the given substring, |
| 1090 | * or 0 if not. | 1106 | * or 0 if not. |
| 1091 | */ | 1107 | */ |
| 1092 | int plist_string_val_contains(plist_t strnode, const char* substr); | 1108 | PLIST_API int plist_string_val_contains(plist_t strnode, const char* substr); |
| 1093 | 1109 | ||
| 1094 | /** | 1110 | /** |
| 1095 | * Helper function to compare the value of a PLIST_KEY node against | 1111 | * Helper function to compare the value of a PLIST_KEY node against |
| @@ -1102,7 +1118,7 @@ extern "C" | |||
| 1102 | * > 0 if the node's value is lexicographically greater than cmpval, | 1118 | * > 0 if the node's value is lexicographically greater than cmpval, |
| 1103 | * or < 0 if the node's value is lexicographically less than cmpval. | 1119 | * or < 0 if the node's value is lexicographically less than cmpval. |
| 1104 | */ | 1120 | */ |
| 1105 | int plist_key_val_compare(plist_t keynode, const char* cmpval); | 1121 | PLIST_API int plist_key_val_compare(plist_t keynode, const char* cmpval); |
| 1106 | 1122 | ||
| 1107 | /** | 1123 | /** |
| 1108 | * Helper function to compare the value of a PLIST_KEY node against | 1124 | * Helper function to compare the value of a PLIST_KEY node against |
| @@ -1116,7 +1132,7 @@ extern "C" | |||
| 1116 | * > 0 if the node's value is lexicographically greater than cmpval, | 1132 | * > 0 if the node's value is lexicographically greater than cmpval, |
| 1117 | * or < 0 if the node's value is lexicographically less than cmpval. | 1133 | * or < 0 if the node's value is lexicographically less than cmpval. |
| 1118 | */ | 1134 | */ |
| 1119 | int plist_key_val_compare_with_size(plist_t keynode, const char* cmpval, size_t n); | 1135 | PLIST_API int plist_key_val_compare_with_size(plist_t keynode, const char* cmpval, size_t n); |
| 1120 | 1136 | ||
| 1121 | /** | 1137 | /** |
| 1122 | * Helper function to match a given substring in the value of a | 1138 | * Helper function to match a given substring in the value of a |
| @@ -1127,7 +1143,7 @@ extern "C" | |||
| 1127 | * @return 1 if the node's value contains the given substring, | 1143 | * @return 1 if the node's value contains the given substring, |
| 1128 | * or 0 if not. | 1144 | * or 0 if not. |
| 1129 | */ | 1145 | */ |
| 1130 | int plist_key_val_contains(plist_t keynode, const char* substr); | 1146 | PLIST_API int plist_key_val_contains(plist_t keynode, const char* substr); |
| 1131 | 1147 | ||
| 1132 | /** | 1148 | /** |
| 1133 | * Helper function to compare the data of a PLIST_DATA node against | 1149 | * Helper function to compare the data of a PLIST_DATA node against |
| @@ -1143,7 +1159,7 @@ extern "C" | |||
| 1143 | * > 0 if the node's value is lexicographically greater than cmpval, | 1159 | * > 0 if the node's value is lexicographically greater than cmpval, |
| 1144 | * or < 0 if the node's value is lexicographically less than cmpval. | 1160 | * or < 0 if the node's value is lexicographically less than cmpval. |
| 1145 | */ | 1161 | */ |
| 1146 | int plist_data_val_compare(plist_t datanode, const uint8_t* cmpval, size_t n); | 1162 | PLIST_API int plist_data_val_compare(plist_t datanode, const uint8_t* cmpval, size_t n); |
| 1147 | 1163 | ||
| 1148 | /** | 1164 | /** |
| 1149 | * Helper function to compare the data of a PLIST_DATA node against | 1165 | * Helper function to compare the data of a PLIST_DATA node against |
| @@ -1159,7 +1175,7 @@ extern "C" | |||
| 1159 | * > 0 if the node's value is lexicographically greater than cmpval, | 1175 | * > 0 if the node's value is lexicographically greater than cmpval, |
| 1160 | * or < 0 if the node's value is lexicographically less than cmpval. | 1176 | * or < 0 if the node's value is lexicographically less than cmpval. |
| 1161 | */ | 1177 | */ |
| 1162 | int plist_data_val_compare_with_size(plist_t datanode, const uint8_t* cmpval, size_t n); | 1178 | PLIST_API int plist_data_val_compare_with_size(plist_t datanode, const uint8_t* cmpval, size_t n); |
| 1163 | 1179 | ||
| 1164 | /** | 1180 | /** |
| 1165 | * Helper function to match a given data blob within the value of a | 1181 | * Helper function to match a given data blob within the value of a |
| @@ -1171,7 +1187,7 @@ extern "C" | |||
| 1171 | * @return 1 if the node's value contains the given data blob | 1187 | * @return 1 if the node's value contains the given data blob |
| 1172 | * or 0 if not. | 1188 | * or 0 if not. |
| 1173 | */ | 1189 | */ |
| 1174 | int plist_data_val_contains(plist_t datanode, const uint8_t* cmpval, size_t n); | 1190 | PLIST_API int plist_data_val_contains(plist_t datanode, const uint8_t* cmpval, size_t n); |
| 1175 | 1191 | ||
| 1176 | /** | 1192 | /** |
| 1177 | * Sort all PLIST_DICT key/value pairs in a property list lexicographically | 1193 | * Sort all PLIST_DICT key/value pairs in a property list lexicographically |
| @@ -1179,7 +1195,7 @@ extern "C" | |||
| 1179 | * | 1195 | * |
| 1180 | * @param plist The property list to perform the sorting operation on. | 1196 | * @param plist The property list to perform the sorting operation on. |
| 1181 | */ | 1197 | */ |
| 1182 | void plist_sort(plist_t plist); | 1198 | PLIST_API void plist_sort(plist_t plist); |
| 1183 | 1199 | ||
| 1184 | /** | 1200 | /** |
| 1185 | * Free memory allocated by relevant libplist API calls: | 1201 | * Free memory allocated by relevant libplist API calls: |
| @@ -1194,7 +1210,7 @@ extern "C" | |||
| 1194 | * @note Do not use this function to free plist_t nodes, use plist_free() | 1210 | * @note Do not use this function to free plist_t nodes, use plist_free() |
| 1195 | * instead. | 1211 | * instead. |
| 1196 | */ | 1212 | */ |
| 1197 | void plist_mem_free(void* ptr); | 1213 | PLIST_API void plist_mem_free(void* ptr); |
| 1198 | 1214 | ||
| 1199 | /** | 1215 | /** |
| 1200 | * Set debug level for the format parsers. | 1216 | * Set debug level for the format parsers. |
| @@ -1202,7 +1218,7 @@ extern "C" | |||
| 1202 | * | 1218 | * |
| 1203 | * @param debug Debug level. Currently, only 0 (off) and 1 (enabled) are supported. | 1219 | * @param debug Debug level. Currently, only 0 (off) and 1 (enabled) are supported. |
| 1204 | */ | 1220 | */ |
| 1205 | void plist_set_debug(int debug); | 1221 | PLIST_API void plist_set_debug(int debug); |
| 1206 | 1222 | ||
| 1207 | /*@}*/ | 1223 | /*@}*/ |
| 1208 | 1224 | ||
diff --git a/src/bplist.c b/src/bplist.c index e9b71eb..840e40c 100644 --- a/src/bplist.c +++ b/src/bplist.c | |||
| @@ -781,7 +781,7 @@ static plist_t parse_bin_node_at_index(struct bplist_data *bplist, uint32_t node | |||
| 781 | return plist; | 781 | return plist; |
| 782 | } | 782 | } |
| 783 | 783 | ||
| 784 | PLIST_API plist_err_t plist_from_bin(const char *plist_bin, uint32_t length, plist_t * plist) | 784 | plist_err_t plist_from_bin(const char *plist_bin, uint32_t length, plist_t * plist) |
| 785 | { | 785 | { |
| 786 | bplist_trailer_t *trailer = NULL; | 786 | bplist_trailer_t *trailer = NULL; |
| 787 | uint8_t offset_size = 0; | 787 | uint8_t offset_size = 0; |
| @@ -1191,7 +1191,7 @@ static int is_ascii_string(char* s, int len) | |||
| 1191 | return ret; | 1191 | return ret; |
| 1192 | } | 1192 | } |
| 1193 | 1193 | ||
| 1194 | PLIST_API plist_err_t plist_to_bin(plist_t plist, char **plist_bin, uint32_t * length) | 1194 | plist_err_t plist_to_bin(plist_t plist, char **plist_bin, uint32_t * length) |
| 1195 | { | 1195 | { |
| 1196 | ptrarray_t* objects = NULL; | 1196 | ptrarray_t* objects = NULL; |
| 1197 | hashtable_t* ref_table = NULL; | 1197 | hashtable_t* ref_table = NULL; |
diff --git a/src/jplist.c b/src/jplist.c index d6ea942..9263b36 100644 --- a/src/jplist.c +++ b/src/jplist.c | |||
| @@ -398,7 +398,7 @@ static int node_estimate_size(node_t node, uint64_t *size, uint32_t depth, int p | |||
| 398 | return PLIST_ERR_SUCCESS; | 398 | return PLIST_ERR_SUCCESS; |
| 399 | } | 399 | } |
| 400 | 400 | ||
| 401 | PLIST_API int plist_to_json(plist_t plist, char **json, uint32_t* length, int prettify) | 401 | int plist_to_json(plist_t plist, char **json, uint32_t* length, int prettify) |
| 402 | { | 402 | { |
| 403 | uint64_t size = 0; | 403 | uint64_t size = 0; |
| 404 | int res; | 404 | int res; |
| @@ -782,7 +782,7 @@ static plist_t parse_object(const char* js, jsmntok_info_t* ti, int* index) | |||
| 782 | return obj; | 782 | return obj; |
| 783 | } | 783 | } |
| 784 | 784 | ||
| 785 | PLIST_API int plist_from_json(const char *json, uint32_t length, plist_t * plist) | 785 | int plist_from_json(const char *json, uint32_t length, plist_t * plist) |
| 786 | { | 786 | { |
| 787 | if (!plist) { | 787 | if (!plist) { |
| 788 | return PLIST_ERR_INVALID_ARG; | 788 | return PLIST_ERR_INVALID_ARG; |
diff --git a/src/oplist.c b/src/oplist.c index 2c7d26c..74c4e0a 100644 --- a/src/oplist.c +++ b/src/oplist.c | |||
| @@ -442,7 +442,7 @@ static int node_estimate_size(node_t node, uint64_t *size, uint32_t depth, int p | |||
| 442 | return PLIST_ERR_SUCCESS; | 442 | return PLIST_ERR_SUCCESS; |
| 443 | } | 443 | } |
| 444 | 444 | ||
| 445 | PLIST_API int plist_to_openstep(plist_t plist, char **openstep, uint32_t* length, int prettify) | 445 | int plist_to_openstep(plist_t plist, char **openstep, uint32_t* length, int prettify) |
| 446 | { | 446 | { |
| 447 | uint64_t size = 0; | 447 | uint64_t size = 0; |
| 448 | int res; | 448 | int res; |
| @@ -895,7 +895,7 @@ err_out: | |||
| 895 | return PLIST_ERR_SUCCESS; | 895 | return PLIST_ERR_SUCCESS; |
| 896 | } | 896 | } |
| 897 | 897 | ||
| 898 | PLIST_API int plist_from_openstep(const char *plist_ostep, uint32_t length, plist_t * plist) | 898 | int plist_from_openstep(const char *plist_ostep, uint32_t length, plist_t * plist) |
| 899 | { | 899 | { |
| 900 | if (!plist) { | 900 | if (!plist) { |
| 901 | return PLIST_ERR_INVALID_ARG; | 901 | return PLIST_ERR_INVALID_ARG; |
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 | } |
diff --git a/src/plist.h b/src/plist.h index 13dc286..4351ce4 100644 --- a/src/plist.h +++ b/src/plist.h | |||
| @@ -37,16 +37,6 @@ | |||
| 37 | #pragma warning(disable:4244) | 37 | #pragma warning(disable:4244) |
| 38 | #endif | 38 | #endif |
| 39 | 39 | ||
| 40 | #ifdef WIN32 | ||
| 41 | #define PLIST_API __declspec( dllexport ) | ||
| 42 | #else | ||
| 43 | #ifdef HAVE_FVISIBILITY | ||
| 44 | #define PLIST_API __attribute__((visibility("default"))) | ||
| 45 | #else | ||
| 46 | #define PLIST_API | ||
| 47 | #endif | ||
| 48 | #endif | ||
| 49 | |||
| 50 | struct plist_data_s | 40 | struct plist_data_s |
| 51 | { | 41 | { |
| 52 | union | 42 | union |
diff --git a/src/xplist.c b/src/xplist.c index a0ab6d3..481da5d 100644 --- a/src/xplist.c +++ b/src/xplist.c | |||
| @@ -529,7 +529,7 @@ static int node_estimate_size(node_t node, uint64_t *size, uint32_t depth) | |||
| 529 | return PLIST_ERR_SUCCESS; | 529 | return PLIST_ERR_SUCCESS; |
| 530 | } | 530 | } |
| 531 | 531 | ||
| 532 | PLIST_API plist_err_t plist_to_xml(plist_t plist, char **plist_xml, uint32_t * length) | 532 | plist_err_t plist_to_xml(plist_t plist, char **plist_xml, uint32_t * length) |
| 533 | { | 533 | { |
| 534 | uint64_t size = 0; | 534 | uint64_t size = 0; |
| 535 | int res; | 535 | int res; |
| @@ -1471,7 +1471,7 @@ err_out: | |||
| 1471 | return PLIST_ERR_SUCCESS; | 1471 | return PLIST_ERR_SUCCESS; |
| 1472 | } | 1472 | } |
| 1473 | 1473 | ||
| 1474 | PLIST_API plist_err_t plist_from_xml(const char *plist_xml, uint32_t length, plist_t * plist) | 1474 | plist_err_t plist_from_xml(const char *plist_xml, uint32_t length, plist_t * plist) |
| 1475 | { | 1475 | { |
| 1476 | if (!plist) { | 1476 | if (!plist) { |
| 1477 | return PLIST_ERR_INVALID_ARG; | 1477 | return PLIST_ERR_INVALID_ARG; |
