libyang  5.5.3
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
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
27 extern "C" {
28 #endif
29 
30 struct ly_out;
31 
89 #define LYD_PRINT_SIBLINGS 0x01
91 #define LYD_PRINT_SHRINK LY_PRINT_SHRINK
100 #define LYD_PRINT_EMPTY_CONT 0x04
101 #define LYD_PRINT_EMPTY_LEAF_LIST 0x08
103 #define LYD_PRINT_WD_MASK 0xF0
104 #define LYD_PRINT_WD_EXPLICIT 0x00
108 #define LYD_PRINT_WD_TRIM 0x10
110 #define LYD_PRINT_WD_ALL 0x20
112 #define LYD_PRINT_WD_ALL_TAG 0x40
117 #define LYD_PRINT_WD_IMPL_TAG 0x80
121 #define LYD_PRINT_JSON_NO_NESTED_PREFIX 0x0100
141 LIBYANG_API_DECL LY_ERR lyd_print_all(struct ly_out *out, const struct lyd_node *root, LYD_FORMAT format, uint32_t options);
142 
152 LIBYANG_API_DECL LY_ERR lyd_print_tree(struct ly_out *out, const struct lyd_node *root, LYD_FORMAT format, uint32_t options);
153 
163 LIBYANG_API_DECL LY_ERR lyd_print_mem(char **strp, const struct lyd_node *root, LYD_FORMAT format, uint32_t options);
164 
174 LIBYANG_API_DECL LY_ERR lyd_print_fd(int fd, const struct lyd_node *root, LYD_FORMAT format, uint32_t options);
175 
185 LIBYANG_API_DECL LY_ERR lyd_print_file(FILE *f, const struct lyd_node *root, LYD_FORMAT format, uint32_t options);
186 
196 LIBYANG_API_DECL LY_ERR lyd_print_path(const char *path, const struct lyd_node *root, LYD_FORMAT format, uint32_t options);
197 
208 LIBYANG_API_DECL LY_ERR lyd_print_clb(ly_write_clb writeclb, void *user_data, const struct lyd_node *root,
209  LYD_FORMAT format, uint32_t options);
210 
219 LIBYANG_API_DECL ly_bool lyd_node_should_print(const struct lyd_node *node, uint32_t options);
220 
228 LIBYANG_API_DECL ly_bool lyd_metadata_should_print(const struct lyd_meta *meta);
229 
230 #ifdef __cplusplus
231 }
232 #endif
233 
234 #endif /* LY_PRINTER_DATA_H_ */
Generic structure for a data node.
Definition: tree_data.h:783
LY_ERR
libyang&#39;s error codes returned by the libyang functions.
Definition: log.h:255
uint8_t ly_bool
Type to indicate boolean value.
Definition: log.h:29
libyang output structures and functions
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 representation of YANG data trees.
LYD_FORMAT
Data input/output formats supported by libyang parser and printer functions.
Definition: tree_data.h:511
Printer output structure specifying the type of data output.
Metadata structure.
Definition: metadata.h:36
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_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_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.
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
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.
Logger manipulation routines and error definitions.
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_file(FILE *f, const struct lyd_node *root, LYD_FORMAT format, uint32_t options)
Print data tree in the specified format.