summaryrefslogtreecommitdiffstats
path: root/src/plist.c
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2024-05-13 19:38:22 +0200
committerGravatar Nikias Bassen2024-05-13 19:38:22 +0200
commit1327c87bf92f1d51286e3172c1047a8a47c5ee3a (patch)
tree8edf522f2d5b749027810c73b55270a3d3477dc3 /src/plist.c
parent06877b5ecb9704baded1160a149912fad8141a39 (diff)
downloadlibplist-1327c87bf92f1d51286e3172c1047a8a47c5ee3a.tar.gz
libplist-1327c87bf92f1d51286e3172c1047a8a47c5ee3a.tar.bz2
Revert "Change API around #PLIST_DATA to use uint8_t instead of char arrays"
This reverts commit a91f5740d100414a76959714b819422ee5b2d8a8.
Diffstat (limited to 'src/plist.c')
-rw-r--r--src/plist.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/plist.c b/src/plist.c
index d1b0b5a..a425466 100644
--- a/src/plist.c
+++ b/src/plist.c
@@ -544,7 +544,7 @@ plist_t plist_new_real(double val)
544 return plist_new_node(data); 544 return plist_new_node(data);
545} 545}
546 546
547plist_t plist_new_data(const uint8_t *val, uint64_t length) 547plist_t plist_new_data(const char *val, uint64_t length)
548{ 548{
549 plist_data_t data = plist_new_plist_data(); 549 plist_data_t data = plist_new_plist_data();
550 data->type = PLIST_DATA; 550 data->type = PLIST_DATA;
@@ -1385,7 +1385,7 @@ void plist_get_real_val(plist_t node, double *val)
1385 assert(length == sizeof(double)); 1385 assert(length == sizeof(double));
1386} 1386}
1387 1387
1388void plist_get_data_val(plist_t node, uint8_t **val, uint64_t * length) 1388void plist_get_data_val(plist_t node, char **val, uint64_t * length)
1389{ 1389{
1390 if (!node || !val || !length) 1390 if (!node || !val || !length)
1391 return; 1391 return;
@@ -1395,7 +1395,7 @@ void plist_get_data_val(plist_t node, uint8_t **val, uint64_t * length)
1395 plist_get_type_and_value(node, &type, (void *) val, length); 1395 plist_get_type_and_value(node, &type, (void *) val, length);
1396} 1396}
1397 1397
1398const uint8_t* plist_get_data_ptr(plist_t node, uint64_t* length) 1398const char* plist_get_data_ptr(plist_t node, uint64_t* length)
1399{ 1399{
1400 if (!node || !length) 1400 if (!node || !length)
1401 return NULL; 1401 return NULL;
@@ -1404,7 +1404,7 @@ const uint8_t* plist_get_data_ptr(plist_t node, uint64_t* length)
1404 return NULL; 1404 return NULL;
1405 plist_data_t data = plist_get_data(node); 1405 plist_data_t data = plist_get_data(node);
1406 *length = data->length; 1406 *length = data->length;
1407 return data->buff; 1407 return (const char*)data->buff;
1408} 1408}
1409 1409
1410void plist_get_date_val(plist_t node, int32_t * sec, int32_t * usec) 1410void plist_get_date_val(plist_t node, int32_t * sec, int32_t * usec)
@@ -1575,7 +1575,7 @@ void plist_set_real_val(plist_t node, double val)
1575 plist_set_element_val(node, PLIST_REAL, &val, sizeof(double)); 1575 plist_set_element_val(node, PLIST_REAL, &val, sizeof(double));
1576} 1576}
1577 1577
1578void plist_set_data_val(plist_t node, const uint8_t *val, uint64_t length) 1578void plist_set_data_val(plist_t node, const char *val, uint64_t length)
1579{ 1579{
1580 plist_set_element_val(node, PLIST_DATA, val, length); 1580 plist_set_element_val(node, PLIST_DATA, val, length);
1581} 1581}