Data printers for libyang.
More...
#include <stdint.h>
#include <stdio.h>
#include "log.h"
#include "out.h"
#include "tree_data.h"
Go to the source code of this file.
|
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.
- Author
- Radek Krejci rkrej.nosp@m.ci@c.nosp@m.esnet.nosp@m..cz
-
Michal Vasko mvask.nosp@m.o@ce.nosp@m.snet..nosp@m.cz Copyright (c) 2015 - 2025 CESNET, z.s.p.o.
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.
LIBYANG_API_DECL ly_bool lyd_metadata_should_print |
( |
const struct lyd_meta * |
meta | ) |
|
Check whether the metadata should be printed.
- Parameters
-
[in] | meta | Metadata to check. |
- Returns
- 0 if not,
-
non-0 if should be printed.
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.
- Parameters
-
- Returns
- 0 if not,
-
non-0 if should be printed.
Print the whole data tree of the root, including all the siblings.
- Parameters
-
[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. |
- Returns
- LY_ERR value.
Print data tree in the specified format.
- Parameters
-
[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. |
- Returns
- LY_ERR value.
Print data tree in the specified format.
- Parameters
-
[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. |
- Returns
- LY_ERR value.
Print data tree in the specified format.
- Parameters
-
[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. |
- Returns
- LY_ERR value.
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.
- Parameters
-
[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. |
- Returns
- LY_ERR value.
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.
- Parameters
-
[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. |
- Returns
- LY_ERR value.
Print the selected data subtree.
- Parameters
-
[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. |
- Returns
- LY_ERR value.