summaryrefslogtreecommitdiff
path: root/doc/libstddjb/lolstdio.html
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2014-09-18 18:55:44 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2014-09-18 18:55:44 +0000
commit3534b428629be185e096be99e3bd5fdfe32d5544 (patch)
tree210ef3198ed66bc7f7b7bf6a85e4579f455e5a36 /doc/libstddjb/lolstdio.html
downloadskalibs-3534b428629be185e096be99e3bd5fdfe32d5544.tar.xz
initial commit with rc for skalibs-2.0.0.0
Diffstat (limited to 'doc/libstddjb/lolstdio.html')
-rw-r--r--doc/libstddjb/lolstdio.html91
1 files changed, 91 insertions, 0 deletions
diff --git a/doc/libstddjb/lolstdio.html b/doc/libstddjb/lolstdio.html
new file mode 100644
index 0000000..e059f24
--- /dev/null
+++ b/doc/libstddjb/lolstdio.html
@@ -0,0 +1,91 @@
+<html>
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta http-equiv="Content-Language" content="en" />
+ <title>skalibs: the lolstdio library interface</title>
+ <meta name="Description" content="skalibs: the lolstdio library interface" />
+ <meta name="Keywords" content="skalibs c unix stdio lol printf fprintf library libstddjb" />
+ <!-- <link rel="stylesheet" type="text/css" href="http://skarnet.org/default.css" /> -->
+ </head>
+<body>
+
+<p>
+<a href="index.html">libstddjb</a><br />
+<a href="../libskarnet.html">libskarnet</a><br />
+<a href="../index.html">skalibs</a><br />
+<a href="http://skarnet.org/software/">Software</a><br />
+<a href="http://skarnet.org/">skarnet.org</a>
+</p>
+
+<h1> The <tt>lolstdio</tt> library interface </h1>
+
+<p>
+ The following functions are declared in the <tt>skalibs/lolstdio.h</tt> header,
+and implemented in the <tt>libskarnet.a</tt> or <tt>libskarnet.so</tt> library.
+</p>
+
+<h2> General information </h2>
+
+<p>
+ <tt>lolstdio</tt> is a set of convenience functions providing
+<a href="http://pubs.opengroup.org/onlinepubs/9699919799/functions/printf.html">printf</a>-style
+formatting but interacting with <a href="buffer.html">buffers</a> or
+<a href="bufalloc.html">bufallocs</a> instead of stdio FILEs.
+</p>
+
+<p>
+ Like any printf-style functions, the lolstdio functions are rather
+complex and inefficient, and not recommended for general use; they are
+provided as a quick and dirty way to debug or test things. Programmers
+are advised to use the <a href="fmtscan.html">type-specific formatting
+functions</a> instead in production-quality code.
+</p>
+
+<p>
+ Be aware that functions writing into buffers interact badly with
+non-blocking fds (and asynchronism in general) - just as you cannot
+use FILEs with non-blocking output. Functions writing into bufallocs,
+however, are fine, because bufallocs are much more suited to asynchronous
+writing than fixed-size buffers or FILEs are.
+</p>
+
+<p>
+ The current lolstdio implementation relies on the libc's
+<a href="http://pubs.opengroup.org/onlinepubs/9699919799/functions/vsnprintf.html">vsnprintf</a>
+function.
+</p>
+
+<h2> Functions </h2>
+
+<p>
+<code> int vbprintf (buffer *b, char const *format, va_list args) </code> <br />
+Like <a href="http://pubs.opengroup.org/onlinepubs/9699919799/functions/vfprintf.html">vfprintf</a>
+except that the result is written to the buffer <em>b</em>.
+</p>
+
+<p>
+<code> int bprintf (buffer *b, char const *format, ...) </code> <br />
+Like <a href="http://pubs.opengroup.org/onlinepubs/9699919799/functions/fprintf.html">fprintf</a>
+except that the result is written to the buffer <em>b</em>.
+</p>
+
+<p>
+<code> int lolprintf (char const *format, ...) </code> <br />
+Like <a href="http://pubs.opengroup.org/onlinepubs/9699919799/functions/printf.html">printf</a>
+except that the result is written to the buffer <tt>buffer_1</tt>.
+</p>
+
+<p>
+<code> int vbaprintf (bufalloc *ba, char const *format, va_list args) </code> <br />
+Like <a href="http://pubs.opengroup.org/onlinepubs/9699919799/functions/vfprintf.html">vfprintf</a>
+except that the result is written to the bufalloc <em>ba</em>.
+</p>
+
+<p>
+<code> int baprintf (bufalloc *ba, char const *format, ...) </code> <br />
+Like <a href="http://pubs.opengroup.org/onlinepubs/9699919799/functions/fprintf.html">fprintf</a>
+except that the result is written to the bufalloc <em>ba</em>.
+</p>
+
+</body>
+</html>