summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2014-10-03 15:39:47 +0200
committerGravatar Nikias Bassen2014-10-03 15:39:47 +0200
commit62813daf2c4aaec675652d9c1131a58dfa634e38 (patch)
tree4427398d97f1295996410fc3dbf86c6de8bf873c /src
parenteab599c151617eef9035343fd63591fa4d09bd3e (diff)
downloadlibplist-62813daf2c4aaec675652d9c1131a58dfa634e38.tar.gz
libplist-62813daf2c4aaec675652d9c1131a58dfa634e38.tar.bz2
Avoid exporting non-public symbols
Diffstat (limited to 'src')
-rw-r--r--src/base64.h5
-rw-r--r--src/bplist.c4
-rw-r--r--src/bytearray.h7
-rw-r--r--src/common.h8
-rw-r--r--src/hashtable.h9
-rw-r--r--src/plist.c96
-rw-r--r--src/plist.h22
-rw-r--r--src/ptrarray.h9
-rw-r--r--src/xplist.c4
9 files changed, 82 insertions, 82 deletions
diff --git a/src/base64.h b/src/base64.h
index dbaf104..6eee33b 100644
--- a/src/base64.h
+++ b/src/base64.h
@@ -21,9 +21,8 @@
21#ifndef BASE64_H 21#ifndef BASE64_H
22#define BASE64_H 22#define BASE64_H
23#include <stdlib.h> 23#include <stdlib.h>
24#include "common.h"
25 24
26_PLIST_INTERNAL char *base64encode(const unsigned char *buf, size_t *size); 25char *base64encode(const unsigned char *buf, size_t *size);
27_PLIST_INTERNAL unsigned char *base64decode(const char *buf, size_t *size); 26unsigned char *base64decode(const char *buf, size_t *size);
28 27
29#endif 28#endif
diff --git a/src/bplist.c b/src/bplist.c
index 181c150..bb3465b 100644
--- a/src/bplist.c
+++ b/src/bplist.c
@@ -599,7 +599,7 @@ static void* copy_plist_data(const void* src)
599 return dstdata; 599 return dstdata;
600} 600}
601 601
602void plist_from_bin(const char *plist_bin, uint32_t length, plist_t * plist) 602PLIST_API void plist_from_bin(const char *plist_bin, uint32_t length, plist_t * plist)
603{ 603{
604 char *trailer = NULL; 604 char *trailer = NULL;
605 605
@@ -1095,7 +1095,7 @@ static uint16_t *plist_utf8_to_utf16(char *unistr, long size, long *items_read,
1095 1095
1096} 1096}
1097 1097
1098void plist_to_bin(plist_t plist, char **plist_bin, uint32_t * length) 1098PLIST_API void plist_to_bin(plist_t plist, char **plist_bin, uint32_t * length)
1099{ 1099{
1100 ptrarray_t* objects = NULL; 1100 ptrarray_t* objects = NULL;
1101 hashtable_t* ref_table = NULL; 1101 hashtable_t* ref_table = NULL;
diff --git a/src/bytearray.h b/src/bytearray.h
index 3e67d7e..1613143 100644
--- a/src/bytearray.h
+++ b/src/bytearray.h
@@ -21,7 +21,6 @@
21#ifndef BYTEARRAY_H 21#ifndef BYTEARRAY_H
22#define BYTEARRAY_H 22#define BYTEARRAY_H
23#include <stdlib.h> 23#include <stdlib.h>
24#include "common.h"
25 24
26typedef struct bytearray_t { 25typedef struct bytearray_t {
27 void *data; 26 void *data;
@@ -29,8 +28,8 @@ typedef struct bytearray_t {
29 size_t capacity; 28 size_t capacity;
30} bytearray_t; 29} bytearray_t;
31 30
32_PLIST_INTERNAL bytearray_t *byte_array_new(); 31bytearray_t *byte_array_new();
33_PLIST_INTERNAL void byte_array_free(bytearray_t *ba); 32void byte_array_free(bytearray_t *ba);
34_PLIST_INTERNAL void byte_array_append(bytearray_t *ba, void *buf, size_t len); 33void byte_array_append(bytearray_t *ba, void *buf, size_t len);
35 34
36#endif 35#endif
diff --git a/src/common.h b/src/common.h
index c71ef4a..657e049 100644
--- a/src/common.h
+++ b/src/common.h
@@ -17,12 +17,4 @@
17#endif 17#endif
18#endif 18#endif
19 19
20#if defined(__GNUC__) && (__GNUC__ >= 4) && !defined(__CYGWIN__) && !defined(WIN32)
21# define _PLIST_INTERNAL __attribute__((visibility("hidden")))
22#elif defined(__SUNPRO_C) && (__SUNPRO_C >= 0x550)
23# define _PLIST_INTERNAL __hidden
24#else /* not gcc >= 4 and not Sun Studio >= 8 */
25# define _PLIST_INTERNAL
26#endif /* GNUC >= 4 */
27
28#endif 20#endif
diff --git a/src/hashtable.h b/src/hashtable.h
index 8c72c82..c28de91 100644
--- a/src/hashtable.h
+++ b/src/hashtable.h
@@ -21,7 +21,6 @@
21#ifndef HASHTABLE_H 21#ifndef HASHTABLE_H
22#define HASHTABLE_H 22#define HASHTABLE_H
23#include <stdlib.h> 23#include <stdlib.h>
24#include "common.h"
25 24
26typedef struct hashentry_t { 25typedef struct hashentry_t {
27 void *key; 26 void *key;
@@ -39,10 +38,10 @@ typedef struct hashtable_t {
39 compare_func_t compare_func; 38 compare_func_t compare_func;
40} hashtable_t; 39} hashtable_t;
41 40
42_PLIST_INTERNAL hashtable_t* hash_table_new(hash_func_t hash_func, compare_func_t compare_func); 41hashtable_t* hash_table_new(hash_func_t hash_func, compare_func_t compare_func);
43_PLIST_INTERNAL void hash_table_destroy(hashtable_t *ht); 42void hash_table_destroy(hashtable_t *ht);
44 43
45_PLIST_INTERNAL void hash_table_insert(hashtable_t* ht, void *key, void *value); 44void hash_table_insert(hashtable_t* ht, void *key, void *value);
46_PLIST_INTERNAL void* hash_table_lookup(hashtable_t* ht, void *key); 45void* hash_table_lookup(hashtable_t* ht, void *key);
47 46
48#endif 47#endif
diff --git a/src/plist.c b/src/plist.c
index 317a758..c38b6eb 100644
--- a/src/plist.c
+++ b/src/plist.c
@@ -87,14 +87,14 @@ static int plist_free_node(node_t* node)
87 return node_index; 87 return node_index;
88} 88}
89 89
90plist_t plist_new_dict(void) 90PLIST_API plist_t plist_new_dict(void)
91{ 91{
92 plist_data_t data = plist_new_plist_data(); 92 plist_data_t data = plist_new_plist_data();
93 data->type = PLIST_DICT; 93 data->type = PLIST_DICT;
94 return plist_new_node(data); 94 return plist_new_node(data);
95} 95}
96 96
97plist_t plist_new_array(void) 97PLIST_API plist_t plist_new_array(void)
98{ 98{
99 plist_data_t data = plist_new_plist_data(); 99 plist_data_t data = plist_new_plist_data();
100 data->type = PLIST_ARRAY; 100 data->type = PLIST_ARRAY;
@@ -111,7 +111,7 @@ static plist_t plist_new_key(const char *val)
111 return plist_new_node(data); 111 return plist_new_node(data);
112} 112}
113 113
114plist_t plist_new_string(const char *val) 114PLIST_API plist_t plist_new_string(const char *val)
115{ 115{
116 plist_data_t data = plist_new_plist_data(); 116 plist_data_t data = plist_new_plist_data();
117 data->type = PLIST_STRING; 117 data->type = PLIST_STRING;
@@ -120,7 +120,7 @@ plist_t plist_new_string(const char *val)
120 return plist_new_node(data); 120 return plist_new_node(data);
121} 121}
122 122
123plist_t plist_new_bool(uint8_t val) 123PLIST_API plist_t plist_new_bool(uint8_t val)
124{ 124{
125 plist_data_t data = plist_new_plist_data(); 125 plist_data_t data = plist_new_plist_data();
126 data->type = PLIST_BOOLEAN; 126 data->type = PLIST_BOOLEAN;
@@ -129,7 +129,7 @@ plist_t plist_new_bool(uint8_t val)
129 return plist_new_node(data); 129 return plist_new_node(data);
130} 130}
131 131
132plist_t plist_new_uint(uint64_t val) 132PLIST_API plist_t plist_new_uint(uint64_t val)
133{ 133{
134 plist_data_t data = plist_new_plist_data(); 134 plist_data_t data = plist_new_plist_data();
135 data->type = PLIST_UINT; 135 data->type = PLIST_UINT;
@@ -138,7 +138,7 @@ plist_t plist_new_uint(uint64_t val)
138 return plist_new_node(data); 138 return plist_new_node(data);
139} 139}
140 140
141plist_t plist_new_uid(uint64_t val) 141PLIST_API plist_t plist_new_uid(uint64_t val)
142{ 142{
143 plist_data_t data = plist_new_plist_data(); 143 plist_data_t data = plist_new_plist_data();
144 data->type = PLIST_UID; 144 data->type = PLIST_UID;
@@ -147,7 +147,7 @@ plist_t plist_new_uid(uint64_t val)
147 return plist_new_node(data); 147 return plist_new_node(data);
148} 148}
149 149
150plist_t plist_new_real(double val) 150PLIST_API plist_t plist_new_real(double val)
151{ 151{
152 plist_data_t data = plist_new_plist_data(); 152 plist_data_t data = plist_new_plist_data();
153 data->type = PLIST_REAL; 153 data->type = PLIST_REAL;
@@ -156,7 +156,7 @@ plist_t plist_new_real(double val)
156 return plist_new_node(data); 156 return plist_new_node(data);
157} 157}
158 158
159plist_t plist_new_data(const char *val, uint64_t length) 159PLIST_API plist_t plist_new_data(const char *val, uint64_t length)
160{ 160{
161 plist_data_t data = plist_new_plist_data(); 161 plist_data_t data = plist_new_plist_data();
162 data->type = PLIST_DATA; 162 data->type = PLIST_DATA;
@@ -166,7 +166,7 @@ plist_t plist_new_data(const char *val, uint64_t length)
166 return plist_new_node(data); 166 return plist_new_node(data);
167} 167}
168 168
169plist_t plist_new_date(int32_t sec, int32_t usec) 169PLIST_API plist_t plist_new_date(int32_t sec, int32_t usec)
170{ 170{
171 plist_data_t data = plist_new_plist_data(); 171 plist_data_t data = plist_new_plist_data();
172 data->type = PLIST_DATE; 172 data->type = PLIST_DATE;
@@ -176,7 +176,7 @@ plist_t plist_new_date(int32_t sec, int32_t usec)
176 return plist_new_node(data); 176 return plist_new_node(data);
177} 177}
178 178
179void plist_free(plist_t plist) 179PLIST_API void plist_free(plist_t plist)
180{ 180{
181 if (plist) 181 if (plist)
182 { 182 {
@@ -231,14 +231,14 @@ static void plist_copy_node(node_t *node, void *parent_node_ptr)
231 node_iterator_destroy(ni); 231 node_iterator_destroy(ni);
232} 232}
233 233
234plist_t plist_copy(plist_t node) 234PLIST_API plist_t plist_copy(plist_t node)
235{ 235{
236 plist_t copied = NULL; 236 plist_t copied = NULL;
237 plist_copy_node(node, &copied); 237 plist_copy_node(node, &copied);
238 return copied; 238 return copied;
239} 239}
240 240
241uint32_t plist_array_get_size(plist_t node) 241PLIST_API uint32_t plist_array_get_size(plist_t node)
242{ 242{
243 uint32_t ret = 0; 243 uint32_t ret = 0;
244 if (node && PLIST_ARRAY == plist_get_node_type(node)) 244 if (node && PLIST_ARRAY == plist_get_node_type(node))
@@ -248,7 +248,7 @@ uint32_t plist_array_get_size(plist_t node)
248 return ret; 248 return ret;
249} 249}
250 250
251plist_t plist_array_get_item(plist_t node, uint32_t n) 251PLIST_API plist_t plist_array_get_item(plist_t node, uint32_t n)
252{ 252{
253 plist_t ret = NULL; 253 plist_t ret = NULL;
254 if (node && PLIST_ARRAY == plist_get_node_type(node)) 254 if (node && PLIST_ARRAY == plist_get_node_type(node))
@@ -258,7 +258,7 @@ plist_t plist_array_get_item(plist_t node, uint32_t n)
258 return ret; 258 return ret;
259} 259}
260 260
261uint32_t plist_array_get_item_index(plist_t node) 261PLIST_API uint32_t plist_array_get_item_index(plist_t node)
262{ 262{
263 plist_t father = plist_get_parent(node); 263 plist_t father = plist_get_parent(node);
264 if (PLIST_ARRAY == plist_get_node_type(father)) 264 if (PLIST_ARRAY == plist_get_node_type(father))
@@ -268,7 +268,7 @@ uint32_t plist_array_get_item_index(plist_t node)
268 return 0; 268 return 0;
269} 269}
270 270
271void plist_array_set_item(plist_t node, plist_t item, uint32_t n) 271PLIST_API void plist_array_set_item(plist_t node, plist_t item, uint32_t n)
272{ 272{
273 if (node && PLIST_ARRAY == plist_get_node_type(node)) 273 if (node && PLIST_ARRAY == plist_get_node_type(node))
274 { 274 {
@@ -286,7 +286,7 @@ void plist_array_set_item(plist_t node, plist_t item, uint32_t n)
286 return; 286 return;
287} 287}
288 288
289void plist_array_append_item(plist_t node, plist_t item) 289PLIST_API void plist_array_append_item(plist_t node, plist_t item)
290{ 290{
291 if (node && PLIST_ARRAY == plist_get_node_type(node)) 291 if (node && PLIST_ARRAY == plist_get_node_type(node))
292 { 292 {
@@ -295,7 +295,7 @@ void plist_array_append_item(plist_t node, plist_t item)
295 return; 295 return;
296} 296}
297 297
298void plist_array_insert_item(plist_t node, plist_t item, uint32_t n) 298PLIST_API void plist_array_insert_item(plist_t node, plist_t item, uint32_t n)
299{ 299{
300 if (node && PLIST_ARRAY == plist_get_node_type(node)) 300 if (node && PLIST_ARRAY == plist_get_node_type(node))
301 { 301 {
@@ -304,7 +304,7 @@ void plist_array_insert_item(plist_t node, plist_t item, uint32_t n)
304 return; 304 return;
305} 305}
306 306
307void plist_array_remove_item(plist_t node, uint32_t n) 307PLIST_API void plist_array_remove_item(plist_t node, uint32_t n)
308{ 308{
309 if (node && PLIST_ARRAY == plist_get_node_type(node)) 309 if (node && PLIST_ARRAY == plist_get_node_type(node))
310 { 310 {
@@ -317,7 +317,7 @@ void plist_array_remove_item(plist_t node, uint32_t n)
317 return; 317 return;
318} 318}
319 319
320uint32_t plist_dict_get_size(plist_t node) 320PLIST_API uint32_t plist_dict_get_size(plist_t node)
321{ 321{
322 uint32_t ret = 0; 322 uint32_t ret = 0;
323 if (node && PLIST_DICT == plist_get_node_type(node)) 323 if (node && PLIST_DICT == plist_get_node_type(node))
@@ -327,7 +327,7 @@ uint32_t plist_dict_get_size(plist_t node)
327 return ret; 327 return ret;
328} 328}
329 329
330void plist_dict_new_iter(plist_t node, plist_dict_iter *iter) 330PLIST_API void plist_dict_new_iter(plist_t node, plist_dict_iter *iter)
331{ 331{
332 if (iter && *iter == NULL) 332 if (iter && *iter == NULL)
333 { 333 {
@@ -337,7 +337,7 @@ void plist_dict_new_iter(plist_t node, plist_dict_iter *iter)
337 return; 337 return;
338} 338}
339 339
340void plist_dict_next_item(plist_t node, plist_dict_iter iter, char **key, plist_t *val) 340PLIST_API void plist_dict_next_item(plist_t node, plist_dict_iter iter, char **key, plist_t *val)
341{ 341{
342 uint32_t* iter_int = (uint32_t*) iter; 342 uint32_t* iter_int = (uint32_t*) iter;
343 343
@@ -368,7 +368,7 @@ void plist_dict_next_item(plist_t node, plist_dict_iter iter, char **key, plist_
368 return; 368 return;
369} 369}
370 370
371void plist_dict_get_item_key(plist_t node, char **key) 371PLIST_API void plist_dict_get_item_key(plist_t node, char **key)
372{ 372{
373 plist_t father = plist_get_parent(node); 373 plist_t father = plist_get_parent(node);
374 if (PLIST_DICT == plist_get_node_type(father)) 374 if (PLIST_DICT == plist_get_node_type(father))
@@ -377,7 +377,7 @@ void plist_dict_get_item_key(plist_t node, char **key)
377 } 377 }
378} 378}
379 379
380plist_t plist_dict_get_item(plist_t node, const char* key) 380PLIST_API plist_t plist_dict_get_item(plist_t node, const char* key)
381{ 381{
382 plist_t ret = NULL; 382 plist_t ret = NULL;
383 383
@@ -403,7 +403,7 @@ plist_t plist_dict_get_item(plist_t node, const char* key)
403 return ret; 403 return ret;
404} 404}
405 405
406void plist_dict_set_item(plist_t node, const char* key, plist_t item) 406PLIST_API void plist_dict_set_item(plist_t node, const char* key, plist_t item)
407{ 407{
408 if (node && PLIST_DICT == plist_get_node_type(node)) { 408 if (node && PLIST_DICT == plist_get_node_type(node)) {
409 node_t* old_item = plist_dict_get_item(node, key); 409 node_t* old_item = plist_dict_get_item(node, key);
@@ -422,12 +422,12 @@ void plist_dict_set_item(plist_t node, const char* key, plist_t item)
422 return; 422 return;
423} 423}
424 424
425void plist_dict_insert_item(plist_t node, const char* key, plist_t item) 425PLIST_API void plist_dict_insert_item(plist_t node, const char* key, plist_t item)
426{ 426{
427 plist_dict_set_item(node, key, item); 427 plist_dict_set_item(node, key, item);
428} 428}
429 429
430void plist_dict_remove_item(plist_t node, const char* key) 430PLIST_API void plist_dict_remove_item(plist_t node, const char* key)
431{ 431{
432 if (node && PLIST_DICT == plist_get_node_type(node)) 432 if (node && PLIST_DICT == plist_get_node_type(node))
433 { 433 {
@@ -442,7 +442,7 @@ void plist_dict_remove_item(plist_t node, const char* key)
442 return; 442 return;
443} 443}
444 444
445void plist_dict_merge(plist_t *target, plist_t source) 445PLIST_API void plist_dict_merge(plist_t *target, plist_t source)
446{ 446{
447 if (!target || !*target || (plist_get_node_type(*target) != PLIST_DICT) || !source || (plist_get_node_type(source) != PLIST_DICT)) 447 if (!target || !*target || (plist_get_node_type(*target) != PLIST_DICT) || !source || (plist_get_node_type(source) != PLIST_DICT))
448 return; 448 return;
@@ -466,7 +466,7 @@ void plist_dict_merge(plist_t *target, plist_t source)
466 free(it); 466 free(it);
467} 467}
468 468
469plist_t plist_access_pathv(plist_t plist, uint32_t length, va_list v) 469PLIST_API plist_t plist_access_pathv(plist_t plist, uint32_t length, va_list v)
470{ 470{
471 plist_t current = plist; 471 plist_t current = plist;
472 plist_type type = PLIST_NONE; 472 plist_type type = PLIST_NONE;
@@ -490,7 +490,7 @@ plist_t plist_access_pathv(plist_t plist, uint32_t length, va_list v)
490 return current; 490 return current;
491} 491}
492 492
493plist_t plist_access_path(plist_t plist, uint32_t length, ...) 493PLIST_API plist_t plist_access_path(plist_t plist, uint32_t length, ...)
494{ 494{
495 plist_t ret = NULL; 495 plist_t ret = NULL;
496 va_list v; 496 va_list v;
@@ -545,12 +545,12 @@ static void plist_get_type_and_value(plist_t node, plist_type * type, void *valu
545 } 545 }
546} 546}
547 547
548plist_t plist_get_parent(plist_t node) 548PLIST_API plist_t plist_get_parent(plist_t node)
549{ 549{
550 return node ? (plist_t) ((node_t*) node)->parent : NULL; 550 return node ? (plist_t) ((node_t*) node)->parent : NULL;
551} 551}
552 552
553plist_type plist_get_node_type(plist_t node) 553PLIST_API plist_type plist_get_node_type(plist_t node)
554{ 554{
555 if (node) 555 if (node)
556 { 556 {
@@ -561,7 +561,7 @@ plist_type plist_get_node_type(plist_t node)
561 return PLIST_NONE; 561 return PLIST_NONE;
562} 562}
563 563
564void plist_get_key_val(plist_t node, char **val) 564PLIST_API void plist_get_key_val(plist_t node, char **val)
565{ 565{
566 plist_type type = plist_get_node_type(node); 566 plist_type type = plist_get_node_type(node);
567 uint64_t length = 0; 567 uint64_t length = 0;
@@ -570,7 +570,7 @@ void plist_get_key_val(plist_t node, char **val)
570 assert(length == strlen(*val)); 570 assert(length == strlen(*val));
571} 571}
572 572
573void plist_get_string_val(plist_t node, char **val) 573PLIST_API void plist_get_string_val(plist_t node, char **val)
574{ 574{
575 plist_type type = plist_get_node_type(node); 575 plist_type type = plist_get_node_type(node);
576 uint64_t length = 0; 576 uint64_t length = 0;
@@ -579,7 +579,7 @@ void plist_get_string_val(plist_t node, char **val)
579 assert(length == strlen(*val)); 579 assert(length == strlen(*val));
580} 580}
581 581
582void plist_get_bool_val(plist_t node, uint8_t * val) 582PLIST_API void plist_get_bool_val(plist_t node, uint8_t * val)
583{ 583{
584 plist_type type = plist_get_node_type(node); 584 plist_type type = plist_get_node_type(node);
585 uint64_t length = 0; 585 uint64_t length = 0;
@@ -588,7 +588,7 @@ void plist_get_bool_val(plist_t node, uint8_t * val)
588 assert(length == sizeof(uint8_t)); 588 assert(length == sizeof(uint8_t));
589} 589}
590 590
591void plist_get_uint_val(plist_t node, uint64_t * val) 591PLIST_API void plist_get_uint_val(plist_t node, uint64_t * val)
592{ 592{
593 plist_type type = plist_get_node_type(node); 593 plist_type type = plist_get_node_type(node);
594 uint64_t length = 0; 594 uint64_t length = 0;
@@ -597,7 +597,7 @@ void plist_get_uint_val(plist_t node, uint64_t * val)
597 assert(length == sizeof(uint64_t)); 597 assert(length == sizeof(uint64_t));
598} 598}
599 599
600void plist_get_uid_val(plist_t node, uint64_t * val) 600PLIST_API void plist_get_uid_val(plist_t node, uint64_t * val)
601{ 601{
602 plist_type type = plist_get_node_type(node); 602 plist_type type = plist_get_node_type(node);
603 uint64_t length = 0; 603 uint64_t length = 0;
@@ -606,7 +606,7 @@ void plist_get_uid_val(plist_t node, uint64_t * val)
606 assert(length == sizeof(uint64_t)); 606 assert(length == sizeof(uint64_t));
607} 607}
608 608
609void plist_get_real_val(plist_t node, double *val) 609PLIST_API void plist_get_real_val(plist_t node, double *val)
610{ 610{
611 plist_type type = plist_get_node_type(node); 611 plist_type type = plist_get_node_type(node);
612 uint64_t length = 0; 612 uint64_t length = 0;
@@ -615,14 +615,14 @@ void plist_get_real_val(plist_t node, double *val)
615 assert(length == sizeof(double)); 615 assert(length == sizeof(double));
616} 616}
617 617
618void plist_get_data_val(plist_t node, char **val, uint64_t * length) 618PLIST_API void plist_get_data_val(plist_t node, char **val, uint64_t * length)
619{ 619{
620 plist_type type = plist_get_node_type(node); 620 plist_type type = plist_get_node_type(node);
621 if (PLIST_DATA == type) 621 if (PLIST_DATA == type)
622 plist_get_type_and_value(node, &type, (void *) val, length); 622 plist_get_type_and_value(node, &type, (void *) val, length);
623} 623}
624 624
625void plist_get_date_val(plist_t node, int32_t * sec, int32_t * usec) 625PLIST_API void plist_get_date_val(plist_t node, int32_t * sec, int32_t * usec)
626{ 626{
627 plist_type type = plist_get_node_type(node); 627 plist_type type = plist_get_node_type(node);
628 uint64_t length = 0; 628 uint64_t length = 0;
@@ -695,7 +695,7 @@ int plist_data_compare(const void *a, const void *b)
695 return FALSE; 695 return FALSE;
696} 696}
697 697
698char plist_compare_node_value(plist_t node_l, plist_t node_r) 698PLIST_API char plist_compare_node_value(plist_t node_l, plist_t node_r)
699{ 699{
700 return plist_data_compare(node_l, node_r); 700 return plist_data_compare(node_l, node_r);
701} 701}
@@ -757,42 +757,42 @@ static void plist_set_element_val(plist_t node, plist_type type, const void *val
757 } 757 }
758} 758}
759 759
760void plist_set_key_val(plist_t node, const char *val) 760PLIST_API void plist_set_key_val(plist_t node, const char *val)
761{ 761{
762 plist_set_element_val(node, PLIST_KEY, val, strlen(val)); 762 plist_set_element_val(node, PLIST_KEY, val, strlen(val));
763} 763}
764 764
765void plist_set_string_val(plist_t node, const char *val) 765PLIST_API void plist_set_string_val(plist_t node, const char *val)
766{ 766{
767 plist_set_element_val(node, PLIST_STRING, val, strlen(val)); 767 plist_set_element_val(node, PLIST_STRING, val, strlen(val));
768} 768}
769 769
770void plist_set_bool_val(plist_t node, uint8_t val) 770PLIST_API void plist_set_bool_val(plist_t node, uint8_t val)
771{ 771{
772 plist_set_element_val(node, PLIST_BOOLEAN, &val, sizeof(uint8_t)); 772 plist_set_element_val(node, PLIST_BOOLEAN, &val, sizeof(uint8_t));
773} 773}
774 774
775void plist_set_uint_val(plist_t node, uint64_t val) 775PLIST_API void plist_set_uint_val(plist_t node, uint64_t val)
776{ 776{
777 plist_set_element_val(node, PLIST_UINT, &val, sizeof(uint64_t)); 777 plist_set_element_val(node, PLIST_UINT, &val, sizeof(uint64_t));
778} 778}
779 779
780void plist_set_uid_val(plist_t node, uint64_t val) 780PLIST_API void plist_set_uid_val(plist_t node, uint64_t val)
781{ 781{
782 plist_set_element_val(node, PLIST_UID, &val, sizeof(uint64_t)); 782 plist_set_element_val(node, PLIST_UID, &val, sizeof(uint64_t));
783} 783}
784 784
785void plist_set_real_val(plist_t node, double val) 785PLIST_API void plist_set_real_val(plist_t node, double val)
786{ 786{
787 plist_set_element_val(node, PLIST_REAL, &val, sizeof(double)); 787 plist_set_element_val(node, PLIST_REAL, &val, sizeof(double));
788} 788}
789 789
790void plist_set_data_val(plist_t node, const char *val, uint64_t length) 790PLIST_API void plist_set_data_val(plist_t node, const char *val, uint64_t length)
791{ 791{
792 plist_set_element_val(node, PLIST_DATA, val, length); 792 plist_set_element_val(node, PLIST_DATA, val, length);
793} 793}
794 794
795void plist_set_date_val(plist_t node, int32_t sec, int32_t usec) 795PLIST_API void plist_set_date_val(plist_t node, int32_t sec, int32_t usec)
796{ 796{
797 struct timeval val = { sec, usec }; 797 struct timeval val = { sec, usec };
798 plist_set_element_val(node, PLIST_DATE, &val, sizeof(struct timeval)); 798 plist_set_element_val(node, PLIST_DATE, &val, sizeof(struct timeval));
diff --git a/src/plist.h b/src/plist.h
index 2a9a3b5..822144d 100644
--- a/src/plist.h
+++ b/src/plist.h
@@ -22,8 +22,11 @@
22#ifndef PLIST_H 22#ifndef PLIST_H
23#define PLIST_H 23#define PLIST_H
24 24
25#ifdef HAVE_CONFIG_H
26#include <config.h>
27#endif
28
25#include "plist/plist.h" 29#include "plist/plist.h"
26#include "common.h"
27 30
28#include <sys/types.h> 31#include <sys/types.h>
29#include <sys/stat.h> 32#include <sys/stat.h>
@@ -34,6 +37,15 @@
34#pragma warning(disable:4244) 37#pragma warning(disable:4244)
35#endif 38#endif
36 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
37 49
38struct plist_data_s 50struct plist_data_s
39{ 51{
@@ -52,10 +64,10 @@ struct plist_data_s
52 64
53typedef struct plist_data_s *plist_data_t; 65typedef struct plist_data_s *plist_data_t;
54 66
55_PLIST_INTERNAL plist_t plist_new_node(plist_data_t data); 67plist_t plist_new_node(plist_data_t data);
56_PLIST_INTERNAL plist_data_t plist_get_data(const plist_t node); 68plist_data_t plist_get_data(const plist_t node);
57_PLIST_INTERNAL plist_data_t plist_new_plist_data(void); 69plist_data_t plist_new_plist_data(void);
58_PLIST_INTERNAL int plist_data_compare(const void *a, const void *b); 70int plist_data_compare(const void *a, const void *b);
59 71
60 72
61#endif 73#endif
diff --git a/src/ptrarray.h b/src/ptrarray.h
index 84f9ef0..e8a3c88 100644
--- a/src/ptrarray.h
+++ b/src/ptrarray.h
@@ -21,7 +21,6 @@
21#ifndef PTRARRAY_H 21#ifndef PTRARRAY_H
22#define PTRARRAY_H 22#define PTRARRAY_H
23#include <stdlib.h> 23#include <stdlib.h>
24#include "common.h"
25 24
26typedef struct ptrarray_t { 25typedef struct ptrarray_t {
27 void **pdata; 26 void **pdata;
@@ -30,8 +29,8 @@ typedef struct ptrarray_t {
30 size_t capacity_step; 29 size_t capacity_step;
31} ptrarray_t; 30} ptrarray_t;
32 31
33_PLIST_INTERNAL ptrarray_t *ptr_array_new(int capacity); 32ptrarray_t *ptr_array_new(int capacity);
34_PLIST_INTERNAL void ptr_array_free(ptrarray_t *pa); 33void ptr_array_free(ptrarray_t *pa);
35_PLIST_INTERNAL void ptr_array_add(ptrarray_t *pa, void *data); 34void ptr_array_add(ptrarray_t *pa, void *data);
36_PLIST_INTERNAL void* ptr_array_index(ptrarray_t *pa, size_t index); 35void* ptr_array_index(ptrarray_t *pa, size_t index);
37#endif 36#endif
diff --git a/src/xplist.c b/src/xplist.c
index a889cb5..4c106aa 100644
--- a/src/xplist.c
+++ b/src/xplist.c
@@ -513,7 +513,7 @@ static void xml_to_node(xmlNodePtr xml_node, plist_t * plist_node)
513 } 513 }
514} 514}
515 515
516void plist_to_xml(plist_t plist, char **plist_xml, uint32_t * length) 516PLIST_API void plist_to_xml(plist_t plist, char **plist_xml, uint32_t * length)
517{ 517{
518 xmlDocPtr plist_doc = NULL; 518 xmlDocPtr plist_doc = NULL;
519 xmlNodePtr root_node = NULL; 519 xmlNodePtr root_node = NULL;
@@ -555,7 +555,7 @@ void plist_to_xml(plist_t plist, char **plist_xml, uint32_t * length)
555 } 555 }
556} 556}
557 557
558void plist_from_xml(const char *plist_xml, uint32_t length, plist_t * plist) 558PLIST_API void plist_from_xml(const char *plist_xml, uint32_t length, plist_t * plist)
559{ 559{
560 xmlDocPtr plist_doc = xmlParseMemory(plist_xml, length); 560 xmlDocPtr plist_doc = xmlParseMemory(plist_xml, length);
561 xmlNodePtr root_node = xmlDocGetRootElement(plist_doc); 561 xmlNodePtr root_node = xmlDocGetRootElement(plist_doc);