schema parser CHANGE move some generic function from YIN parser
Make some generic function from YIN parser visible for other schema
parsers.
diff --git a/src/parser.h b/src/parser.h
index c47732b..1beea98 100644
--- a/src/parser.h
+++ b/src/parser.h
@@ -57,6 +57,15 @@
/**@} jsondata */
+enum LY_IDENT {
+ LY_IDENT_SIMPLE, /* only syntax rules */
+ LY_IDENT_FEATURE,
+ LY_IDENT_IDENTITY,
+ LY_IDENT_TYPE,
+ LY_IDENT_NODE,
+ LY_IDENT_NAME, /* uniqueness across the siblings */
+ LY_IDENT_PREFIX
+};
struct lys_module *lyp_search_file(struct ly_ctx *ctx, struct lys_module *module, const char *name,
const char *revision, struct unres_schema *unres);
@@ -70,10 +79,10 @@
int lyp_check_length_range(const char *expr, struct lys_type *type);
int fill_yin_type(struct lys_module *module, struct lys_node *parent, struct lyxml_elem *yin, struct lys_type *type,
- struct unres_schema *unres);
+ struct unres_schema *unres);
-int check_status(uint8_t flags1, struct lys_module *mod1, const char *name1,
- uint8_t flags2, struct lys_module *mod2, const char *name2, unsigned int line);
+int lyp_check_status(uint8_t flags1, struct lys_module *mod1, const char *name1,
+ uint8_t flags2, struct lys_module *mod2, const char *name2, unsigned int line);
/**
* @brief Get know if the node is part of the RPC's input/output
@@ -91,6 +100,11 @@
*/
int lyp_check_options(int options);
+int lyp_check_identifier(const char *id, enum LY_IDENT type, unsigned int line, struct lys_module *module,
+ struct lys_node *parent);
+int lyp_check_date(const char *date, unsigned int line);
+int lyp_check_mandatory(struct lys_node *node);
+
/**
* Store UTF-8 character specified as 4byte integer into the dst buffer.
* Returns number of written bytes (4 max), expects that dst has enough space.