libyang  2.2.8
libyang is YANG data modelling language parser and toolkit written (and providing API) in C.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Plugins: Extensions schema parsed and compiled tree printer support
Collaboration diagram for Plugins: Extensions schema parsed and compiled tree printer support:

Typedefs

typedef LY_ERR(* lyplg_ext_sprinter_ctree_clb )(struct lysc_ext_instance *ext, const struct lyspr_tree_ctx *ctx, const char **flags, const char **add_opts)
 Callback to print parent node of ext or to print the contents of the extension. More...
 
typedef LY_ERR(* lyplg_ext_sprinter_ctree_override_clb )(const struct lysc_node *node, const void *plugin_priv, ly_bool *skip, const char **flags, const char **add_opts)
 Callback for rewriting the tree-diagram form of a specific node. More...
 
typedef LY_ERR(* lyplg_ext_sprinter_ptree_clb )(struct lysp_ext_instance *ext, const struct lyspr_tree_ctx *ctx, const char **flags, const char **add_opts)
 Callback to print parent node of ext or to print the contents of the extension. More...
 
typedef LY_ERR(* lyplg_ext_sprinter_ptree_override_clb )(const struct lysp_node *node, const void *plugin_priv, ly_bool *skip, const char **flags, const char **add_opts)
 Callback for rewriting the tree-diagram form of a specific node. More...
 

Functions

LIBYANG_API_DECL LY_ERR lyplg_ext_sprinter_ctree_add_ext_nodes (const struct lyspr_tree_ctx *ctx, struct lysc_ext_instance *ext, lyplg_ext_sprinter_ctree_override_clb clb)
 Registration of printing a group of nodes, which is already in the extension. More...
 
LIBYANG_API_DECL LY_ERR lyplg_ext_sprinter_ctree_add_nodes (const struct lyspr_tree_ctx *ctx, struct lysc_node *nodes, lyplg_ext_sprinter_ctree_override_clb clb)
 Registration of printing the group of nodes which were defined in the plugin. More...
 
LIBYANG_API_DECL LY_ERR lyplg_ext_sprinter_ptree_add_ext_nodes (const struct lyspr_tree_ctx *ctx, struct lysp_ext_instance *ext, lyplg_ext_sprinter_ptree_override_clb clb)
 Registration of printing a group of nodes, which is already in the extension. More...
 
LIBYANG_API_DECL LY_ERR lyplg_ext_sprinter_ptree_add_nodes (const struct lyspr_tree_ctx *ctx, struct lysp_node *nodes, lyplg_ext_sprinter_ptree_override_clb clb)
 Registration of printing the group of nodes which were defined in the plugin. More...
 
LIBYANG_API_DECL LY_ERR lyplg_ext_sprinter_tree_set_priv (const struct lyspr_tree_ctx *ctx, void *plugin_priv, void(*free_clb)(void *plugin_priv))
 Registration of plugin-private data defined by the plugin that is shared between override_clb calls. More...
 

Detailed Description

Implementing extension plugin schema parsed and compiled tree printer callback.

Typedef Documentation

typedef LY_ERR(* lyplg_ext_sprinter_ctree_clb)(struct lysc_ext_instance *ext, const struct lyspr_tree_ctx *ctx, const char **flags, const char **add_opts)

Callback to print parent node of ext or to print the contents of the extension.

Function is called in two different cases. If the printer_tree needs the tree-diagram form of a parent node, then ctx is set to NULL. In the second case, if printer_tree needs to print the contents of the extension, then ctx is set and function must prepare the nodes that should be printed using the lyplg_ext_sprinter_tree* functions.

Parameters
[in]extExtension instance.
[in,out]ctxContext for the tree printer. Extension contents can be inserted into it by functions lyplg_ext_sprinter_ctree_add_ext_nodes(), lyplg_ext_sprinter_ctree_add_nodes() or by their ptree alternatives. It parameter is set to NULL, then flags and add_opts are used by printer_tree.
[out]flagsOptional override tree-diagram <flags> in a parent node. If ctx is set, ignore this parameter.
[out]add_optsAdditional tree-diagram <opts> string in a parent node which is printed before <opts>. If ctx is set, ignore this parameter.
Returns
LY_ERR value.

Definition at line 748 of file plugins_exts.h.

typedef LY_ERR(* lyplg_ext_sprinter_ctree_override_clb)(const struct lysc_node *node, const void *plugin_priv, ly_bool *skip, const char **flags, const char **add_opts)

Callback for rewriting the tree-diagram form of a specific node.

If this callback is set, then it is called for each node that belongs to the extension instance.

Parameters
[in]nodeNode whose tree-diagram form can be modified by the function.
[in,out]plugin_privPrivate context set by plugin.
[out]skipFlag set to 1 removes the node from printed diagram.
[out]flagsOverride tree-diagram <flags> string in the node.
[out]add_optsAdditional tree-diagram <opts> string in the node which is printed before <opts>.
Returns
LY_ERR value.

