@@ -260,7 +260,7 @@ structure_compile(struct lysc_ctx *cctx, const struct lysp_ext_instance *extp, s
260
260
}
261
261
262
262
/**
263
- * @brief INFO printer
263
+ * @brief Structure schema info printer.
264
264
*
265
265
* Implementation of ::lyplg_ext_sprinter_info_clb set as ::lyext_plugin::printer_info
266
266
*/
@@ -430,6 +430,11 @@ structure_sprinter_cnode(const struct lysc_node *UNUSED(node), const void *UNUSE
430
430
return LY_SUCCESS ;
431
431
}
432
432
433
+ /**
434
+ * @brief Structure schema compiled tree printer.
435
+ *
436
+ * Implementation of ::lyplg_ext_sprinter_ctree_clb callback set as lyext_plugin::printer_ctree.
437
+ */
433
438
static LY_ERR
434
439
structure_sprinter_ctree (struct lysc_ext_instance * ext , const struct lyspr_tree_ctx * ctx ,
435
440
const char * * UNUSED (flags ), const char * * UNUSED (add_opts ))
@@ -440,6 +445,11 @@ structure_sprinter_ctree(struct lysc_ext_instance *ext, const struct lyspr_tree_
440
445
return rc ;
441
446
}
442
447
448
+ /**
449
+ * @brief Structure schema parsed tree printer.
450
+ *
451
+ * Implementation of ::lyplg_ext_sprinter_ptree_clb callback set as lyext_plugin::printer_ptree.
452
+ */
443
453
static LY_ERR
444
454
structure_sprinter_ptree (struct lysp_ext_instance * ext , const struct lyspr_tree_ctx * ctx ,
445
455
const char * * UNUSED (flags ), const char * * UNUSED (add_opts ))
@@ -450,6 +460,11 @@ structure_sprinter_ptree(struct lysp_ext_instance *ext, const struct lyspr_tree_
450
460
return rc ;
451
461
}
452
462
463
+ /**
464
+ * @brief Augment structure schema parsed tree printer.
465
+ *
466
+ * Implementation of ::lyplg_ext_sprinter_ptree_clb callback set as lyext_plugin::printer_ptree.
467
+ */
453
468
static LY_ERR
454
469
structure_aug_sprinter_ptree (struct lysp_ext_instance * ext , const struct lyspr_tree_ctx * ctx ,
455
470
const char * * UNUSED (flags ), const char * * UNUSED (add_opts ))
@@ -465,9 +480,14 @@ structure_aug_sprinter_ptree(struct lysp_ext_instance *ext, const struct lyspr_t
465
480
return rc ;
466
481
}
467
482
483
+ /**
484
+ * @brief Augment structure schema compiled tree printer.
485
+ *
486
+ * Implementation of ::lyplg_ext_sprinter_ctree_clb callback set as lyext_plugin::printer_ctree.
487
+ */
468
488
static LY_ERR
469
- structure_aug_sprinter_ctree (struct lysc_ext_instance * ext , const struct lyspr_tree_ctx * ctx ,
470
- const char * * flags , const char * * add_opts )
489
+ structure_aug_sprinter_ctree (struct lysc_ext_instance * ext , const struct lyspr_tree_ctx * ctx , const char * * flags ,
490
+ const char * * add_opts )
471
491
{
472
492
LY_ERR rc = LY_SUCCESS ;
473
493
@@ -476,18 +496,17 @@ structure_aug_sprinter_ctree(struct lysc_ext_instance *ext, const struct lyspr_t
476
496
477
497
assert (ctx );
478
498
499
+ /* find the parsed ext structure */
479
500
parsed_ext = ext -> module -> parsed -> exts ;
480
501
LY_ARRAY_FOR (parsed_ext , i ) {
481
- if (strcmp (parsed_ext [i ].name , "sx:augment-structure" )) {
482
- continue ;
483
- } else if (strcmp (parsed_ext [i ].argument , ext -> argument )) {
484
- continue ;
502
+ if (!strcmp (parsed_ext [i ].name , "sx:augment-structure" ) && !strcmp (parsed_ext [i ].argument , ext -> argument )) {
503
+ break ;
485
504
}
486
-
487
- rc = structure_aug_sprinter_ptree (parsed_ext , ctx , flags , add_opts );
488
- break ;
489
505
}
506
+ assert (i < LY_ARRAY_COUNT (parsed_ext ));
490
507
508
+ /* for augments print the parsed tree */
509
+ rc = structure_aug_sprinter_ptree (parsed_ext , ctx , flags , add_opts );
491
510
return rc ;
492
511
}
493
512
0 commit comments