__vprintf.html 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <html>
  2. <head>
  3. <title>__vprintf</title>
  4. <body bgcolor=#ffffff>
  5. <h2 align=center>__vprintf</h2>
  6. <h4 align=center>OS/161 Reference Manual</h4>
  7. <h3>Name</h3>
  8. __vprintf - printf backend
  9. <h3>Library</h3>
  10. Standard C Library (libc, -lc)
  11. <h3>Synopsis</h3>
  12. #include &lt;unistd.h&gt;<br>
  13. <br>
  14. int<br>
  15. __vprintf(void (*<em>func</em>)(void *<em>clientdata</em>,
  16. const char *<em>str</em>,
  17. size_t <em>len</em>),
  18. void *<em>clientdata</em>, const char *<em>format</em>,
  19. va_list)
  20. <h3>Description</h3>
  21. In OS/161, __vprintf is the back-end engine for
  22. <A HREF=printf.html>printf</A> and printf-like functions.
  23. Note that it is not portable - application code should use
  24. <A HREF=snprintf.html>snprintf or vsnprintf</A> when implementing
  25. their own printf-like functions. This documentation is provided for
  26. use when extending OS/161 itself.
  27. <p>
  28. The <em>format</em> and subsequent arguments are treated as described
  29. under <A HREF=printf.html>printf</A>.
  30. <p>
  31. The <em>func</em> argument is called to print text generated by the
  32. formatting process. The <em>clientdata</em> argument is passed
  33. straight through __vprintf to <em>func</em>. The <em>str</em> argument
  34. to func points to some text that is to be printed; the <em>len</em>
  35. argument is the length of that string, which should not be assumed to
  36. be null-terminated.
  37. <p>
  38. The strings passed to <em>func</em> may be small; if printing is
  39. expensive buffering is probably indicated.
  40. <h3>Return Values</h3>
  41. __vprintf returns the number of characters printed.
  42. </body>
  43. </html>