libyang
3.7.5
libyang is YANG data modelling language parser and toolkit written (and providing API) in C.
|
Data printers for libyang. More...
Go to the source code of this file.
Macros | |
#define | LYD_PRINT_KEEPEMPTYCONT 0x04 |
#define | LYD_PRINT_SHRINK LY_PRINT_SHRINK |
#define | LYD_PRINT_WD_ALL 0x20 |
#define | LYD_PRINT_WD_ALL_TAG 0x40 |
#define | LYD_PRINT_WD_EXPLICIT 0x00 |
#define | LYD_PRINT_WD_IMPL_TAG 0x80 |
#define | LYD_PRINT_WD_MASK 0xF0 |
#define | LYD_PRINT_WD_TRIM 0x10 |
#define | LYD_PRINT_WITHSIBLINGS 0x01 |
Functions | |
LIBYANG_API_DECL ly_bool | lyd_metadata_should_print (const struct lyd_meta *meta) |
Check whether the metadata should be printed. More... | |
LIBYANG_API_DECL ly_bool | lyd_node_should_print (const struct lyd_node *node, uint32_t options) |
Check whether the node should be printed based on the printing options. More... | |
LIBYANG_API_DECL LY_ERR | lyd_print_all (struct ly_out *out, const struct lyd_node *root, LYD_FORMAT format, uint32_t options) |
Print the whole data tree of the root, including all the siblings. More... | |
LIBYANG_API_DECL LY_ERR | lyd_print_clb (ly_write_clb writeclb, void *user_data, const struct lyd_node *root, LYD_FORMAT format, uint32_t options) |
Print data tree in the specified format. More... | |
LIBYANG_API_DECL LY_ERR | lyd_print_fd (int fd, const struct lyd_node *root, LYD_FORMAT format, uint32_t options) |
Print data tree in the specified format. More... | |
LIBYANG_API_DECL LY_ERR | lyd_print_file (FILE *f, const struct lyd_node *root, LYD_FORMAT format, uint32_t options) |
Print data tree in the specified format. More... | |
LIBYANG_API_DECL LY_ERR | lyd_print_mem (char **strp, const struct lyd_node *root, LYD_FORMAT format, uint32_t options) |
Print data tree in the specified format. More... | |
LIBYANG_API_DECL LY_ERR | lyd_print_path (const char *path, const struct lyd_node *root, LYD_FORMAT format, uint32_t options) |
Print data tree in the specified format. More... | |
LIBYANG_API_DECL LY_ERR | lyd_print_tree (struct ly_out *out, const struct lyd_node *root, LYD_FORMAT format, uint32_t options) |
Print the selected data subtree. More... | |
Data printers for libyang.
This source code is licensed under BSD 3-Clause License (the "License"). You may not use this file except in compliance with the License. You may obtain a copy of the License at
https://opensource.org/licenses/BSD-3-Clause
Definition in file printer_data.h.
Check whether the metadata should be printed.
[in] | meta | Metadata to check. |
Check whether the node should be printed based on the printing options.
[in] | node | Node to check. |
[in] | options | Data printer flags. |
LIBYANG_API_DECL LY_ERR lyd_print_all | ( | struct ly_out * | out, |
const struct lyd_node * | root, | ||
LYD_FORMAT | format, | ||
uint32_t | options | ||
) |
Print the whole data tree of the root, including all the siblings.
[in] | out | Printer handler for a specific output. Use ly_out_*() functions to create and free the handler. |
[in] | root | The root element of the tree to print, can be any sibling. |
[in] | format | Output format. |
[in] | options | Data printer flags except LYD_PRINT_WITHSIBLINGS. |
LIBYANG_API_DECL LY_ERR lyd_print_clb | ( | ly_write_clb | writeclb, |
void * | user_data, | ||
const struct lyd_node * | root, | ||
LYD_FORMAT | format, | ||
uint32_t | options | ||
) |
Print data tree in the specified format.
[in] | writeclb | Callback function to write the data (see write(1)). |
[in] | user_data | Optional caller-specific argument to be passed to the writeclb callback. |
[in] | root | The root element of the (sub)tree to print. |
[in] | format | Output format. |
[in] | options | Data printer flags. |
LIBYANG_API_DECL LY_ERR lyd_print_fd | ( | int | fd, |
const struct lyd_node * | root, | ||
LYD_FORMAT | format, | ||
uint32_t | options | ||
) |
Print data tree in the specified format.
[in] | fd | File descriptor where to print the data. |
[in] | root | The root element of the (sub)tree to print. |
[in] | format | Output format. |
[in] | options | Data printer flags. |
LIBYANG_API_DECL LY_ERR lyd_print_file | ( | FILE * | f, |
const struct lyd_node * | root, | ||
LYD_FORMAT | format, | ||
uint32_t | options | ||
) |
Print data tree in the specified format.
[in] | f | File stream where to print the data. |
[in] | root | The root element of the (sub)tree to print. |
[in] | format | Output format. |
[in] | options | Data printer flags. |
LIBYANG_API_DECL LY_ERR lyd_print_mem | ( | char ** | strp, |
const struct lyd_node * | root, | ||
LYD_FORMAT | format, | ||
uint32_t | options | ||
) |
Print data tree in the specified format.
[out] | strp | Pointer to store the resulting dump. |
[in] | root | The root element of the (sub)tree to print. |
[in] | format | Output format. |
[in] | options | Data printer flags. |
LIBYANG_API_DECL LY_ERR lyd_print_path | ( | const char * | path, |
const struct lyd_node * | root, | ||
LYD_FORMAT | format, | ||
uint32_t | options | ||
) |
Print data tree in the specified format.
[in] | path | File path where to print the data. |
[in] | root | The root element of the (sub)tree to print. |
[in] | format | Output format. |
[in] | options | Data printer flags. |
LIBYANG_API_DECL LY_ERR lyd_print_tree | ( | struct ly_out * | out, |
const struct lyd_node * | root, | ||
LYD_FORMAT | format, | ||
uint32_t | options | ||
) |
Print the selected data subtree.
[in] | out | Printer handler for a specific output. Use ly_out_*() functions to create and free the handler. |
[in] | root | The root element of the subtree to print. |
[in] | format | Output format. |
[in] | options | Data printer flags except LYD_PRINT_WITHSIBLINGS. |