libyang  2.0.164
libyang is YANG data modelling language parser and toolkit written (and providing API) in C.
printer_schema.h
Go to the documentation of this file.
1 
15 #ifndef LY_PRINTER_SCHEMA_H_
16 #define LY_PRINTER_SCHEMA_H_
17 
18 #include <stdint.h>
19 #include <stdio.h>
20 
21 #include "log.h"
22 #include "out.h"
23 
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27 
28 struct ly_out;
29 struct lys_module;
30 struct lysc_node;
31 struct lysp_submodule;
32 
95 #define LYS_PRINT_SHRINK LY_PRINT_SHRINK
96 #define LYS_PRINT_NO_SUBSTMT 0x10
98 // #define LYS_PRINT_TREE_RFC 0x01
99 // #define LYS_PRINT_TREE_GROUPING 0x02
100 // #define LYS_PRINT_TREE_USES 0x04
101 // #define LYS_PRINT_TREE_NO_LEAFREF 0x08
108 typedef enum {
113  LYS_OUT_TREE
115 
126 LIBYANG_API_DECL LY_ERR lys_print_module(struct ly_out *out, const struct lys_module *module, LYS_OUTFORMAT format, size_t line_length,
127  uint32_t options);
128 
139 LIBYANG_API_DECL LY_ERR lys_print_submodule(struct ly_out *out, const struct lysp_submodule *submodule, LYS_OUTFORMAT format,
140  size_t line_length, uint32_t options);
141 
155 LIBYANG_API_DECL LY_ERR lys_print_mem(char **strp, const struct lys_module *module, LYS_OUTFORMAT format, uint32_t options);
156 
169 LIBYANG_API_DECL LY_ERR lys_print_fd(int fd, const struct lys_module *module, LYS_OUTFORMAT format, uint32_t options);
170 
183 LIBYANG_API_DECL LY_ERR lys_print_file(FILE *f, const struct lys_module *module, LYS_OUTFORMAT format, uint32_t options);
184 
197 LIBYANG_API_DECL LY_ERR lys_print_path(const char *path, const struct lys_module *module, LYS_OUTFORMAT format, uint32_t options);
198 
212 LIBYANG_API_DECL LY_ERR lys_print_clb(ly_write_clb writeclb, void *user_data,
213  const struct lys_module *module, LYS_OUTFORMAT format, uint32_t options);
214 
225 LIBYANG_API_DECL LY_ERR lys_print_node(struct ly_out *out, const struct lysc_node *node, LYS_OUTFORMAT format, size_t line_length, uint32_t options);
226 
229 #ifdef __cplusplus
230 }
231 #endif
232 
233 #endif /* LY_PRINTER_SCHEMA_H_ */
LYS_OUTFORMAT
LYS_OUTFORMAT
Schema output formats accepted by libyang printer functions.
Definition: printer_schema.h:108
lys_print_mem
LIBYANG_API_DECL LY_ERR lys_print_mem(char **strp, const struct lys_module *module, LYS_OUTFORMAT format, uint32_t options)
Print schema tree in the specified format into a memory block. It is up to caller to free the returne...
ly_out
Printer output structure specifying where the data are printed.
lys_print_file
LIBYANG_API_DECL LY_ERR lys_print_file(FILE *f, const struct lys_module *module, LYS_OUTFORMAT format, uint32_t options)
Print schema tree in the specified format into a file stream.
lysc_node
Compiled YANG data node.
Definition: tree_schema.h:1650
lys_print_clb
LIBYANG_API_DECL LY_ERR lys_print_clb(ly_write_clb writeclb, void *user_data, const struct lys_module *module, LYS_OUTFORMAT format, uint32_t options)
Print schema tree in the specified format using a provided callback.
LYS_OUT_YANG_COMPILED
@ LYS_OUT_YANG_COMPILED
Definition: printer_schema.h:111
lys_module
Available YANG schema tree structures representing YANG module.
Definition: tree_schema.h:2339
lys_print_submodule
LIBYANG_API_DECL LY_ERR lys_print_submodule(struct ly_out *out, const struct lysp_submodule *submodule, LYS_OUTFORMAT format, size_t line_length, uint32_t options)
Schema submodule printer.
LYS_OUT_YANG
@ LYS_OUT_YANG
Definition: printer_schema.h:110
LYS_OUT_YIN
@ LYS_OUT_YIN
Definition: printer_schema.h:112
lysp_submodule
Definition: tree_schema.h:1343
lys_print_node
LIBYANG_API_DECL LY_ERR lys_print_node(struct ly_out *out, const struct lysc_node *node, LYS_OUTFORMAT format, size_t line_length, uint32_t options)
Schema node printer.
log.h
Logger manipulation routines and error definitions.
LYS_OUT_UNKNOWN
@ LYS_OUT_UNKNOWN
Definition: printer_schema.h:109
lys_print_path
LIBYANG_API_DECL LY_ERR lys_print_path(const char *path, const struct lys_module *module, LYS_OUTFORMAT format, uint32_t options)
Print schema tree in the specified format into a file.
lys_print_fd
LIBYANG_API_DECL LY_ERR lys_print_fd(int fd, const struct lys_module *module, LYS_OUTFORMAT format, uint32_t options)
Print schema tree in the specified format into a file descriptor.
LY_ERR
LY_ERR
libyang's error codes returned by the libyang functions.
Definition: log.h:244
lys_print_module
LIBYANG_API_DECL LY_ERR lys_print_module(struct ly_out *out, const struct lys_module *module, LYS_OUTFORMAT format, size_t line_length, uint32_t options)
Schema module printer.
LYS_OUT_TREE
@ LYS_OUT_TREE
Definition: printer_schema.h:113
ly_write_clb
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:133
out.h
libyang output structures and functions