Loading...
Searching...
No Matches
Output Processing

libyang provides a mechanism to generalize work with the outputs (and inputs) of the different types. The ly_out handler can be created providing necessary information connected with the specific output type and then used throughout the printers functions. The API allows to combine output from libyang (data or schema) printers and output directly provided by the caller (via ly_print() or ly_write()).

Using a generic output handler avoids need to have a set of functions for each printer functionality and results in simpler API.

The API allows to alter the target of the data behind the handler by another target (of the same type). Also resetting a seekable output is possible with ly_out_reset() to re-write the output.

Note
  This mechanism was introduced in libyang 2.0. To simplify transition from libyang 1.0 to version 2.0 and also for some simple use case where using the output handler would be an overkill, there are some basic printer functions that do not require output handler. But remember, that functionality of these function can be limited in particular cases in contrast to the functions using output handlers.

## Functions List

- ly_out_new_clb()
- ly_out_new_fd()
- ly_out_new_file()
- ly_out_new_filepath()
- ly_out_new_memory()
- ly_out_clb()
- ly_out_clb_arg()
- ly_out_fd()
- ly_out_file()
- ly_out_filepath()
- ly_out_memory()
- ly_out_type()
- ly_out_printed()
- ly_out_printed_total()
- ly_out_reset()
- ly_out_free()
- ly_print()
- ly_print_flush()
- ly_write()

## libyang Printers List

- Module Printers
- Printing Data