@@ -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 {
@@ -303,20 +304,19 @@ enum lyd_type {
303304 LYD_TYPE_REPLY_RESTCONF
304305};
305306
306- #define LYD_PRINT_KEEPEMPTYCONT ...
307307#define LYD_PRINT_SHRINK ...
308+ #define LYD_PRINT_EMPTY_CONT ...
308309#define LYD_PRINT_WD_ALL ...
309310#define LYD_PRINT_WD_ALL_TAG ...
310311#define LYD_PRINT_WD_EXPLICIT ...
311312#define LYD_PRINT_WD_IMPL_TAG ...
312313#define LYD_PRINT_WD_MASK ...
313- #define LYD_PRINT_WITHSIBLINGS ...
314+ #define LYD_PRINT_SIBLINGS ...
314315#define LYD_PRINT_WD_TRIM ...
315316LY_ERR lyd_print_mem (char * * , const struct lyd_node * , LYD_FORMAT , uint32_t );
316317LY_ERR lyd_print_tree (struct ly_out * , const struct lyd_node * , LYD_FORMAT , uint32_t );
317318LY_ERR lyd_print_all (struct ly_out * , const struct lyd_node * , LYD_FORMAT , uint32_t );
318319
319- #define LYD_PARSE_LYB_MOD_UPDATE ...
320320#define LYD_PARSE_NO_STATE ...
321321#define LYD_PARSE_STORE_ONLY ...
322322#define LYD_PARSE_JSON_NULL ...
@@ -350,7 +350,7 @@ LY_ERR ly_out_new_file(FILE *, struct ly_out **);
350350LY_ERR ly_out_new_fd (int , struct ly_out * * );
351351
352352LY_ERR lyd_parse_data (const struct ly_ctx * , struct lyd_node * , struct ly_in * , LYD_FORMAT , uint32_t , uint32_t , struct lyd_node * * );
353- 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 * * );
353+ 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 * * );
354354
355355typedef enum {
356356 LYS_OUT_UNKNOWN ,
@@ -368,6 +368,7 @@ LY_ERR lys_print_module(struct ly_out *, const struct lys_module *, LYS_OUTFORMA
368368
369369struct lysc_module {
370370 struct lys_module * mod ;
371+ const char * * features ;
371372 struct lysc_node * data ;
372373 struct lysc_node_action * rpcs ;
373374 struct lysc_node_notif * notifs ;
@@ -387,13 +388,15 @@ struct lys_module {
387388 const char * ref ;
388389 struct lysp_module * parsed ;
389390 struct lysc_module * compiled ;
391+ struct lysc_ext * extensions ;
390392 struct lysc_ident * identities ;
393+ struct lysc_submodule * submodules ;
391394 struct lys_module * * augmented_by ;
392395 struct lys_module * * deviated_by ;
393396 ly_bool implemented ;
394397 ly_bool to_compile ;
395- uint8_t latest_revision ;
396- ... ;
398+ uint8_t version : 2 ;
399+ uint8_t latest_revision : 4 ;
397400};
398401
399402struct lysp_module {
@@ -466,12 +469,11 @@ struct lysp_ext_instance {
466469 const char * argument ;
467470 LY_VALUE_FORMAT format ;
468471 void * prefix_data ;
469- struct lysp_ext * def ;
472+ uintptr_t plugin_ref ;
470473 void * parent ;
471474 enum ly_stmt parent_stmt ;
472475 uint64_t parent_stmt_index ;
473476 uint16_t flags ;
474- const struct lyplg_ext_record * record ;
475477 struct lysp_ext_substmt * substmts ;
476478 void * parsed ;
477479 struct lysp_stmt * child ;
@@ -609,6 +611,11 @@ struct lysp_node_container {
609611 ...;
610612};
611613
614+ struct lysc_value {
615+ const char * str ;
616+ struct lysc_prefix * prefixes ;
617+ };
618+
612619struct lysc_node_leaf {
613620 union {
614621 struct lysc_node node ;
@@ -622,7 +629,7 @@ struct lysc_node_leaf {
622629 struct lysc_when * * when ;
623630 struct lysc_type * type ;
624631 const char * units ;
625- struct lyd_value * dflt ;
632+ struct lysc_value dflt ;
626633 ...;
627634};
628635
@@ -652,7 +659,7 @@ struct lysc_node_leaflist {
652659 struct lysc_when * * when ;
653660 struct lysc_type * type ;
654661 const char * units ;
655- struct lyd_value * * dflts ;
662+ struct lysc_value * dflts ;
656663 uint32_t min ;
657664 uint32_t max ;
658665 ...;
@@ -782,7 +789,7 @@ struct lysp_node_augment {
782789struct lysc_type {
783790 const char * name ;
784791 struct lysc_ext_instance * exts ;
785- struct lyplg_type * plugin ;
792+ uintptr_t plugin_ref ;
786793 LY_DATA_TYPE basetype ;
787794 uint32_t refcount ;
788795};
@@ -858,7 +865,7 @@ struct lysc_ext {
858865 const char * name ;
859866 const char * argname ;
860867 struct lysc_ext_instance * exts ;
861- struct lyplg_ext * plugin ;
868+ uintptr_t plugin_ref ;
862869 struct lys_module * module ;
863870 uint16_t flags ;
864871};
@@ -981,7 +988,6 @@ typedef struct pcre2_real_code pcre2_code;
981988
982989struct lysc_pattern {
983990 const char * expr ;
984- pcre2_code * code ;
985991 const char * dsc ;
986992 const char * ref ;
987993 const char * emsg ;
@@ -1016,7 +1022,7 @@ struct lysc_ident {
10161022struct lysc_type_num {
10171023 const char * name ;
10181024 struct lysc_ext_instance * exts ;
1019- struct lyplg_type * plugin ;
1025+ uintptr_t plugin_ref ;
10201026 LY_DATA_TYPE basetype ;
10211027 uint32_t refcount ;
10221028 struct lysc_range * range ;
@@ -1025,7 +1031,7 @@ struct lysc_type_num {
10251031struct lysc_type_dec {
10261032 const char * name ;
10271033 struct lysc_ext_instance * exts ;
1028- struct lyplg_type * plugin ;
1034+ uintptr_t plugin_ref ;
10291035 LY_DATA_TYPE basetype ;
10301036 uint32_t refcount ;
10311037 uint8_t fraction_digits ;
@@ -1035,7 +1041,7 @@ struct lysc_type_dec {
10351041struct lysc_type_str {
10361042 const char * name ;
10371043 struct lysc_ext_instance * exts ;
1038- struct lyplg_type * plugin ;
1044+ uintptr_t plugin_ref ;
10391045 LY_DATA_TYPE basetype ;
10401046 uint32_t refcount ;
10411047 struct lysc_range * length ;
@@ -1057,7 +1063,7 @@ struct lysc_type_bitenum_item {
10571063struct lysc_type_enum {
10581064 const char * name ;
10591065 struct lysc_ext_instance * exts ;
1060- struct lyplg_type * plugin ;
1066+ uintptr_t plugin_ref ;
10611067 LY_DATA_TYPE basetype ;
10621068 uint32_t refcount ;
10631069 struct lysc_type_bitenum_item * enums ;
@@ -1066,7 +1072,7 @@ struct lysc_type_enum {
10661072struct lysc_type_bits {
10671073 const char * name ;
10681074 struct lysc_ext_instance * exts ;
1069- struct lyplg_type * plugin ;
1075+ uintptr_t plugin_ref ;
10701076 LY_DATA_TYPE basetype ;
10711077 uint32_t refcount ;
10721078 struct lysc_type_bitenum_item * bits ;
@@ -1075,7 +1081,7 @@ struct lysc_type_bits {
10751081struct lysc_type_leafref {
10761082 const char * name ;
10771083 struct lysc_ext_instance * exts ;
1078- struct lyplg_type * plugin ;
1084+ uintptr_t plugin_ref ;
10791085 LY_DATA_TYPE basetype ;
10801086 uint32_t refcount ;
10811087 struct lyxp_expr * path ;
@@ -1087,7 +1093,7 @@ struct lysc_type_leafref {
10871093struct lysc_type_identityref {
10881094 const char * name ;
10891095 struct lysc_ext_instance * exts ;
1090- struct lyplg_type * plugin ;
1096+ uintptr_t plugin_ref ;
10911097 LY_DATA_TYPE basetype ;
10921098 uint32_t refcount ;
10931099 struct lysc_ident * * bases ;
@@ -1096,7 +1102,7 @@ struct lysc_type_identityref {
10961102struct lysc_type_instanceid {
10971103 const char * name ;
10981104 struct lysc_ext_instance * exts ;
1099- struct lyplg_type * plugin ;
1105+ uintptr_t plugin_ref ;
11001106 LY_DATA_TYPE basetype ;
11011107 uint32_t refcount ;
11021108 uint8_t require_instance ;
@@ -1105,7 +1111,7 @@ struct lysc_type_instanceid {
11051111struct lysc_type_union {
11061112 const char * name ;
11071113 struct lysc_ext_instance * exts ;
1108- struct lyplg_type * plugin ;
1114+ uintptr_t plugin_ref ;
11091115 LY_DATA_TYPE basetype ;
11101116 uint32_t refcount ;
11111117 struct lysc_type * * types ;
@@ -1114,7 +1120,7 @@ struct lysc_type_union {
11141120struct lysc_type_bin {
11151121 const char * name ;
11161122 struct lysc_ext_instance * exts ;
1117- struct lyplg_type * plugin ;
1123+ uintptr_t plugin_ref ;
11181124 LY_DATA_TYPE basetype ;
11191125 uint32_t refcount ;
11201126 struct lysc_range * length ;
@@ -1158,16 +1164,14 @@ typedef enum {
11581164 LYD_ANYDATA_DATATREE ,
11591165 LYD_ANYDATA_STRING ,
11601166 LYD_ANYDATA_XML ,
1161- LYD_ANYDATA_JSON ,
1162- LYD_ANYDATA_LYB
1167+ LYD_ANYDATA_JSON
11631168} LYD_ANYDATA_VALUETYPE ;
11641169
11651170union lyd_any_value {
11661171 struct lyd_node * tree ;
11671172 const char * str ;
11681173 const char * xml ;
11691174 const char * json ;
1170- char * mem ;
11711175};
11721176
11731177struct lyd_node_any {
@@ -1319,6 +1323,8 @@ struct lyd_attr {
13191323LY_ERR lyd_new_attr (struct lyd_node * , const char * , const char * , const char * , struct lyd_attr * * );
13201324void lyd_free_attr_single (const struct ly_ctx * ctx , struct lyd_attr * attr );
13211325
1326+ 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 * * );
1327+
13221328struct lyd_leafref_links_rec {
13231329 const struct lyd_node_term * node ;
13241330 const struct lyd_node_term * * leafref_nodes ;
@@ -1327,13 +1333,14 @@ struct lyd_leafref_links_rec {
13271333
13281334LY_ERR lyd_leafref_get_links (const struct lyd_node_term * , const struct lyd_leafref_links_rec * * );
13291335LY_ERR lyd_leafref_link_node_tree (struct lyd_node * );
1336+ struct lyplg_ext * lysc_get_ext_plugin (uintptr_t );
13301337const char * lyplg_ext_stmt2str (enum ly_stmt stmt );
13311338const struct lysp_module * lyplg_ext_parse_get_cur_pmod (const struct lysp_ctx * );
13321339struct ly_ctx * lyplg_ext_compile_get_ctx (const struct lysc_ctx * );
13331340void lyplg_ext_parse_log (const struct lysp_ctx * , const struct lysp_ext_instance * , LY_LOG_LEVEL , LY_ERR , const char * , ...);
13341341void lyplg_ext_compile_log (const struct lysc_ctx * , const struct lysc_ext_instance * , LY_LOG_LEVEL , LY_ERR , const char * , ...);
13351342LY_ERR lyplg_ext_parse_extension_instance (struct lysp_ctx * , struct lysp_ext_instance * );
1336- LY_ERR lyplg_ext_compile_extension_instance (struct lysc_ctx * , const struct lysp_ext_instance * , struct lysc_ext_instance * );
1343+ LY_ERR lyplg_ext_compile_extension_instance (struct lysc_ctx * , const struct lysp_ext_instance * , struct lysc_ext_instance * , struct lysc_node * );
13371344void lyplg_ext_pfree_instance_substatements (const struct ly_ctx * ctx , struct lysp_ext_substmt * substmts );
13381345void lyplg_ext_cfree_instance_substatements (const struct ly_ctx * ctx , struct lysc_ext_substmt * substmts );
13391346typedef LY_ERR (* lyplg_ext_parse_clb )(struct lysp_ctx * , struct lysp_ext_instance * );
0 commit comments