@@ -17,6 +17,7 @@ struct ly_ctx;
1717#define LY_CTX_LEAFREF_EXTENDED ...
1818#define LY_CTX_LEAFREF_LINKING ...
1919#define LY_CTX_BUILTIN_PLUGINS_ONLY ...
20+ #define LY_CTX_COMPILE_OBSOLETE ...
2021
2122
2223typedef enum {
@@ -304,20 +305,19 @@ enum lyd_type {
304305 LYD_TYPE_REPLY_RESTCONF
305306};
306307
307- #define LYD_PRINT_KEEPEMPTYCONT ...
308308#define LYD_PRINT_SHRINK ...
309+ #define LYD_PRINT_EMPTY_CONT ...
309310#define LYD_PRINT_WD_ALL ...
310311#define LYD_PRINT_WD_ALL_TAG ...
311312#define LYD_PRINT_WD_EXPLICIT ...
312313#define LYD_PRINT_WD_IMPL_TAG ...
313314#define LYD_PRINT_WD_MASK ...
314- #define LYD_PRINT_WITHSIBLINGS ...
315+ #define LYD_PRINT_SIBLINGS ...
315316#define LYD_PRINT_WD_TRIM ...
316317LY_ERR lyd_print_mem (char * * , const struct lyd_node * , LYD_FORMAT , uint32_t );
317318LY_ERR lyd_print_tree (struct ly_out * , const struct lyd_node * , LYD_FORMAT , uint32_t );
318319LY_ERR lyd_print_all (struct ly_out * , const struct lyd_node * , LYD_FORMAT , uint32_t );
319320
320- #define LYD_PARSE_LYB_MOD_UPDATE ...
321321#define LYD_PARSE_NO_STATE ...
322322#define LYD_PARSE_STORE_ONLY ...
323323#define LYD_PARSE_JSON_NULL ...
@@ -351,7 +351,7 @@ LY_ERR ly_out_new_file(FILE *, struct ly_out **);
351351LY_ERR ly_out_new_fd (int , struct ly_out * * );
352352
353353LY_ERR lyd_parse_data (const struct ly_ctx * , struct lyd_node * , struct ly_in * , LYD_FORMAT , uint32_t , uint32_t , struct lyd_node * * );
354- LY_ERR lyd_parse_op (const struct ly_ctx * , struct lyd_node * , struct ly_in * , LYD_FORMAT , enum lyd_type , struct lyd_node * * , struct lyd_node * * );
354+ LY_ERR lyd_parse_op (const struct ly_ctx * , struct lyd_node * , struct ly_in * , LYD_FORMAT , enum lyd_type , uint32_t , struct lyd_node * * , struct lyd_node * * );
355355
356356typedef enum {
357357 LYS_OUT_UNKNOWN ,
@@ -369,6 +369,7 @@ LY_ERR lys_print_module(struct ly_out *, const struct lys_module *, LYS_OUTFORMA
369369
370370struct lysc_module {
371371 struct lys_module * mod ;
372+ const char * * features ;
372373 struct lysc_node * data ;
373374 struct lysc_node_action * rpcs ;
374375 struct lysc_node_notif * notifs ;
@@ -388,13 +389,15 @@ struct lys_module {
388389 const char * ref ;
389390 struct lysp_module * parsed ;
390391 struct lysc_module * compiled ;
392+ struct lysc_ext * extensions ;
391393 struct lysc_ident * identities ;
394+ struct lysc_submodule * submodules ;
392395 struct lys_module * * augmented_by ;
393396 struct lys_module * * deviated_by ;
394397 ly_bool implemented ;
395398 ly_bool to_compile ;
396- uint8_t latest_revision ;
397- ... ;
399+ uint8_t version : 2 ;
400+ uint8_t latest_revision : 4 ;
398401};
399402
400403struct lysp_module {
@@ -467,12 +470,11 @@ struct lysp_ext_instance {
467470 const char * argument ;
468471 LY_VALUE_FORMAT format ;
469472 void * prefix_data ;
470- struct lysp_ext * def ;
473+ uintptr_t plugin_ref ;
471474 void * parent ;
472475 enum ly_stmt parent_stmt ;
473476 uint64_t parent_stmt_index ;
474477 uint16_t flags ;
475- const struct lyplg_ext_record * record ;
476478 struct lysp_ext_substmt * substmts ;
477479 void * parsed ;
478480 struct lysp_stmt * child ;
@@ -610,6 +612,11 @@ struct lysp_node_container {
610612 ...;
611613};
612614
615+ struct lysc_value {
616+ const char * str ;
617+ struct lysc_prefix * prefixes ;
618+ };
619+
613620struct lysc_node_leaf {
614621 union {
615622 struct lysc_node node ;
@@ -623,7 +630,7 @@ struct lysc_node_leaf {
623630 struct lysc_when * * when ;
624631 struct lysc_type * type ;
625632 const char * units ;
626- struct lyd_value * dflt ;
633+ struct lysc_value dflt ;
627634 ...;
628635};
629636
@@ -653,7 +660,7 @@ struct lysc_node_leaflist {
653660 struct lysc_when * * when ;
654661 struct lysc_type * type ;
655662 const char * units ;
656- struct lyd_value * * dflts ;
663+ struct lysc_value * dflts ;
657664 uint32_t min ;
658665 uint32_t max ;
659666 ...;
@@ -783,7 +790,7 @@ struct lysp_node_augment {
783790struct lysc_type {
784791 const char * name ;
785792 struct lysc_ext_instance * exts ;
786- struct lyplg_type * plugin ;
793+ uintptr_t plugin_ref ;
787794 LY_DATA_TYPE basetype ;
788795 uint32_t refcount ;
789796};
@@ -859,7 +866,7 @@ struct lysc_ext {
859866 const char * name ;
860867 const char * argname ;
861868 struct lysc_ext_instance * exts ;
862- struct lyplg_ext * plugin ;
869+ uintptr_t plugin_ref ;
863870 struct lys_module * module ;
864871 uint16_t flags ;
865872};
@@ -982,7 +989,6 @@ typedef struct pcre2_real_code pcre2_code;
982989
983990struct lysc_pattern {
984991 const char * expr ;
985- pcre2_code * code ;
986992 const char * dsc ;
987993 const char * ref ;
988994 const char * emsg ;
@@ -1017,7 +1023,7 @@ struct lysc_ident {
10171023struct lysc_type_num {
10181024 const char * name ;
10191025 struct lysc_ext_instance * exts ;
1020- struct lyplg_type * plugin ;
1026+ uintptr_t plugin_ref ;
10211027 LY_DATA_TYPE basetype ;
10221028 uint32_t refcount ;
10231029 struct lysc_range * range ;
@@ -1026,7 +1032,7 @@ struct lysc_type_num {
10261032struct lysc_type_dec {
10271033 const char * name ;
10281034 struct lysc_ext_instance * exts ;
1029- struct lyplg_type * plugin ;
1035+ uintptr_t plugin_ref ;
10301036 LY_DATA_TYPE basetype ;
10311037 uint32_t refcount ;
10321038 uint8_t fraction_digits ;
@@ -1036,7 +1042,7 @@ struct lysc_type_dec {
10361042struct lysc_type_str {
10371043 const char * name ;
10381044 struct lysc_ext_instance * exts ;
1039- struct lyplg_type * plugin ;
1045+ uintptr_t plugin_ref ;
10401046 LY_DATA_TYPE basetype ;
10411047 uint32_t refcount ;
10421048 struct lysc_range * length ;
@@ -1058,7 +1064,7 @@ struct lysc_type_bitenum_item {
10581064struct lysc_type_enum {
10591065 const char * name ;
10601066 struct lysc_ext_instance * exts ;
1061- struct lyplg_type * plugin ;
1067+ uintptr_t plugin_ref ;
10621068 LY_DATA_TYPE basetype ;
10631069 uint32_t refcount ;
10641070 struct lysc_type_bitenum_item * enums ;
@@ -1067,7 +1073,7 @@ struct lysc_type_enum {
10671073struct lysc_type_bits {
10681074 const char * name ;
10691075 struct lysc_ext_instance * exts ;
1070- struct lyplg_type * plugin ;
1076+ uintptr_t plugin_ref ;
10711077 LY_DATA_TYPE basetype ;
10721078 uint32_t refcount ;
10731079 struct lysc_type_bitenum_item * bits ;
@@ -1076,7 +1082,7 @@ struct lysc_type_bits {
10761082struct lysc_type_leafref {
10771083 const char * name ;
10781084 struct lysc_ext_instance * exts ;
1079- struct lyplg_type * plugin ;
1085+ uintptr_t plugin_ref ;
10801086 LY_DATA_TYPE basetype ;
10811087 uint32_t refcount ;
10821088 struct lyxp_expr * path ;
@@ -1088,7 +1094,7 @@ struct lysc_type_leafref {
10881094struct lysc_type_identityref {
10891095 const char * name ;
10901096 struct lysc_ext_instance * exts ;
1091- struct lyplg_type * plugin ;
1097+ uintptr_t plugin_ref ;
10921098 LY_DATA_TYPE basetype ;
10931099 uint32_t refcount ;
10941100 struct lysc_ident * * bases ;
@@ -1097,7 +1103,7 @@ struct lysc_type_identityref {
10971103struct lysc_type_instanceid {
10981104 const char * name ;
10991105 struct lysc_ext_instance * exts ;
1100- struct lyplg_type * plugin ;
1106+ uintptr_t plugin_ref ;
11011107 LY_DATA_TYPE basetype ;
11021108 uint32_t refcount ;
11031109 uint8_t require_instance ;
@@ -1106,7 +1112,7 @@ struct lysc_type_instanceid {
11061112struct lysc_type_union {
11071113 const char * name ;
11081114 struct lysc_ext_instance * exts ;
1109- struct lyplg_type * plugin ;
1115+ uintptr_t plugin_ref ;
11101116 LY_DATA_TYPE basetype ;
11111117 uint32_t refcount ;
11121118 struct lysc_type * * types ;
@@ -1115,7 +1121,7 @@ struct lysc_type_union {
11151121struct lysc_type_bin {
11161122 const char * name ;
11171123 struct lysc_ext_instance * exts ;
1118- struct lyplg_type * plugin ;
1124+ uintptr_t plugin_ref ;
11191125 LY_DATA_TYPE basetype ;
11201126 uint32_t refcount ;
11211127 struct lysc_range * length ;
@@ -1159,16 +1165,14 @@ typedef enum {
11591165 LYD_ANYDATA_DATATREE ,
11601166 LYD_ANYDATA_STRING ,
11611167 LYD_ANYDATA_XML ,
1162- LYD_ANYDATA_JSON ,
1163- LYD_ANYDATA_LYB
1168+ LYD_ANYDATA_JSON
11641169} LYD_ANYDATA_VALUETYPE ;
11651170
11661171union lyd_any_value {
11671172 struct lyd_node * tree ;
11681173 const char * str ;
11691174 const char * xml ;
11701175 const char * json ;
1171- char * mem ;
11721176};
11731177
11741178struct lyd_node_any {
@@ -1320,6 +1324,8 @@ struct lyd_attr {
13201324LY_ERR lyd_new_attr (struct lyd_node * , const char * , const char * , const char * , struct lyd_attr * * );
13211325void lyd_free_attr_single (const struct ly_ctx * ctx , struct lyd_attr * attr );
13221326
1327+ LY_ERR lyd_value_validate_dflt (const struct lysc_node * , const char * , struct lysc_prefix * , const struct lyd_node * , const struct lysc_type * * , const char * * );
1328+
13231329struct lyd_leafref_links_rec {
13241330 const struct lyd_node_term * node ;
13251331 const struct lyd_node_term * * leafref_nodes ;
@@ -1328,13 +1334,14 @@ struct lyd_leafref_links_rec {
13281334
13291335LY_ERR lyd_leafref_get_links (const struct lyd_node_term * , const struct lyd_leafref_links_rec * * );
13301336LY_ERR lyd_leafref_link_node_tree (struct lyd_node * );
1337+ struct lyplg_ext * lysc_get_ext_plugin (uintptr_t );
13311338const char * lyplg_ext_stmt2str (enum ly_stmt stmt );
13321339const struct lysp_module * lyplg_ext_parse_get_cur_pmod (const struct lysp_ctx * );
13331340struct ly_ctx * lyplg_ext_compile_get_ctx (const struct lysc_ctx * );
13341341void lyplg_ext_parse_log (const struct lysp_ctx * , const struct lysp_ext_instance * , LY_LOG_LEVEL , LY_ERR , const char * , ...);
13351342void lyplg_ext_compile_log (const struct lysc_ctx * , const struct lysc_ext_instance * , LY_LOG_LEVEL , LY_ERR , const char * , ...);
13361343LY_ERR lyplg_ext_parse_extension_instance (struct lysp_ctx * , struct lysp_ext_instance * );
1337- LY_ERR lyplg_ext_compile_extension_instance (struct lysc_ctx * , const struct lysp_ext_instance * , struct lysc_ext_instance * );
1344+ LY_ERR lyplg_ext_compile_extension_instance (struct lysc_ctx * , const struct lysp_ext_instance * , struct lysc_ext_instance * , struct lysc_node * );
13381345void lyplg_ext_pfree_instance_substatements (const struct ly_ctx * ctx , struct lysp_ext_substmt * substmts );
13391346void lyplg_ext_cfree_instance_substatements (const struct ly_ctx * ctx , struct lysc_ext_substmt * substmts );
13401347typedef LY_ERR (* lyplg_ext_parse_clb )(struct lysp_ctx * , struct lysp_ext_instance * );
0 commit comments