libyang  2.2.8
libyang is YANG data modelling language parser and toolkit written (and providing API) in C.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Context Dictionary

Context includes dictionary to store strings more effectively. The most of strings repeats quite often in schema as well as data trees. Therefore, instead of allocating those strings each time they appear, libyang stores them as records in the dictionary. The basic API to the context dictionary is public, so even a caller application can use the dictionary.

To insert a string into the dictionary, caller can use lydict_insert() (adding a constant string) or lydict_insert_zc() (for dynamically allocated strings that won't be used by the caller after its insertion into the dictionary). Both functions provide the pointer to the inserted string in the dictionary record.

To remove (reference of the) string from the context dictionary, lydict_remove() is supposed to be used.

Note
Incorrect usage of the dictionary can break libyang functionality.
API for this group of functions is described in the Dictionary module.

Functions List