libyang  1.0.253
YANG data modeling language library
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
dict.h
Go to the documentation of this file.
1 
15 #ifndef LY_DICT_H_
16 #define LY_DICT_H_
17 
18 #include <stdint.h>
19 
20 #ifdef __cplusplus
21 extern "C" {
22 #endif
23 
24 /*
25  * structure definition from context.h
26  */
27 struct ly_ctx;
28 
50 const char *lydict_insert(struct ly_ctx *ctx, const char *value, size_t len);
51 
66 const char *lydict_insert_zc(struct ly_ctx *ctx, char *value);
67 
77 void lydict_remove(struct ly_ctx *ctx, const char *value);
78 
81 #ifdef __cplusplus
82 }
83 #endif
84 
85 #endif /* LY_DICT_H_ */
const char * lydict_insert_zc(struct ly_ctx *ctx, char *value)
Insert string into dictionary - zerocopy version. If the string is already present, only a reference counter is incremented and no memory allocation is performed. This insert function variant avoids duplication of specified value - it is inserted into the dictionary directly.
const char * lydict_insert(struct ly_ctx *ctx, const char *value, size_t len)
Insert string into dictionary. If the string is already present, only a reference counter is incremen...
void lydict_remove(struct ly_ctx *ctx, const char *value)
Remove specified string from the dictionary. It decrement reference counter for the string and if it ...