Definition at line 763 of file plugins_exts.h.

typedef LY_ERR(* lyplg_ext_sprinter_ptree_clb)(struct lysp_ext_instance *ext, const struct lyspr_tree_ctx *ctx, const char **flags, const char **add_opts)

Callback to print parent node of ext or to print the contents of the extension.

Function is called in two different cases. If the printer_tree needs the tree-diagram form of a parent node, then ctx is set to NULL. In the second case, if printer_tree needs to print the contents of the extension, then ctx is set and function must prepare the nodes that should be printed using the lyplg_ext_sprinter_tree* functions.

Parameters
[in]extExtension instance.
[in,out]ctxContext for the tree printer. Extension contents can be inserted into it by functions lyplg_ext_sprinter_ctree_add_ext_nodes(), lyplg_ext_sprinter_ctree_add_nodes() or by their ptree alternatives. It parameter is set to NULL, then flags and add_opts are used by printer_tree.
[out]flagsOptional override tree-diagram <flags> in a parent node. If ctx is set, ignore this parameter.
[out]add_optsAdditional tree-diagram <opts> string in a parent node which is printed before <opts>. If ctx is set, ignore this parameter.
Returns
LY_ERR value.

Definition at line 802 of file plugins_exts.h.

typedef LY_ERR(* lyplg_ext_sprinter_ptree_override_clb)(const struct lysp_node *node, const void *plugin_priv, ly_bool *skip, const char **flags, const char **add_opts)

Callback for rewriting the tree-diagram form of a specific node.

If this callback is set, then it is called for each node that belongs to the extension instance.

Parameters
[in]nodeNode whose tree-diagram form can be modified by the function.
[in,out]plugin_privPrivate context set by plugin.
[out]skipFlag set to 1 removes the node from printed diagram.
[out]flagsOverride tree-diagram <flags> string in the node.
[out]add_optsAdditional tree-diagram <opts> string in the node which is printed before <opts>.
Returns
LY_ERR value.

Definition at line 808 of file plugins_exts.h.

Function Documentation

LIBYANG_API_DECL LY_ERR lyplg_ext_sprinter_ctree_add_ext_nodes ( const struct lyspr_tree_ctx *  ctx,
struct lysc_ext_instance ext,
lyplg_ext_sprinter_ctree_override_clb  clb 
)

Registration of printing a group of nodes, which is already in the extension.

Parameters
[in]ctxContext of printer_tree in which the group of nodes is saved and later printed.
[in]extExtension in which the group of nodes will be searched.
[in]clbOverride function that will be applied to each delivered node.
Returns
LY_ERR value.
LIBYANG_API_DECL LY_ERR lyplg_ext_sprinter_ctree_add_nodes ( const struct lyspr_tree_ctx *  ctx,
struct lysc_node nodes,
lyplg_ext_sprinter_ctree_override_clb  clb 
)

Registration of printing the group of nodes which were defined in the plugin.

Parameters
[in]ctxContext of printer_tree in which the group of nodes is saved and later printed.
[in]nodesPoints to the first node in group.
[in]clbOverride function that will be applied to each delivered node.
Returns
LY_ERR value.
LIBYANG_API_DECL LY_ERR lyplg_ext_sprinter_ptree_add_ext_nodes ( const struct lyspr_tree_ctx *  ctx,
struct lysp_ext_instance ext,
lyplg_ext_sprinter_ptree_override_clb  clb 
)

Registration of printing a group of nodes, which is already in the extension.

Parameters
[in]ctxContext of printer_tree in which the group of nodes is saved and later printed.
[in]extExtension in which the group of nodes will be searched.
[in]clbOverride function that will be applied to each delivered node.
Returns
LY_ERR value.
LIBYANG_API_DECL LY_ERR lyplg_ext_sprinter_ptree_add_nodes ( const struct lyspr_tree_ctx *  ctx,
struct lysp_node nodes,
lyplg_ext_sprinter_ptree_override_clb  clb 
)

Registration of printing the group of nodes which were defined in the plugin.

Parameters
[in]ctxContext of printer_tree in which the group of nodes is saved and later printed.
[in]nodesPoints to the first node in group.
[in]clbOverride function that will be applied to each delivered node.
Returns
LY_ERR value.
LIBYANG_API_DECL LY_ERR lyplg_ext_sprinter_tree_set_priv ( const struct lyspr_tree_ctx *  ctx,
void *  plugin_priv,
void(*)(void *plugin_priv)  free_clb 
)

Registration of plugin-private data defined by the plugin that is shared between override_clb calls.

Parameters
[in]ctxContext of printer_tree in which plugin-private data will be saved.
[in]plugin_privPlugin-private data shared between oberride_clb calls.
[in]free_clbRelease function for plugin_priv.
Returns
LY_ERR value.