summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/plist/plist.h38
1 files changed, 35 insertions, 3 deletions
diff --git a/include/plist/plist.h b/include/plist/plist.h
index beb467a..484203b 100644
--- a/include/plist/plist.h
+++ b/include/plist/plist.h
@@ -62,6 +62,11 @@ extern "C" {
62 typedef void *plist_t; 62 typedef void *plist_t;
63 63
64/** 64/**
65 * The plist dictionary iterator.
66 */
67 typedef uint32_t *plist_dict_iter;
68
69/**
65 * The enumeration of plist node types. 70 * The enumeration of plist node types.
66 */ 71 */
67 typedef enum { 72 typedef enum {
@@ -196,6 +201,14 @@ extern "C" {
196 PLIST_API plist_t plist_array_get_item(plist_t node, uint32_t n); 201 PLIST_API plist_t plist_array_get_item(plist_t node, uint32_t n);
197 202
198/** 203/**
204 * Get the index of an item. item must be a member of a #PLIST_ARRAY node.
205 *
206 * @param node the node
207 * @return the node index
208 */
209 PLIST_API uint32_t plist_array_get_item_index(plist_t node);
210
211/**
199 * Set the nth item in a #PLIST_ARRAY node. 212 * Set the nth item in a #PLIST_ARRAY node.
200 * The previous item at index n will be freed using #plist_free 213 * The previous item at index n will be freed using #plist_free
201 * 214 *
@@ -238,12 +251,31 @@ extern "C" {
238 ********************************************/ 251 ********************************************/
239 252
240/** 253/**
241 * Get size of a #PLIST_DICT node. 254 * Create iterator of a #PLIST_DICT node.
255 * The allocated iterator shoult be freed with tandard free function
256 *
257 * @param node the node of type #PLIST_DICT
258 * @param iter iterator of the #PLIST_DICT node
259 */
260 PLIST_API void plist_dict_new_iter(plist_t node, plist_dict_iter *iter);
261
262/**
263 * Increment iterator of a #PLIST_DICT node.
242 * 264 *
243 * @param node the node of type #PLIST_DICT 265 * @param node the node of type #PLIST_DICT
244 * @return size of the #PLIST_DICT node 266 * @param iter iterator of the dictionary
267 * @param key a location to store the key, or NULL.
268 * @param val a location to store the value, or NULL.
269 */
270 PLIST_API void plist_dict_next_item(plist_t node, plist_dict_iter iter, char **key, plist_t *val);
271
272/**
273 * Get key associated to an item. Item must be member of a dictionary
274 *
275 * @param node the node
276 * @param key a location to store the key.
245 */ 277 */
246 PLIST_API uint32_t plist_dict_get_size(plist_t node); 278 PLIST_API void plist_dict_get_item_key(plist_t node, char **key);
247 279
248/** 280/**
249 * Get the nth item in a #PLIST_DICT node. 281 * Get the nth item in a #PLIST_DICT node.