Loading...
Searching...
No Matches
printer_data.h
Go to the documentation of this file.
#ifndef LY_PRINTER_DATA_H_
#define LY_PRINTER_DATA_H_
#include <stdint.h>
#include <stdio.h>
#include "log.h"
#include "out.h"
#include "tree_data.h"
#ifdef __cplusplus
extern "C" {
#endif
struct ly_out;
#define LYD_PRINT_WITHSIBLINGS 0x01
#define LYD_PRINT_SHRINK LY_PRINT_SHRINK
#define LYD_PRINT_KEEPEMPTYCONT 0x04
#define LYD_PRINT_WD_MASK 0xF0
#define LYD_PRINT_WD_EXPLICIT 0x00
#define LYD_PRINT_WD_TRIM 0x10
#define LYD_PRINT_WD_ALL 0x20
#define LYD_PRINT_WD_ALL_TAG 0x40
#define LYD_PRINT_WD_IMPL_TAG 0x80
LIBYANG_API_DECL LY_ERR lyd_print_all(struct ly_out *out, const struct lyd_node *root, LYD_FORMAT format, uint32_t options);
LIBYANG_API_DECL LY_ERR lyd_print_tree(struct ly_out *out, const struct lyd_node *root, LYD_FORMAT format, uint32_t options);
LIBYANG_API_DECL LY_ERR lyd_print_mem(char **strp, const struct lyd_node *root, LYD_FORMAT format, uint32_t options);
LIBYANG_API_DECL LY_ERR lyd_print_fd(int fd, const struct lyd_node *root, LYD_FORMAT format, uint32_t options);
LIBYANG_API_DECL LY_ERR lyd_print_file(FILE *f, const struct lyd_node *root, LYD_FORMAT format, uint32_t options);
LIBYANG_API_DECL LY_ERR lyd_print_path(const char *path, const struct lyd_node *root, LYD_FORMAT format, uint32_t options);
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);
LIBYANG_API_DECL ly_bool lyd_node_should_print(const struct lyd_node *node, uint32_t options);
LIBYANG_API_DECL ly_bool lyd_metadata_should_print(const struct lyd_meta *meta);
#ifdef __cplusplus
}
#endif
#endif /* LY_PRINTER_DATA_H_ */
LYD_FORMAT
LYD_FORMAT
Data input/output formats supported by libyang parser and printer functions.
Definition tree_data.h:539
LY_ERR
LY_ERR
libyang's error codes returned by the libyang functions.
Definition log.h:237
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:147
ly_out
Printer output structure specifying the type of data output.
log.h
Logger manipulation routines and error definitions.
ly_bool
uint8_t ly_bool
Type to indicate boolean value.
Definition log.h:35
lyd_meta
Metadata structure.
Definition metadata.h:36
out.h
libyang output structures and functions
lyd_print_fd
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.
lyd_node_should_print
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.
lyd_print_file
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.
lyd_print_mem
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.
lyd_print_path
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.
lyd_print_tree
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.
lyd_print_all
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.
lyd_metadata_should_print
LIBYANG_API_DECL ly_bool lyd_metadata_should_print(const struct lyd_meta *meta)
Check whether the metadata should be printed.
lyd_print_clb
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.
tree_data.h
libyang representation of YANG data trees.
lyd_node
Generic structure for a data node.
Definition tree_data.h:795