32#include "xbps_api_impl.h"
33#include <prop/proplib.h>
38xbps_array_create(
void)
40 return prop_array_create();
44xbps_array_create_with_capacity(
unsigned int capacity)
46 return prop_array_create_with_capacity(capacity);
50xbps_array_copy(xbps_array_t a)
52 return prop_array_copy(a);
56xbps_array_copy_mutable(xbps_array_t a)
58 return prop_array_copy_mutable(a);
62xbps_array_capacity(xbps_array_t a)
64 return prop_array_capacity(a);
68xbps_array_count(xbps_array_t a)
70 return prop_array_count(a);
74xbps_array_ensure_capacity(xbps_array_t a,
unsigned int i)
76 return prop_array_ensure_capacity(a, i);
80xbps_array_make_immutable(xbps_array_t a)
82 prop_array_make_immutable(a);
86xbps_array_mutable(xbps_array_t a)
88 return prop_array_mutable(a);
92xbps_array_iterator(xbps_array_t a)
94 return prop_array_iterator(a);
98xbps_array_get(xbps_array_t a,
unsigned int i)
100 return prop_array_get(a, i);
104xbps_array_set(xbps_array_t a,
unsigned int i, xbps_object_t obj)
106 return prop_array_set(a, i, obj);
110xbps_array_add(xbps_array_t a, xbps_object_t obj)
112 return prop_array_add(a, obj);
116xbps_array_add_first(xbps_array_t a, xbps_object_t obj)
118 return prop_array_add_first(a, obj);
122xbps_array_remove(xbps_array_t a,
unsigned int i)
124 prop_array_remove(a, i);
128xbps_array_equals(xbps_array_t a, xbps_array_t b)
130 return prop_array_equals(a, b);
134xbps_array_externalize(xbps_array_t a)
136 return prop_array_externalize(a);
140xbps_array_internalize(
const char *s)
142 return prop_array_internalize(s);
146xbps_array_externalize_to_file(xbps_array_t a,
const char *s)
148 return prop_array_externalize_to_file(a, s);
152xbps_array_externalize_to_zfile(xbps_array_t a,
const char *s)
154 return prop_array_externalize_to_zfile(a, s);
158xbps_array_internalize_from_file(
const char *s)
160 return prop_array_internalize_from_file(s);
164xbps_array_internalize_from_zfile(
const char *s)
166 return prop_array_internalize_from_zfile(s);
174xbps_array_get_bool(xbps_array_t a,
unsigned int i,
bool *b)
176 return prop_array_get_bool(a, i, b);
180xbps_array_set_bool(xbps_array_t a,
unsigned int i,
bool b)
182 return prop_array_set_bool(a, i, b);
186xbps_array_get_int8(xbps_array_t a,
unsigned int i, int8_t *v)
188 return prop_array_get_int8(a, i, v);
192xbps_array_get_uint8(xbps_array_t a,
unsigned int i, uint8_t *v)
194 return prop_array_get_uint8(a, i, v);
198xbps_array_set_int8(xbps_array_t a,
unsigned int i, int8_t v)
200 return prop_array_set_int8(a, i, v);
204xbps_array_set_uint8(xbps_array_t a,
unsigned int i, uint8_t v)
206 return prop_array_set_uint8(a, i, v);
210xbps_array_get_int16(xbps_array_t a,
unsigned int i, int16_t *v)
212 return prop_array_get_int16(a, i, v);
216xbps_array_get_uint16(xbps_array_t a,
unsigned int i, uint16_t *v)
218 return prop_array_get_uint16(a, i, v);
222xbps_array_set_int16(xbps_array_t a,
unsigned int i, int16_t v)
224 return prop_array_set_int16(a, i, v);
228xbps_array_set_uint16(xbps_array_t a,
unsigned int i, uint16_t v)
230 return prop_array_set_uint16(a, i, v);
234xbps_array_get_int32(xbps_array_t a,
unsigned int i, int32_t *v)
236 return prop_array_get_int32(a, i, v);
240xbps_array_get_uint32(xbps_array_t a,
unsigned int i, uint32_t *v)
242 return prop_array_get_uint32(a, i, v);
246xbps_array_set_int32(xbps_array_t a,
unsigned int i, int32_t v)
248 return prop_array_set_int32(a, i, v);
252xbps_array_set_uint32(xbps_array_t a,
unsigned int i, uint32_t v)
254 return prop_array_set_uint32(a, i, v);
258xbps_array_get_int64(xbps_array_t a,
unsigned int i, int64_t *v)
260 return prop_array_get_int64(a, i, v);
264xbps_array_get_uint64(xbps_array_t a,
unsigned int i, uint64_t *v)
266 return prop_array_get_uint64(a, i, v);
270xbps_array_set_int64(xbps_array_t a,
unsigned int i, int64_t v)
272 return prop_array_set_int64(a, i, v);
276xbps_array_set_uint64(xbps_array_t a,
unsigned int i, uint64_t v)
278 return prop_array_set_uint64(a, i, v);
282xbps_array_add_int8(xbps_array_t a, int8_t v)
284 return prop_array_add_int8(a, v);
288xbps_array_add_uint8(xbps_array_t a, uint8_t v)
290 return prop_array_add_uint8(a, v);
294xbps_array_add_int16(xbps_array_t a, int16_t v)
296 return prop_array_add_int16(a, v);
300xbps_array_add_uint16(xbps_array_t a, uint16_t v)
302 return prop_array_add_uint16(a, v);
306xbps_array_add_int32(xbps_array_t a, int32_t v)
308 return prop_array_add_int32(a, v);
312xbps_array_add_uint32(xbps_array_t a, uint32_t v)
314 return prop_array_add_uint32(a, v);
318xbps_array_add_int64(xbps_array_t a, int64_t v)
320 return prop_array_add_int64(a, v);
324xbps_array_add_uint64(xbps_array_t a, uint64_t v)
326 return prop_array_add_uint64(a, v);
330xbps_array_get_cstring(xbps_array_t a,
unsigned int i,
char **s)
332 return prop_array_get_cstring(a, i, s);
336xbps_array_set_cstring(xbps_array_t a,
unsigned int i,
const char *s)
338 return prop_array_set_cstring(a, i, s);
342xbps_array_add_cstring(xbps_array_t a,
const char *s)
344 return prop_array_add_cstring(a, s);
348xbps_array_add_cstring_nocopy(xbps_array_t a,
const char *s)
350 return prop_array_add_cstring_nocopy(a, s);
354xbps_array_get_cstring_nocopy(xbps_array_t a,
unsigned int i,
const char **s)
356 return prop_array_get_cstring_nocopy(a, i, s);
360xbps_array_set_cstring_nocopy(xbps_array_t a,
unsigned int i,
const char *s)
362 return prop_array_set_cstring_nocopy(a, i, s);
366xbps_array_add_and_rel(xbps_array_t a, xbps_object_t o)
368 return prop_array_add_and_rel(a, o);
374xbps_bool_create(
bool v)
376 return prop_bool_create(v);
380xbps_bool_copy(xbps_bool_t b)
382 return prop_bool_copy(b);
386xbps_bool_true(xbps_bool_t b)
388 return prop_bool_true(b);
392xbps_bool_equals(xbps_bool_t a, xbps_bool_t b)
394 return prop_bool_equals(a, b);
400xbps_data_create_data(
const void *v,
size_t s)
402 return prop_data_create_data(v, s);
406xbps_data_create_data_nocopy(
const void *v,
size_t s)
408 return prop_data_create_data_nocopy(v, s);
412xbps_data_copy(xbps_data_t d)
414 return prop_data_copy(d);
418xbps_data_size(xbps_data_t d)
420 return prop_data_size(d);
424xbps_data_data(xbps_data_t d)
426 return prop_data_data(d);
430xbps_data_data_nocopy(xbps_data_t d)
432 return prop_data_data_nocopy(d);
436xbps_data_equals(xbps_data_t a, xbps_data_t b)
438 return prop_data_equals(a, b);
442xbps_data_equals_data(xbps_data_t d,
const void *v,
size_t s)
444 return prop_data_equals_data(d, v, s);
450xbps_dictionary_create(
void)
452 return prop_dictionary_create();
456xbps_dictionary_create_with_capacity(
unsigned int i)
458 return prop_dictionary_create_with_capacity(i);
462xbps_dictionary_copy(xbps_dictionary_t d)
464 return prop_dictionary_copy(d);
468xbps_dictionary_copy_mutable(xbps_dictionary_t d)
470 return prop_dictionary_copy_mutable(d);
474xbps_dictionary_count(xbps_dictionary_t d)
476 return prop_dictionary_count(d);
480xbps_dictionary_ensure_capacity(xbps_dictionary_t d,
unsigned int i)
482 return prop_dictionary_ensure_capacity(d, i);
486xbps_dictionary_make_immutable(xbps_dictionary_t d)
488 prop_dictionary_make_immutable(d);
491xbps_object_iterator_t
492xbps_dictionary_iterator(xbps_dictionary_t d)
494 return prop_dictionary_iterator(d);
498xbps_dictionary_all_keys(xbps_dictionary_t d)
500 return prop_dictionary_all_keys(d);
504xbps_dictionary_get(xbps_dictionary_t d,
const char *s)
506 return prop_dictionary_get(d, s);
510xbps_dictionary_set(xbps_dictionary_t d,
const char *s, xbps_object_t o)
512 return prop_dictionary_set(d, s, o);
516xbps_dictionary_remove(xbps_dictionary_t d,
const char *s)
518 prop_dictionary_remove(d, s);
522xbps_dictionary_get_keysym(xbps_dictionary_t d, xbps_dictionary_keysym_t k)
524 return prop_dictionary_get_keysym(d, k);
528xbps_dictionary_set_keysym(xbps_dictionary_t d, xbps_dictionary_keysym_t k,
531 return prop_dictionary_set_keysym(d, k, o);
535xbps_dictionary_remove_keysym(xbps_dictionary_t d, xbps_dictionary_keysym_t k)
537 prop_dictionary_remove_keysym(d, k);
541xbps_dictionary_equals(xbps_dictionary_t a, xbps_dictionary_t b)
543 return prop_dictionary_equals(a, b);
547xbps_dictionary_externalize(xbps_dictionary_t d)
549 return prop_dictionary_externalize(d);
553xbps_dictionary_internalize(
const char *s)
555 return prop_dictionary_internalize(s);
559xbps_dictionary_externalize_to_file(xbps_dictionary_t d,
const char *s)
561 return prop_dictionary_externalize_to_file(d, s);
565xbps_dictionary_externalize_to_zfile(xbps_dictionary_t d,
const char *s)
567 return prop_dictionary_externalize_to_zfile(d, s);
571xbps_dictionary_internalize_from_file(
const char *s)
573 return prop_dictionary_internalize_from_file(s);
577xbps_dictionary_internalize_from_zfile(
const char *s)
579 return prop_dictionary_internalize_from_zfile(s);
583xbps_dictionary_keysym_cstring_nocopy(xbps_dictionary_keysym_t k)
585 return prop_dictionary_keysym_cstring_nocopy(k);
589xbps_dictionary_keysym_equals(xbps_dictionary_keysym_t a, xbps_dictionary_keysym_t b)
591 return prop_dictionary_keysym_equals(a, b);
599xbps_dictionary_get_dict(xbps_dictionary_t d,
const char *s,
600 xbps_dictionary_t *rd)
602 return prop_dictionary_get_dict(d, s, rd);
606xbps_dictionary_get_bool(xbps_dictionary_t d,
const char *s,
bool *b)
608 return prop_dictionary_get_bool(d, s, b);
612xbps_dictionary_set_bool(xbps_dictionary_t d,
const char *s,
bool b)
614 return prop_dictionary_set_bool(d, s, b);
618xbps_dictionary_get_int8(xbps_dictionary_t d,
const char *s, int8_t *v)
620 return prop_dictionary_get_int8(d, s, v);
624xbps_dictionary_get_uint8(xbps_dictionary_t d,
const char *s, uint8_t *v)
626 return prop_dictionary_get_uint8(d, s, v);
630xbps_dictionary_set_int8(xbps_dictionary_t d,
const char *s, int8_t v)
632 return prop_dictionary_set_int8(d, s, v);
636xbps_dictionary_set_uint8(xbps_dictionary_t d,
const char *s, uint8_t v)
638 return prop_dictionary_set_uint8(d, s, v);
642xbps_dictionary_get_int16(xbps_dictionary_t d,
const char *s, int16_t *v)
644 return prop_dictionary_get_int16(d, s, v);
648xbps_dictionary_get_uint16(xbps_dictionary_t d,
const char *s, uint16_t *v)
650 return prop_dictionary_get_uint16(d, s, v);
654xbps_dictionary_set_int16(xbps_dictionary_t d,
const char *s, int16_t v)
656 return prop_dictionary_set_int16(d, s, v);
660xbps_dictionary_set_uint16(xbps_dictionary_t d,
const char *s, uint16_t v)
662 return prop_dictionary_set_uint16(d, s, v);
666xbps_dictionary_get_int32(xbps_dictionary_t d,
const char *s, int32_t *v)
668 return prop_dictionary_get_int32(d, s, v);
672xbps_dictionary_get_uint32(xbps_dictionary_t d,
const char *s, uint32_t *v)
674 return prop_dictionary_get_uint32(d, s, v);
678xbps_dictionary_set_int32(xbps_dictionary_t d,
const char *s, int32_t v)
680 return prop_dictionary_set_int32(d, s, v);
684xbps_dictionary_set_uint32(xbps_dictionary_t d,
const char *s, uint32_t v)
686 return prop_dictionary_set_uint32(d, s, v);
690xbps_dictionary_get_int64(xbps_dictionary_t d,
const char *s, int64_t *v)
692 return prop_dictionary_get_int64(d, s, v);
696xbps_dictionary_get_uint64(xbps_dictionary_t d,
const char *s, uint64_t *v)
698 return prop_dictionary_get_uint64(d, s, v);
702xbps_dictionary_set_int64(xbps_dictionary_t d,
const char *s, int64_t v)
704 return prop_dictionary_set_int64(d, s, v);
708xbps_dictionary_set_uint64(xbps_dictionary_t d,
const char *s, uint64_t v)
710 return prop_dictionary_set_uint64(d, s, v);
714xbps_dictionary_get_cstring(xbps_dictionary_t d,
const char *s,
char **ss)
716 return prop_dictionary_get_cstring(d, s, ss);
720xbps_dictionary_set_cstring(xbps_dictionary_t d,
const char *s,
const char *ss)
722 return prop_dictionary_set_cstring(d, s, ss);
726xbps_dictionary_get_cstring_nocopy(xbps_dictionary_t d,
const char *s,
const char **ss)
728 return prop_dictionary_get_cstring_nocopy(d, s, ss);
732xbps_dictionary_set_cstring_nocopy(xbps_dictionary_t d,
const char *s,
const char *ss)
734 return prop_dictionary_set_cstring_nocopy(d, s, ss);
738xbps_dictionary_set_and_rel(xbps_dictionary_t d,
const char *s, xbps_object_t o)
740 return prop_dictionary_set_and_rel(d, s, o);
746xbps_number_create_integer(int64_t v)
748 return prop_number_create_integer(v);
752xbps_number_create_unsigned_integer(uint64_t v)
754 return prop_number_create_unsigned_integer(v);
758xbps_number_copy(xbps_number_t n)
760 return prop_number_copy(n);
764xbps_number_size(xbps_number_t n)
766 return prop_number_size(n);
770xbps_number_unsigned(xbps_number_t n)
772 return prop_number_unsigned(n);
776xbps_number_integer_value(xbps_number_t n)
778 return prop_number_integer_value(n);
782xbps_number_unsigned_integer_value(xbps_number_t n)
784 return prop_number_unsigned_integer_value(n);
788xbps_number_equals(xbps_number_t n, xbps_number_t nn)
790 return prop_number_equals(n, nn);
794xbps_number_equals_integer(xbps_number_t n, int64_t v)
796 return prop_number_equals_integer(n, v);
800xbps_number_equals_unsigned_integer(xbps_number_t n, uint64_t v)
802 return prop_number_equals_unsigned_integer(n, v);
808xbps_object_retain(xbps_object_t o)
810 prop_object_retain(o);
814xbps_object_release(xbps_object_t o)
816 prop_object_release(o);
820xbps_object_type(xbps_object_t o)
822 return (xbps_type_t)prop_object_type(o);
826xbps_object_equals(xbps_object_t o, xbps_object_t oo)
828 return prop_object_equals(o, oo);
832xbps_object_equals_with_error(xbps_object_t o, xbps_object_t oo,
bool *b)
834 return prop_object_equals_with_error(o, oo, b);
838xbps_object_iterator_next(xbps_object_iterator_t o)
840 return prop_object_iterator_next(o);
844xbps_object_iterator_reset(xbps_object_iterator_t o)
846 prop_object_iterator_reset(o);
850xbps_object_iterator_release(xbps_object_iterator_t o)
852 prop_object_iterator_release(o);
858xbps_string_create(
void)
860 return prop_string_create();
864xbps_string_create_cstring(
const char *s)
866 return prop_string_create_cstring(s);
870xbps_string_create_cstring_nocopy(
const char *s)
872 return prop_string_create_cstring_nocopy(s);
876xbps_string_copy(xbps_string_t s)
878 return prop_string_copy(s);
882xbps_string_copy_mutable(xbps_string_t s)
884 return prop_string_copy_mutable(s);
888xbps_string_size(xbps_string_t s)
890 return prop_string_size(s);
894xbps_string_mutable(xbps_string_t s)
896 return prop_string_mutable(s);
900xbps_string_cstring(xbps_string_t s)
902 return prop_string_cstring(s);
906xbps_string_cstring_nocopy(xbps_string_t s)
908 return prop_string_cstring_nocopy(s);
912xbps_string_append(xbps_string_t s, xbps_string_t ss)
914 return prop_string_append(s, ss);
918xbps_string_append_cstring(xbps_string_t s,
const char *ss)
920 return prop_string_append_cstring(s, ss);
924xbps_string_equals(xbps_string_t s, xbps_string_t ss)
926 return prop_string_equals(s, ss);
930xbps_string_equals_cstring(xbps_string_t s,
const char *ss)
932 return prop_string_equals_cstring(s, ss);
941 a = xbps_array_internalize_from_zfile(path);
942 if (xbps_object_type(a) != XBPS_TYPE_ARRAY) {
944 "xbps: failed to internalize array from %s\n", path);
954 d = xbps_dictionary_internalize_from_zfile(path);
955 if (xbps_object_type(d) != XBPS_TYPE_DICTIONARY) {
957 "xbps: failed to internalize dict from %s\n", path);
xbps_dictionary_t xbps_plist_dictionary_from_file(const char *path)
xbps_array_t xbps_plist_array_from_file(const char *path)