diff options
| author | 2019-11-07 04:54:45 +0100 | |
|---|---|---|
| committer | 2019-11-07 04:54:45 +0100 | |
| commit | 49cbc8df7672c4dd5fa0c73e9046ee91924ae4b8 (patch) | |
| tree | bc339ae6a11d149538d0a82af105bb73a86b6e17 /include/plist/plist.h | |
| parent | 4d4586903b4cbab8b307a406e894e34b4b19a723 (diff) | |
| download | libplist-49cbc8df7672c4dd5fa0c73e9046ee91924ae4b8.tar.gz libplist-49cbc8df7672c4dd5fa0c73e9046ee91924ae4b8.tar.bz2 | |
Add plist_get_data_ptr() and plist_get_string_ptr() to the interface
Diffstat (limited to 'include/plist/plist.h')
| -rw-r--r-- | include/plist/plist.h | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/include/plist/plist.h b/include/plist/plist.h index 824ba43..29b1fce 100644 --- a/include/plist/plist.h +++ b/include/plist/plist.h | |||
| @@ -463,6 +463,19 @@ extern "C" | |||
| 463 | void plist_get_string_val(plist_t node, char **val); | 463 | void plist_get_string_val(plist_t node, char **val); |
| 464 | 464 | ||
| 465 | /** | 465 | /** |
| 466 | * Get a pointer to the buffer of a #PLIST_STRING node. | ||
| 467 | * | ||
| 468 | * @note DO NOT MODIFY the buffer. Mind that the buffer is only available | ||
| 469 | * until the plist node gets freed. Make a copy if needed. | ||
| 470 | * | ||
| 471 | * @param node The node | ||
| 472 | * @param length If non-NULL, will be set to the length of the string | ||
| 473 | * | ||
| 474 | * @return Pointer to the NULL-terminated buffer. | ||
| 475 | */ | ||
| 476 | const char* plist_get_string_ptr(plist_t node, uint64_t* length); | ||
| 477 | |||
| 478 | /** | ||
| 466 | * Get the value of a #PLIST_BOOLEAN node. | 479 | * Get the value of a #PLIST_BOOLEAN node. |
| 467 | * This function does nothing if node is not of type #PLIST_BOOLEAN | 480 | * This function does nothing if node is not of type #PLIST_BOOLEAN |
| 468 | * | 481 | * |
| @@ -501,6 +514,19 @@ extern "C" | |||
| 501 | void plist_get_data_val(plist_t node, char **val, uint64_t * length); | 514 | void plist_get_data_val(plist_t node, char **val, uint64_t * length); |
| 502 | 515 | ||
| 503 | /** | 516 | /** |
| 517 | * Get a pointer to the data buffer of a #PLIST_DATA node. | ||
| 518 | * | ||
| 519 | * @note DO NOT MODIFY the buffer. Mind that the buffer is only available | ||
| 520 | * until the plist node gets freed. Make a copy if needed. | ||
| 521 | * | ||
| 522 | * @param node The node | ||
| 523 | * @param length Pointer to a uint64_t that will be set to the length of the buffer | ||
| 524 | * | ||
| 525 | * @return Pointer to the buffer | ||
| 526 | */ | ||
| 527 | const char* plist_get_data_ptr(plist_t node, uint64_t* length); | ||
| 528 | |||
| 529 | /** | ||
| 504 | * Get the value of a #PLIST_DATE node. | 530 | * Get the value of a #PLIST_DATE node. |
| 505 | * This function does nothing if node is not of type #PLIST_DATE | 531 | * This function does nothing if node is not of type #PLIST_DATE |
| 506 | * | 532 | * |
