<html>
<head>
<title>__vprintf</title>
<body bgcolor=#ffffff>
<h2 align=center>__vprintf</h2>
<h4 align=center>OS/161 Reference Manual</h4>

<h3>Name</h3>
__vprintf - printf backend

<h3>Library</h3>
Standard C Library (libc, -lc)

<h3>Synopsis</h3>
#include &lt;unistd.h&gt;<br>
<br>
int<br>
__vprintf(void (*<em>func</em>)(void *<em>clientdata</em>, 
				const char *<em>str</em>, 
				size_t <em>len</em>), 
          void *<em>clientdata</em>, const char *<em>format</em>,
	  va_list)

<h3>Description</h3>

In OS/161, __vprintf is the back-end engine for
<A HREF=printf.html>printf</A> and printf-like functions. 
Note that it is not portable - application code should use 
<A HREF=snprintf.html>snprintf or vsnprintf</A> when implementing
their own printf-like functions. This documentation is provided for
use when extending OS/161 itself.
<p>

The <em>format</em> and subsequent arguments are treated as described
under <A HREF=printf.html>printf</A>.
<p>

The <em>func</em> argument is called to print text generated by the
formatting process. The <em>clientdata</em> argument is passed
straight through __vprintf to <em>func</em>. The <em>str</em> argument
to func points to some text that is to be printed; the <em>len</em>
argument is the length of that string, which should not be assumed to
be null-terminated.
<p>

The strings passed to <em>func</em> may be small; if printing is
expensive buffering is probably indicated.

<h3>Return Values</h3>
__vprintf returns the number of characters printed.

</body>
</html>