schema CHANGE move schema related structures to tree_schema.h
By their name and usage, lysc_ext_substmt and ly_stmt_cardinality belong
better into tree_schem.h instead of plugins_exts.h
diff --git a/src/tree_schema.h b/src/tree_schema.h
index 01774f5..b6c5246 100644
--- a/src/tree_schema.h
+++ b/src/tree_schema.h
@@ -441,6 +441,18 @@
enum ly_stmt lys_nodetype2stmt(uint16_t nodetype);
/**
+ * @brief Possible cardinalities of the YANG statements.
+ *
+ * Used in extensions plugins to define cardinalities of the extension instance substatements.
+ */
+enum ly_stmt_cardinality {
+ LY_STMT_CARD_OPT, /* 0..1 */
+ LY_STMT_CARD_MAND, /* 1 */
+ LY_STMT_CARD_SOME, /* 1..n */
+ LY_STMT_CARD_ANY /* 0..n */
+};
+
+/**
* @brief YANG import-stmt
*/
struct lysp_import {
@@ -1392,6 +1404,19 @@
};
/**
+ * @brief Description of the extension instance substatements.
+ *
+ * Provided by extensions plugins to libyang to be able to correctly compile the content of extension instances.
+ * Note that order of the defined records matters - just follow the values of ::ly_stmt and order the records from lower to higher values.
+ */
+struct lysc_ext_substmt {
+ enum ly_stmt stmt; /**< allowed substatement */
+ enum ly_stmt_cardinality cardinality; /**< cardinality of the substatement */
+ void *storage; /**< pointer to the storage of the compiled statement according to the specific
+ lysc_ext_substmt::stmt and lysc_ext_substmt::cardinality */
+};
+
+/**
* @brief YANG extension instance
*/
struct lysc_ext_instance {