libyang 3.13.5
libyang is YANG data modelling language parser and toolkit written (and providing API) in C.
Loading...
Searching...
No Matches
printer_data.h
Go to the documentation of this file.
1
16#ifndef LY_PRINTER_DATA_H_
17#define LY_PRINTER_DATA_H_
18
19#include <stdint.h>
20#include <stdio.h>
21
22#include "log.h"
23#include "out.h"
24#include "tree_data.h"
25
26#ifdef __cplusplus
27extern "C" {
28#endif
29
30struct ly_out;
31
78#define LYD_PRINT_WITHSIBLINGS 0x01
80#define LYD_PRINT_SHRINK LY_PRINT_SHRINK
81#define LYD_PRINT_KEEPEMPTYCONT 0x04
82#define LYD_PRINT_WD_MASK 0xF0
83#define LYD_PRINT_WD_EXPLICIT 0x00
87#define LYD_PRINT_WD_TRIM 0x10
89#define LYD_PRINT_WD_ALL 0x20
91#define LYD_PRINT_WD_ALL_TAG 0x40
96#define LYD_PRINT_WD_IMPL_TAG 0x80
113LIBYANG_API_DECL LY_ERR lyd_print_all(struct ly_out *out, const struct lyd_node *root, LYD_FORMAT format, uint32_t options);
114
124LIBYANG_API_DECL LY_ERR lyd_print_tree(struct ly_out *out, const struct lyd_node *root, LYD_FORMAT format, uint32_t options);
125
135LIBYANG_API_DECL LY_ERR lyd_print_mem(char **strp, const struct lyd_node *root, LYD_FORMAT format, uint32_t options);
136
146LIBYANG_API_DECL LY_ERR lyd_print_fd(int fd, const struct lyd_node *root, LYD_FORMAT format, uint32_t options);
147
157LIBYANG_API_DECL LY_ERR lyd_print_file(FILE *f, const struct lyd_node *root, LYD_FORMAT format, uint32_t options);
158
168LIBYANG_API_DECL LY_ERR lyd_print_path(const char *path, const struct lyd_node *root, LYD_FORMAT format, uint32_t options);
169
180LIBYANG_API_DECL LY_ERR lyd_print_clb(ly_write_clb writeclb, void *user_data, const struct lyd_node *root,
181 LYD_FORMAT format, uint32_t options);
182
191LIBYANG_API_DECL ly_bool lyd_node_should_print(const struct lyd_node *node, uint32_t options);
192
200LIBYANG_API_DECL ly_bool lyd_metadata_should_print(const struct lyd_meta *meta);
201
202#ifdef __cplusplus
203}
204#endif
205
206#endif /* LY_PRINTER_DATA_H_ */
LYD_FORMAT
Data input/output formats supported by libyang parser and printer functions.
Definition tree_data.h:539
LY_ERR
libyang's error codes returned by the libyang functions.
Definition log.h:237
ssize_t(* ly_write_clb)(void *user_data, const void *buf, size_t count)
Generic write callback for data printed by libyang.
Definition out.h:147
Printer output structure specifying the type of data output.
Logger manipulation routines and error definitions.
uint8_t ly_bool
Type to indicate boolean value.
Definition log.h:35
Metadata structure.
Definition metadata.h:36
libyang output structures and functions
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.
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.
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.
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.
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.
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.
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.
LIBYANG_API_DECL ly_bool lyd_metadata_should_print(const struct lyd_meta *meta)
Check whether the metadata should be printed.
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.
libyang representation of YANG data trees.
Generic structure for a data node.
Definition tree_data.h:795