diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-09-17 02:59:34 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-09-17 02:59:54 +0000 |
commit | 5bc4f4fb5b383ca32b382b6c0d09602346064414 (patch) | |
tree | c741e5844c2815679107d648a15841653b9b01a5 /src/dict.h | |
parent | Adding upstream version 3.1.0+dfsg. (diff) | |
download | libyang3-upstream.tar.xz libyang3-upstream.zip |
Adding upstream version 3.4.2+dfsg.upstream/3.4.2+dfsgupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/dict.h')
-rw-r--r-- | src/dict.h | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -113,6 +113,18 @@ LIBYANG_API_DECL LY_ERR lydict_insert_zc(const struct ly_ctx *ctx, char *value, */ LIBYANG_API_DECL LY_ERR lydict_remove(const struct ly_ctx *ctx, const char *value); +/** + * @brief Duplicate string in dictionary. Only a reference counter is incremented. + * + * @param[in] ctx libyang context handler + * @param[in] value NULL-terminated string to be duplicated in the dictionary (reference counter is incremented). + * @param[out] str_p Optional parameter to get pointer to the string corresponding to the @p value and stored in dictionary. + * @return LY_SUCCESS in case the string already exists in the dictionary. + * @return LY_ENOTFOUND in case the string was not found. + * @return LY_ERR on other errors + */ +LIBYANG_API_DECL LY_ERR lydict_dup(const struct ly_ctx *ctx, const char *value, const char **str_p); + /** @} dict */ #ifdef __cplusplus |