Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/out.c
Original file line number Diff line number Diff line change
Expand Up @@ -681,6 +681,12 @@ ly_out_printed(const struct ly_out *out)
return out->func_printed;
}

LIBYANG_API_DEF size_t
ly_out_printed_total(const struct ly_out *out)
{
return out->printed;
}

LY_ERR
ly_write_skip(struct ly_out *out, size_t count, size_t *position)
{
Expand Down
9 changes: 9 additions & 0 deletions src/out.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ extern "C" {
*
* - ::ly_out_type()
* - ::ly_out_printed()
* - ::ly_out_printed_total()
*
* - ::ly_out_reset()
* - ::ly_out_free()
Expand Down Expand Up @@ -291,6 +292,14 @@ LIBYANG_API_DECL LY_ERR ly_write(struct ly_out *out, const char *buf, size_t len
*/
LIBYANG_API_DECL size_t ly_out_printed(const struct ly_out *out);

/**
* @brief Get the total number of printed bytes of this out structure.
*
* @param[in] out Out structure used.
* @return Number of printed bytes.
*/
LIBYANG_API_DECL size_t ly_out_printed_total(const struct ly_out *out);

/**
* @brief Free the printer handler.
* @param[in] out Printer handler to free.
Expand Down