yin parser CHANGE validate argument value according to its type
helpful functions and macros were moved from yang_parser and are used also in yin parser.
diff --git a/src/parser_yin.h b/src/parser_yin.h
index b4ef46b..d4e22bf 100644
--- a/src/parser_yin.h
+++ b/src/parser_yin.h
@@ -71,7 +71,7 @@
struct yin_subelement {
enum yang_keyword type; /**< type of keyword */
- void *dest; /**< meta infromation passed to responsible function (information about where parsed subelement should be stored) */
+ void *dest; /**< meta infromation passed to responsible function (mostly information about where parsed subelement should be stored) */
uint8_t flags; /**< describes cardianlity of subelement can be set to YIN_SUBELEM_MANDATORY and YIN_SUBELEM_UNIQUE and YIN_SUBELEM_FIRST */
};
@@ -131,6 +131,19 @@
struct lysp_ext_instance **exts);
/**
+ * @brief Check that val is valid UTF8 character sequence of val_type.
+ * Doesn't check empty string, only character validity.
+ *
+ * @param[in] ctx Yin parser context for logging.
+ * @param[in] val_type Type of the input string to select method of checking character validity.
+ * @param[in] val Input to validate.
+ * @param[in] len Length of input.
+ *
+ * @return LY_ERR values.
+ */
+LY_ERR yin_validate_value(struct yin_parser_ctx *ctx, enum yang_arg val_type, char *val, size_t len);
+
+/**
* @brief Parse import element.
*
* @param[in,out] ctx Yin parser context for logging and to store current state.