summaryrefslogtreecommitdiff
path: root/libtextstyle/doc
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2019-10-28 01:08:41 +0100
committerBruno Haible <bruno@clisp.org>2019-10-28 01:08:41 +0100
commit332548d266dca59fe80cfb6c1287489b09be4445 (patch)
tree371a0658ee827e8afbaf846a971dc5aedd67936f /libtextstyle/doc
parentdea5a600b909342369a6fe07c67bfdb03bbabf23 (diff)
downloadgettext-332548d266dca59fe80cfb6c1287489b09be4445.tar.gz
libtextstyle: Add ostream_printf, ostream_vprintf functions.
Suggested by José Marchesi. * libtextstyle/autogen.sh (GNULIB_MODULES): Add 'vasprintf-posix'. * libtextstyle/gnulib-local/lib/ostream.oo.h: Include <stdarg.h>. (ostream_printf, ostream_vprintf): New declarations. * libtextstyle/gnulib-local/lib/ostream.oo.c: Include <stdio.h>. (ostream_printf, ostream_vprintf): New functions. * libtextstyle/gnulib-local/lib/styled-ostream.oo.h: Update comments. * libtextstyle/gnulib-local/lib/term-ostream.oo.h: Likewise. * libtextstyle/gnulib-local/lib/html-ostream.oo.h: Likewise. * libtextstyle/lib/textstyle.h: Include <stdio.h>. (ostream_printf, ostream_vprintf): New functions. (styled_ostream_flush_to_current_style, term_ostream_flush_to_current_style, html_ostream_flush_to_current_style): Update comments. * libtextstyle/doc/libtextstyle.texi (The ostream class): Document ostream_printf, ostream_vprintf. (The styled_ostream class, The term_ostream class, The html_ostream class): Update comments. * libtextstyle/NEWS: Mention it. * NEWS: Likewise.
Diffstat (limited to 'libtextstyle/doc')
-rw-r--r--libtextstyle/doc/libtextstyle.texi14
1 files changed, 11 insertions, 3 deletions
diff --git a/libtextstyle/doc/libtextstyle.texi b/libtextstyle/doc/libtextstyle.texi
index f65a0f928..1dd344152 100644
--- a/libtextstyle/doc/libtextstyle.texi
+++ b/libtextstyle/doc/libtextstyle.texi
@@ -853,6 +853,14 @@ Writes a sequence of bytes to a stream.
Writes a string's contents to a stream.
@end deftypefn
+@deftypefn Function ptrdiff_t ostream_printf (ostream_t@tie{}@var{stream}, const@tie{}char@tie{}*@var{format}, ...)
+@deftypefnx Function ptrdiff_t ostream_vprintf (ostream_t@tie{}@var{stream}, const@tie{}char@tie{}*@var{format}, va_list args)
+Writes formatted output to a stream.
+
+These functions return the size of formatted output, or a negative value
+in case of an error.
+@end deftypefn
+
@deftypefn Function void ostream_flush (ostream_t@tie{}@var{stream}, ostream_flush_scope_t@tie{}@var{scope})
Brings buffered data to its destination.
@end deftypefn
@@ -918,7 +926,7 @@ instead of with the default text style.
After calling this function, you can output strings without newlines(!) to the
underlying stream, and they will be rendered like strings passed to
-@code{ostream_write_mem} or @code{ostream_write_str}.
+@code{ostream_write_mem}, @code{ostream_write_str}, or @code{ostream_printf}.
@end deftypefn
@node ostream subclasses without styling
@@ -1062,7 +1070,7 @@ instead of with the default text attributes.
After calling this function, you can output strings without newlines(!) to the
underlying file descriptor, and they will be rendered like strings passed to
-@code{ostream_write_mem} or @code{ostream_write_str}.
+@code{ostream_write_mem}, @code{ostream_write_str}, or @code{ostream_printf}.
@end deftypefn
@node The html_ostream class
@@ -1129,7 +1137,7 @@ instead of with the default text style.
After calling this function, you can output strings without newlines(!) to the
underlying stream, and they will be rendered like strings passed to
-@code{ostream_write_mem} or @code{ostream_write_str}.
+@code{ostream_write_mem}, @code{ostream_write_str}, or @code{ostream_printf}.
@end deftypefn
@node The memory_ostream class