diff options
| author | 2026-02-12 02:10:19 +0100 | |
|---|---|---|
| committer | 2026-02-12 02:10:19 +0100 | |
| commit | a7e82b846543a4fc8d3291a5a65dd66b0cb84396 (patch) | |
| tree | 1b940620358f798b5f7fca41df9920f6b4948194 /include/plist/plist.h | |
| parent | 4e82bc85671cfe50763de2637b54cb8576d7976f (diff) | |
| download | libplist-a7e82b846543a4fc8d3291a5a65dd66b0cb84396.tar.gz libplist-a7e82b846543a4fc8d3291a5a65dd66b0cb84396.tar.bz2 | |
plist: make array and dict iterators opaque
Introduce private iterator structs for plist_array_iter and
plist_dict_iter, and fix *_next_item() to properly advance
iterator state and handle malformed containers safely.
Diffstat (limited to 'include/plist/plist.h')
| -rw-r--r-- | include/plist/plist.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/include/plist/plist.h b/include/plist/plist.h index 8ed9063..b46b9a9 100644 --- a/include/plist/plist.h +++ b/include/plist/plist.h @@ -400,6 +400,12 @@ extern "C" */ PLIST_API void plist_array_next_item(plist_t node, plist_array_iter iter, plist_t *item); + /** + * Free #PLIST_ARRAY iterator. + * + * @param iter Iterator to free. + */ + PLIST_API void plist_array_free_iter(plist_array_iter iter); /******************************************** * * @@ -438,6 +444,13 @@ extern "C" PLIST_API void plist_dict_next_item(plist_t node, plist_dict_iter iter, char **key, plist_t *val); /** + * Free #PLIST_DICT iterator. + * + * @param iter Iterator to free. + */ + PLIST_API void plist_dict_free_iter(plist_dict_iter iter); + + /** * Get key associated key to an item. Item must be member of a dictionary. * * @param node the item |
