@@ -316,7 +316,6 @@ LY_ERR lyd_print_mem(char **, const struct lyd_node *, LYD_FORMAT, uint32_t);
316316LY_ERR lyd_print_tree (struct ly_out * , const struct lyd_node * , LYD_FORMAT , uint32_t );
317317LY_ERR lyd_print_all (struct ly_out * , const struct lyd_node * , LYD_FORMAT , uint32_t );
318318
319- #define LYD_PARSE_LYB_MOD_UPDATE ...
320319#define LYD_PARSE_NO_STATE ...
321320#define LYD_PARSE_STORE_ONLY ...
322321#define LYD_PARSE_JSON_NULL ...
@@ -350,7 +349,7 @@ LY_ERR ly_out_new_file(FILE *, struct ly_out **);
350349LY_ERR ly_out_new_fd (int , struct ly_out * * );
351350
352351LY_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 * * );
352+ 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 * * );
354353
355354typedef enum {
356355 LYS_OUT_UNKNOWN ,
@@ -368,6 +367,7 @@ LY_ERR lys_print_module(struct ly_out *, const struct lys_module *, LYS_OUTFORMA
368367
369368struct lysc_module {
370369 struct lys_module * mod ;
370+ const char * * features ;
371371 struct lysc_node * data ;
372372 struct lysc_node_action * rpcs ;
373373 struct lysc_node_notif * notifs ;
@@ -387,13 +387,15 @@ struct lys_module {
387387 const char * ref ;
388388 struct lysp_module * parsed ;
389389 struct lysc_module * compiled ;
390+ struct lysc_ext * extensions ;
390391 struct lysc_ident * identities ;
392+ struct lysc_submodule * submodules ;
391393 struct lys_module * * augmented_by ;
392394 struct lys_module * * deviated_by ;
393395 ly_bool implemented ;
394396 ly_bool to_compile ;
395- uint8_t latest_revision ;
396- ... ;
397+ uint8_t version : 2 ;
398+ uint8_t latest_revision : 4 ;
397399};
398400
399401struct lysp_module {
@@ -466,12 +468,11 @@ struct lysp_ext_instance {
466468 const char * argument ;
467469 LY_VALUE_FORMAT format ;
468470 void * prefix_data ;
469- struct lysp_ext * def ;
471+ uintptr_t plugin_ref ;
470472 void * parent ;
471473 enum ly_stmt parent_stmt ;
472474 uint64_t parent_stmt_index ;
473475 uint16_t flags ;
474- const struct lyplg_ext_record * record ;
475476 struct lysp_ext_substmt * substmts ;
476477 void * parsed ;
477478 struct lysp_stmt * child ;
@@ -609,6 +610,11 @@ struct lysp_node_container {
609610 ...;
610611};
611612
613+ struct lysc_value {
614+ const char * str ;
615+ struct lysc_prefix * prefixes ;
616+ };
617+
612618struct lysc_node_leaf {
613619 union {
614620 struct lysc_node node ;
@@ -622,7 +628,7 @@ struct lysc_node_leaf {
622628 struct lysc_when * * when ;
623629 struct lysc_type * type ;
624630 const char * units ;
625- struct lyd_value * dflt ;
631+ struct lysc_value dflt ;
626632 ...;
627633};
628634
@@ -652,7 +658,7 @@ struct lysc_node_leaflist {
652658 struct lysc_when * * when ;
653659 struct lysc_type * type ;
654660 const char * units ;
655- struct lyd_value * * dflts ;
661+ struct lysc_value * dflts ;
656662 uint32_t min ;
657663 uint32_t max ;
658664 ...;
@@ -782,7 +788,7 @@ struct lysp_node_augment {
782788struct lysc_type {
783789 const char * name ;
784790 struct lysc_ext_instance * exts ;
785- struct lyplg_type * plugin ;
791+ uintptr_t plugin_ref ;
786792 LY_DATA_TYPE basetype ;
787793 uint32_t refcount ;
788794};
@@ -858,7 +864,7 @@ struct lysc_ext {
858864 const char * name ;
859865 const char * argname ;
860866 struct lysc_ext_instance * exts ;
861- struct lyplg_ext * plugin ;
867+ uintptr_t plugin_ref ;
862868 struct lys_module * module ;
863869 uint16_t flags ;
864870};
@@ -981,7 +987,6 @@ typedef struct pcre2_real_code pcre2_code;
981987
982988struct lysc_pattern {
983989 const char * expr ;
984- pcre2_code * code ;
985990 const char * dsc ;
986991 const char * ref ;
987992 const char * emsg ;
@@ -1016,7 +1021,7 @@ struct lysc_ident {
10161021struct lysc_type_num {
10171022 const char * name ;
10181023 struct lysc_ext_instance * exts ;
1019- struct lyplg_type * plugin ;
1024+ uintptr_t plugin_ref ;
10201025 LY_DATA_TYPE basetype ;
10211026 uint32_t refcount ;
10221027 struct lysc_range * range ;
@@ -1025,7 +1030,7 @@ struct lysc_type_num {
10251030struct lysc_type_dec {
10261031 const char * name ;
10271032 struct lysc_ext_instance * exts ;
1028- struct lyplg_type * plugin ;
1033+ uintptr_t plugin_ref ;
10291034 LY_DATA_TYPE basetype ;
10301035 uint32_t refcount ;
10311036 uint8_t fraction_digits ;
@@ -1035,7 +1040,7 @@ struct lysc_type_dec {
10351040struct lysc_type_str {
10361041 const char * name ;
10371042 struct lysc_ext_instance * exts ;
1038- struct lyplg_type * plugin ;
1043+ uintptr_t plugin_ref ;
10391044 LY_DATA_TYPE basetype ;
10401045 uint32_t refcount ;
10411046 struct lysc_range * length ;
@@ -1057,7 +1062,7 @@ struct lysc_type_bitenum_item {
10571062struct lysc_type_enum {
10581063 const char * name ;
10591064 struct lysc_ext_instance * exts ;
1060- struct lyplg_type * plugin ;
1065+ uintptr_t plugin_ref ;
10611066 LY_DATA_TYPE basetype ;
10621067 uint32_t refcount ;
10631068 struct lysc_type_bitenum_item * enums ;
@@ -1066,7 +1071,7 @@ struct lysc_type_enum {
10661071struct lysc_type_bits {
10671072 const char * name ;
10681073 struct lysc_ext_instance * exts ;
1069- struct lyplg_type * plugin ;
1074+ uintptr_t plugin_ref ;
10701075 LY_DATA_TYPE basetype ;
10711076 uint32_t refcount ;
10721077 struct lysc_type_bitenum_item * bits ;
@@ -1075,7 +1080,7 @@ struct lysc_type_bits {
10751080struct lysc_type_leafref {
10761081 const char * name ;
10771082 struct lysc_ext_instance * exts ;
1078- struct lyplg_type * plugin ;
1083+ uintptr_t plugin_ref ;
10791084 LY_DATA_TYPE basetype ;
10801085 uint32_t refcount ;
10811086 struct lyxp_expr * path ;
@@ -1087,7 +1092,7 @@ struct lysc_type_leafref {
10871092struct lysc_type_identityref {
10881093 const char * name ;
10891094 struct lysc_ext_instance * exts ;
1090- struct lyplg_type * plugin ;
1095+ uintptr_t plugin_ref ;
10911096 LY_DATA_TYPE basetype ;
10921097 uint32_t refcount ;
10931098 struct lysc_ident * * bases ;
@@ -1096,7 +1101,7 @@ struct lysc_type_identityref {
10961101struct lysc_type_instanceid {
10971102 const char * name ;
10981103 struct lysc_ext_instance * exts ;
1099- struct lyplg_type * plugin ;
1104+ uintptr_t plugin_ref ;
11001105 LY_DATA_TYPE basetype ;
11011106 uint32_t refcount ;
11021107 uint8_t require_instance ;
@@ -1105,7 +1110,7 @@ struct lysc_type_instanceid {
11051110struct lysc_type_union {
11061111 const char * name ;
11071112 struct lysc_ext_instance * exts ;
1108- struct lyplg_type * plugin ;
1113+ uintptr_t plugin_ref ;
11091114 LY_DATA_TYPE basetype ;
11101115 uint32_t refcount ;
11111116 struct lysc_type * * types ;
@@ -1114,7 +1119,7 @@ struct lysc_type_union {
11141119struct lysc_type_bin {
11151120 const char * name ;
11161121 struct lysc_ext_instance * exts ;
1117- struct lyplg_type * plugin ;
1122+ uintptr_t plugin_ref ;
11181123 LY_DATA_TYPE basetype ;
11191124 uint32_t refcount ;
11201125 struct lysc_range * length ;
@@ -1158,16 +1163,14 @@ typedef enum {
11581163 LYD_ANYDATA_DATATREE ,
11591164 LYD_ANYDATA_STRING ,
11601165 LYD_ANYDATA_XML ,
1161- LYD_ANYDATA_JSON ,
1162- LYD_ANYDATA_LYB
1166+ LYD_ANYDATA_JSON
11631167} LYD_ANYDATA_VALUETYPE ;
11641168
11651169union lyd_any_value {
11661170 struct lyd_node * tree ;
11671171 const char * str ;
11681172 const char * xml ;
11691173 const char * json ;
1170- char * mem ;
11711174};
11721175
11731176struct lyd_node_any {
@@ -1319,6 +1322,8 @@ struct lyd_attr {
13191322LY_ERR lyd_new_attr (struct lyd_node * , const char * , const char * , const char * , struct lyd_attr * * );
13201323void lyd_free_attr_single (const struct ly_ctx * ctx , struct lyd_attr * attr );
13211324
1325+ 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 * * );
1326+
13221327struct lyd_leafref_links_rec {
13231328 const struct lyd_node_term * node ;
13241329 const struct lyd_node_term * * leafref_nodes ;
@@ -1327,13 +1332,14 @@ struct lyd_leafref_links_rec {
13271332
13281333LY_ERR lyd_leafref_get_links (const struct lyd_node_term * , const struct lyd_leafref_links_rec * * );
13291334LY_ERR lyd_leafref_link_node_tree (struct lyd_node * );
1335+ struct lyplg_ext * lysc_get_ext_plugin (uintptr_t );
13301336const char * lyplg_ext_stmt2str (enum ly_stmt stmt );
13311337const struct lysp_module * lyplg_ext_parse_get_cur_pmod (const struct lysp_ctx * );
13321338struct ly_ctx * lyplg_ext_compile_get_ctx (const struct lysc_ctx * );
13331339void lyplg_ext_parse_log (const struct lysp_ctx * , const struct lysp_ext_instance * , LY_LOG_LEVEL , LY_ERR , const char * , ...);
13341340void lyplg_ext_compile_log (const struct lysc_ctx * , const struct lysc_ext_instance * , LY_LOG_LEVEL , LY_ERR , const char * , ...);
13351341LY_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 * );
1342+ LY_ERR lyplg_ext_compile_extension_instance (struct lysc_ctx * , const struct lysp_ext_instance * , struct lysc_ext_instance * , struct lysc_node * );
13371343void lyplg_ext_pfree_instance_substatements (const struct ly_ctx * ctx , struct lysp_ext_substmt * substmts );
13381344void lyplg_ext_cfree_instance_substatements (const struct ly_ctx * ctx , struct lysc_ext_substmt * substmts );
13391345typedef LY_ERR (* lyplg_ext_parse_clb )(struct lysp_ctx * , struct lysp_ext_instance * );
0 commit comments