summaryrefslogtreecommitdiffstats
path: root/src/dict.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-09-17 02:59:34 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-09-17 02:59:54 +0000
commit5bc4f4fb5b383ca32b382b6c0d09602346064414 (patch)
treec741e5844c2815679107d648a15841653b9b01a5 /src/dict.h
parentAdding upstream version 3.1.0+dfsg. (diff)
downloadlibyang3-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.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/dict.h b/src/dict.h
index cf897e7..bc8cac1 100644
--- a/src/dict.h
+++ b/src/dict.h
@@ -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