32#ifndef _XBPS_DICTIONARY_H_
33#define _XBPS_DICTIONARY_H_
36#include <xbps/xbps_object.h>
37#include <xbps/xbps_array.h>
39typedef struct _prop_dictionary *xbps_dictionary_t;
40typedef struct _prop_dictionary_keysym *xbps_dictionary_keysym_t;
46xbps_dictionary_t xbps_dictionary_create(
void);
47xbps_dictionary_t xbps_dictionary_create_with_capacity(
unsigned int);
49xbps_dictionary_t xbps_dictionary_copy(xbps_dictionary_t);
50xbps_dictionary_t xbps_dictionary_copy_mutable(xbps_dictionary_t);
52unsigned int xbps_dictionary_count(xbps_dictionary_t);
53bool xbps_dictionary_ensure_capacity(xbps_dictionary_t,
56void xbps_dictionary_make_immutable(xbps_dictionary_t);
58xbps_object_iterator_t xbps_dictionary_iterator(xbps_dictionary_t);
59xbps_array_t xbps_dictionary_all_keys(xbps_dictionary_t);
61xbps_object_t xbps_dictionary_get(xbps_dictionary_t,
const char *);
62bool xbps_dictionary_set(xbps_dictionary_t,
const char *,
64void xbps_dictionary_remove(xbps_dictionary_t,
const char *);
66xbps_object_t xbps_dictionary_get_keysym(xbps_dictionary_t,
67 xbps_dictionary_keysym_t);
68bool xbps_dictionary_set_keysym(xbps_dictionary_t,
69 xbps_dictionary_keysym_t,
71void xbps_dictionary_remove_keysym(xbps_dictionary_t,
72 xbps_dictionary_keysym_t);
74bool xbps_dictionary_equals(xbps_dictionary_t, xbps_dictionary_t);
76char * xbps_dictionary_externalize(xbps_dictionary_t);
77xbps_dictionary_t xbps_dictionary_internalize(
const char *);
79bool xbps_dictionary_externalize_to_file(xbps_dictionary_t,
81bool xbps_dictionary_externalize_to_zfile(xbps_dictionary_t,
83xbps_dictionary_t xbps_dictionary_internalize_from_file(
const char *);
84xbps_dictionary_t xbps_dictionary_internalize_from_zfile(
const char *);
86const char * xbps_dictionary_keysym_cstring_nocopy(xbps_dictionary_keysym_t);
88bool xbps_dictionary_keysym_equals(xbps_dictionary_keysym_t,
89 xbps_dictionary_keysym_t);
95bool xbps_dictionary_get_dict(xbps_dictionary_t,
const char *,
97bool xbps_dictionary_get_bool(xbps_dictionary_t,
const char *,
99bool xbps_dictionary_set_bool(xbps_dictionary_t,
const char *,
102bool xbps_dictionary_get_int8(xbps_dictionary_t,
const char *,
104bool xbps_dictionary_get_uint8(xbps_dictionary_t,
const char *,
106bool xbps_dictionary_set_int8(xbps_dictionary_t,
const char *,
108bool xbps_dictionary_set_uint8(xbps_dictionary_t,
const char *,
111bool xbps_dictionary_get_int16(xbps_dictionary_t,
const char *,
113bool xbps_dictionary_get_uint16(xbps_dictionary_t,
const char *,
115bool xbps_dictionary_set_int16(xbps_dictionary_t,
const char *,
117bool xbps_dictionary_set_uint16(xbps_dictionary_t,
const char *,
120bool xbps_dictionary_get_int32(xbps_dictionary_t,
const char *,
122bool xbps_dictionary_get_uint32(xbps_dictionary_t,
const char *,
124bool xbps_dictionary_set_int32(xbps_dictionary_t,
const char *,
126bool xbps_dictionary_set_uint32(xbps_dictionary_t,
const char *,
129bool xbps_dictionary_get_int64(xbps_dictionary_t,
const char *,
131bool xbps_dictionary_get_uint64(xbps_dictionary_t,
const char *,
133bool xbps_dictionary_set_int64(xbps_dictionary_t,
const char *,
135bool xbps_dictionary_set_uint64(xbps_dictionary_t,
const char *,
138bool xbps_dictionary_get_cstring(xbps_dictionary_t,
const char *,
140bool xbps_dictionary_set_cstring(xbps_dictionary_t,
const char *,
143bool xbps_dictionary_get_cstring_nocopy(xbps_dictionary_t,
146bool xbps_dictionary_set_cstring_nocopy(xbps_dictionary_t,
149bool xbps_dictionary_set_and_rel(xbps_dictionary_t,