libyang  3.6.0
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_schema.h
Go to the documentation of this file.
1 
16 #ifndef LY_PRINTER_SCHEMA_H_
17 #define LY_PRINTER_SCHEMA_H_
18 
19 #include <stdint.h>
20 #include <stdio.h>
21 
22 #include "log.h"
23 #include "out.h"
24 
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28 
29 struct ly_out;
30 struct lys_module;
31 struct lysc_node;
32 struct lysp_submodule;
33 
96 #define LYS_PRINT_SHRINK LY_PRINT_SHRINK
97 #define LYS_PRINT_NO_SUBSTMT 0x10
105 typedef enum {
112 
123 LIBYANG_API_DECL LY_ERR lys_print_module(struct ly_out *out, const struct lys_module *module, LYS_OUTFORMAT format,
124  size_t line_length, uint32_t options);
125 
136 LIBYANG_API_DECL LY_ERR lys_print_submodule(struct ly_out *out, const struct lysp_submodule *submodule, LYS_OUTFORMAT format,
137  size_t line_length, uint32_t options);
138 
152 LIBYANG_API_DECL LY_ERR lys_print_mem(char **strp, const struct lys_module *module, LYS_OUTFORMAT format, uint32_t options);
153 
166 LIBYANG_API_DECL LY_ERR lys_print_fd(int fd, const struct lys_module *module, LYS_OUTFORMAT format, uint32_t options);
167 
180 LIBYANG_API_DECL LY_ERR lys_print_file(FILE *f, const struct lys_module *module, LYS_OUTFORMAT format, uint32_t options);
181 
194 LIBYANG_API_DECL LY_ERR lys_print_path(const char *path, const struct lys_module *module, LYS_OUTFORMAT format,
195  uint32_t options);
196 
210 LIBYANG_API_DECL LY_ERR lys_print_clb(ly_write_clb writeclb, void *user_data, const struct lys_module *module,
211  LYS_OUTFORMAT format, uint32_t options);
212 
223 LIBYANG_API_DECL LY_ERR lys_print_node(struct ly_out *out, const struct lysc_node *node, LYS_OUTFORMAT format,
224  size_t line_length, uint32_t options);
225 
228 #ifdef __cplusplus
229 }
230 #endif
231 
232 #endif /* LY_PRINTER_SCHEMA_H_ */
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.
Printer output structure specifying where the data are printed.
Compiled YANG data node.
Definition: tree_schema.h:1439
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.
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:136
libyang output structures and functions
LYS_OUTFORMAT
Schema output formats accepted by libyang printer functions.
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.
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...
Available YANG schema tree structures representing YANG module.
Definition: tree_schema.h:2131
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.
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.
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.
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.
Logger manipulation routines and error definitions.
LY_ERR
libyang&#39;s error codes returned by the libyang functions.
Definition: log.h:240