@@ -77,13 +77,6 @@ extern "C" {
7777 * [helper functions](@ref pluginsExtensionsSprinterInfo) to access printer's context and to print standard YANG statements
7878 * placed in the extension instance by libyang itself.
7979 *
80- * The ::lyplg_ext.printer_ctree and ::lyplg_ext.printer_ptree callbacks implement printing of YANG tree diagrams
81- * (RFC 8340) for extension instance data. These callbacks are called for extension instances that have
82- * parents of type ::LY_STMT_MODULE, ::LY_STMT_SUBMODULE. Or these callbacks are called if the printer_tree finds
83- * a compiled/parsed data-node containing an extension instance. The callbacks should then decide which nodes
84- * should be printed within the extension instance. In addition, it is possible to register additional callbacks
85- * to the printer_tree context to override the form of the each node in the extension instance.
86- *
8780 * The last callback, ::lyplg_ext.cfree, is supposed to free all the data allocated by the ::lyplg_ext.compile callback.
8881 * To free the data created by helper function ::lyplg_ext_compile_extension_instance(), the plugin can used
8982 * ::lyplg_ext_cfree_instance_substatements().
@@ -109,7 +102,7 @@ extern "C" {
109102/**
110103 * @brief Extensions API version
111104 */
112- #define LYPLG_EXT_API_VERSION 11
105+ #define LYPLG_EXT_API_VERSION 12
113106
114107/**
115108 * @brief Mask for an operation statement.
@@ -729,109 +722,6 @@ LIBYANG_API_DECL void lyplg_ext_print_info_extension_instance(struct lyspr_ctx *
729722
730723/** @} pluginsExtensionsSprinterInfo */
731724
732- /**
733- * @defgroup pluginsExtensionsSprinterTree Plugins: Extensions schema parsed and compiled tree printer support
734- * @ingroup pluginsExtensions
735- *
736- * Implementing extension plugin schema parsed and compiled tree printer callback.
737- *
738- * @{
739- */
740-
741- /**
742- * @brief Callback to print parent node of @p ext or to print the contents of the extension.
743- *
744- * Function is called in two different cases. If the printer_tree needs the tree-diagram form of a parent node,
745- * then @p ctx is set to NULL. In the second case, if printer_tree needs to print the contents of the extension,
746- * then @p ctx is set and function must prepare the nodes that should be printed using the
747- * lyplg_ext_sprinter_tree* functions.
748- *
749- * @param[in] ext Extension instance.
750- * @param[in,out] ctx Context for the tree printer. Extension contents can be inserted into it by functions
751- * lyplg_ext_sprinter_ctree_add_ext_nodes(), lyplg_ext_sprinter_ctree_add_nodes() or by their ptree alternatives.
752- * It parameter is set to NULL, then @p flags and @p add_opts are used by printer_tree.
753- * @param[out] flags Optional override tree-diagram \<flags\> in a parent node. If @p ctx is set, ignore this parameter.
754- * @param[out] add_opts Additional tree-diagram \<opts\> string in a parent node which is printed before \<opts\>. If @p ctx
755- * is set, ignore this parameter.
756- * @return LY_ERR value.
757- */
758- typedef LY_ERR (* lyplg_ext_sprinter_ctree_clb )(struct lysc_ext_instance * ext , const struct lyspr_tree_ctx * ctx ,
759- const char * * flags , const char * * add_opts );
760-
761- /**
762- * @brief Callback for rewriting the tree-diagram form of a specific node.
763- *
764- * If this callback is set, then it is called for each node that belongs to the extension instance.
765- *
766- * @param[in] node Node whose tree-diagram form can be modified by the function.
767- * @param[in,out] plugin_priv Private context set by plugin.
768- * @param[out] skip Flag set to 1 removes the node from printed diagram.
769- * @param[out] flags Override tree-diagram \<flags\> string in the @p node.
770- * @param[out] add_opts Additional tree-diagram \<opts\> string in the @p node which is printed before \<opts\>.
771- * @return LY_ERR value.
772- */
773- typedef LY_ERR (* lyplg_ext_sprinter_ctree_override_clb )(const struct lysc_node * node , const void * plugin_priv ,
774- ly_bool * skip , const char * * flags , const char * * add_opts );
775-
776- /**
777- * @brief Registration of printing a group of nodes, which is already in the extension.
778- *
779- * @param[in] ctx Context of printer_tree in which the group of nodes is saved and later printed.
780- * @param[in] ext Extension in which the group of nodes will be searched.
781- * @param[in] clb Override function that will be applied to each delivered node.
782- * @return LY_ERR value.
783- */
784- LIBYANG_API_DECL LY_ERR lyplg_ext_sprinter_ctree_add_ext_nodes (const struct lyspr_tree_ctx * ctx ,
785- struct lysc_ext_instance * ext , lyplg_ext_sprinter_ctree_override_clb clb );
786-
787- /**
788- * @brief Registration of printing the group of nodes which were defined in the plugin.
789- *
790- * @param[in] ctx Context of printer_tree in which the group of nodes is saved and later printed.
791- * @param[in] nodes Points to the first node in group.
792- * @param[in] clb Override function that will be applied to each delivered node.
793- * @return LY_ERR value.
794- */
795- LIBYANG_API_DECL LY_ERR lyplg_ext_sprinter_ctree_add_nodes (const struct lyspr_tree_ctx * ctx , struct lysc_node * nodes ,
796- lyplg_ext_sprinter_ctree_override_clb clb );
797-
798- /**
799- * @brief Registration of plugin-private data defined by the plugin that is shared between override_clb calls.
800- *
801- * @param[in] ctx Context of printer_tree in which plugin-private data will be saved.
802- * @param[in] plugin_priv Plugin-private data shared between oberride_clb calls.
803- * @param[in] free_clb Release function for @p plugin_priv.
804- * @return LY_ERR value.
805- */
806- LIBYANG_API_DECL LY_ERR lyplg_ext_sprinter_tree_set_priv (const struct lyspr_tree_ctx * ctx , void * plugin_priv ,
807- void (* free_clb )(void * plugin_priv ));
808-
809- /**
810- * @copydoc lyplg_ext_sprinter_ctree_clb
811- */
812- typedef LY_ERR (* lyplg_ext_sprinter_ptree_clb )(struct lysp_ext_instance * ext , const struct lyspr_tree_ctx * ctx ,
813- const char * * flags , const char * * add_opts );
814-
815- /**
816- * @copydoc lyplg_ext_sprinter_ctree_override_clb
817- */
818- typedef LY_ERR (* lyplg_ext_sprinter_ptree_override_clb )(const struct lysp_node * node , const void * plugin_priv ,
819- ly_bool * skip , const char * * flags , const char * * add_opts );
820-
821- /**
822- * @copydoc lyplg_ext_sprinter_ctree_add_ext_nodes
823- */
824- LIBYANG_API_DECL LY_ERR lyplg_ext_sprinter_ptree_add_ext_nodes (const struct lyspr_tree_ctx * ctx ,
825- struct lysp_ext_instance * ext , lyplg_ext_sprinter_ptree_override_clb clb );
826-
827- /**
828- * @copydoc lyplg_ext_sprinter_ctree_add_nodes
829- */
830- LIBYANG_API_DECL LY_ERR lyplg_ext_sprinter_ptree_add_nodes (const struct lyspr_tree_ctx * ctx , struct lysp_node * nodes ,
831- lyplg_ext_sprinter_ptree_override_clb clb );
832-
833- /** @} pluginsExtensionsSprinterTree */
834-
835725/*
836726 * node xpath
837727 */
@@ -1077,8 +967,6 @@ struct lyplg_ext {
1077967 lyplg_ext_parse_clb parse ; /**< callback to parse the extension instance substatements */
1078968 lyplg_ext_compile_clb compile ; /**< callback to compile extension instance from the parsed data */
1079969 lyplg_ext_sprinter_info_clb printer_info ; /**< callback to print the compiled content (info format) */
1080- lyplg_ext_sprinter_ctree_clb printer_ctree ; /**< callback to print tree format of a compiled node */
1081- lyplg_ext_sprinter_ptree_clb printer_ptree ; /**< callback to print tree format of a parsed node */
1082970 lyplg_ext_node_xpath_clb node_xpath ; /**< callback to get first XPath document root data child node */
1083971 lyplg_ext_snode_xpath_clb snode_xpath ; /**< callback to get first XPath document root schema child node */
1084972 lyplg_ext_data_snode_clb snode ; /**< callback to get schema node in various use-cases */
0 commit comments