📄 fiolib.html
字号:
The argument should be a pointer to an integer into whichthe number of characters written to the output streamso far by this call to <b><a href="./ansiStdio.html#fprintf">fprintf</a>( )</b> is written. No argument is converted.<dt><b>%</b><dd>A <b>%</b> is written. No argument is converted. The completeconversion specification is %%.</dl><p>If a conversion specification is invalid, the behavior is undefined.<p>If any argument is, or points to, a union or an aggregate (except for an array of character type using <b>s</b> conversion, or a pointer using <b>p</b> conversion), the behavior is undefined.<p>In no case does a non-existent or small field width cause truncation of afield if the result of a conversion is wider than the field width, thefield is expanded to contain the conversion result.<p></blockquote><h4>INCLUDE FILES</h4><blockquote><p><b>fioLib.h</b> <p></blockquote><h4>RETURNS</h4><blockquote><p><p>The number of characters written, or a negative value if anoutput error occurs.<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./fioLib.html#top">fioLib</a></b>, <b><a href="./ansiStdio.html#fprintf">fprintf</a>( )</b>, <i>American National Standard for Information Systems -</i><i>Programming Language - C, ANSI X3.159-1989: Input/Output (<b>stdio.h</b>)</i><p>VARARGS1<hr><a name="printErr"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>printErr( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>printErr( )</strong> - write a formatted string to the standard error stream</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>int printErr ( const char * fmt, /* format string to write */ ... /* optional arguments to format */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine writes a formatted string to standard error. Its function andsyntax are otherwise identical to <b><a href="./fioLib.html#printf">printf</a>( )</b>.<p></blockquote><h4>RETURNS</h4><blockquote><p>The number of characters output, or ERROR if there is an errorduring output.<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./fioLib.html#top">fioLib</a></b>, <b><a href="./fioLib.html#printf">printf</a>( )</b><p>VARARGS1<hr><a name="fdprintf"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>fdprintf( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>fdprintf( )</strong> - write a formatted string to a file descriptor</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>int fdprintf ( int fd, /* file descriptor to write to */ const char * fmt, /* format string to write */ ... /* optional arguments to format */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine writes a formatted string to a specified file descriptor. Itsfunction and syntax are otherwise identical to <b><a href="./fioLib.html#printf">printf</a>( )</b>.<p></blockquote><h4>RETURNS</h4><blockquote><p>The number of characters output, or ERROR if there is an errorduring output.<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./fioLib.html#top">fioLib</a></b>, <b><a href="./fioLib.html#printf">printf</a>( )</b><p>VARARGS2<hr><a name="sprintf"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>sprintf( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>sprintf( )</strong> - write a formatted string to a buffer (ANSI)</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>int sprintf ( char * buffer, /* buffer to write to */ const char * fmt, /* format string */ ... /* optional arguments to format */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine copies a formatted string to a specified buffer, which isnull-terminated. Its function and syntax are otherwise identicalto <b><a href="./fioLib.html#printf">printf</a>( )</b>.<p></blockquote><h4>RETURNS</h4><blockquote><p><p>The number of characters copied to <i>buffer</i>, not including the NULL terminator.<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./fioLib.html#top">fioLib</a></b>, <b><a href="./fioLib.html#printf">printf</a>( )</b>, <i>American National Standard for Information Systems -</i><i>Programming Language - C, ANSI X3.159-1989: Input/Output (<b>stdio.h</b>)</i><p>VARARGS2<hr><a name="vprintf"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>vprintf( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>vprintf( )</strong> - write a string formatted with a variable argument list to standard output (ANSI)</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>int vprintf ( const char * fmt, /* format string to write */ va_list vaList /* arguments to format */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine prints a string formatted with a variable argument list tostandard output. It is identical to <b><a href="./fioLib.html#printf">printf</a>( )</b>, except that it takesthe variable arguments to be formatted as a list <i>vaList</i> of type <b>va_list</b>rather than as in-line arguments.<p></blockquote><h4>RETURNS</h4><blockquote><p>The number of characters output, or ERROR if there is an errorduring output.<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./fioLib.html#top">fioLib</a></b>, <b><a href="./fioLib.html#printf">printf</a>( )</b>, <i>American National Standard for Information Systems -</i><i>Programming Language - C, ANSI X3.159-1989: Input/Output (<b>stdio.h</b>)</i><hr><a name="vfdprintf"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>vfdprintf( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>vfdprintf( )</strong> - write a string formatted with a variable argument list to a file descriptor</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>int vfdprintf ( int fd, /* file descriptor to print to */ const char * fmt, /* format string for print */ va_list vaList /* optional arguments to format */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine prints a string formatted with a variable argument list to aspecified file descriptor. It is identical to <b><a href="./fioLib.html#fdprintf">fdprintf</a>( )</b>, exceptthat it takes the variable arguments to be formatted as a list <i>vaList</i> oftype <b>va_list</b> rather than as in-line arguments.<p></blockquote><h4>RETURNS</h4><blockquote><p>The number of characters output, or ERROR if there is an errorduring output.<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./fioLib.html#top">fioLib</a></b>, <b><a href="./fioLib.html#fdprintf">fdprintf</a>( )</b><hr><a name="vsprintf"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>vsprintf( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>vsprintf( )</strong> - write a string formatted with a variable argument list to a buffer (ANSI)</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>int vsprintf ( char * buffer, /* buffer to write to */ const char * fmt, /* format string */ va_list vaList /* optional arguments to format */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine copies a string formatted with a variable argument list toa specified buffer. This routine is identical to <b><a href="./fioLib.html#sprintf">sprintf</a>( )</b>, except that ittakes the variable arguments to be formatted as a list <i>vaList</i> of type<b>va_list</b> rather than as in-line arguments.<p></blockquote><h4>RETURNS</h4><blockquote><p><p>The number of characters copied to <i>buffer</i>, not including the NULL terminator.<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./fioLib.html#top">fioLib</a></b>, <b><a href="./fioLib.html#sprintf">sprintf</a>( )</b>, <i>American National Standard for Information Systems -</i><i>Programming Language - C, ANSI X3.159-1989: Input/Output (<b>stdio.h</b>)</i><hr><a name="fioFormatV"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>fioFormatV( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>fioFormatV( )</strong> - convert a format string</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>int fioFormatV ( const char * fmt, /* format string */ va_list vaList, /* pointer to varargs list */ FUNCPTR outRoutine, /* handler for args as they're formatted */ int outarg /* argument to routine */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine is used by the <b><a href="./fioLib.html#printf">printf</a>( )</b> family of routines to handle theactual conversion of a format string. The first argument is a formatstring, as described in the entry for <b><a href="./fioLib.html#printf">printf</a>( )</b>. The second argument is avariable argument list <i>vaList</i> that was previously established.<p>As the format string is processed, the result will be passed to the outputroutine whose address is passed as the third parameter, <i>outRoutine</i>.This output routine may output the result to a device, or put it in abuffer. In addition to the buffer and length to output, the fourthargument, <i>outarg</i>, will be passed through as the third parameter to theoutput routine. This parameter could be a file descriptor, a buffer address, or any other value that can be passed in an "int".<p>The output routine should be declared as follows:<pre> STATUS outRoutine ( char *buffer, /* buffer passed to routine */ int nchars, /* length of buffer */ int outarg /* arbitrary arg passed to fmt routine */ )</pre>The output routine should return OK if successful, or ERROR if unsuccessful.<p></blockquote><h4>RETURNS</h4><blockquote><p><p>The number of characters output, or ERROR if the output routine returned ERROR.<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./fioLib.html#top">fioLib</a></b><hr><a name="fioRead"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>fioRead( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>fioRead( )</strong> - read a buffer</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>int fioRead ( int fd, /* file descriptor of file to read */ char * buffer, /* buffer to receive input */ int maxbytes /* maximum number of bytes to read */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine repeatedly calls the routine <b><a href="./ioLib.html#read">read</a>( )</b> until <i>maxbytes</i> havebeen read into <i>buffer</i>. If EOF is reached, the number of bytes readwill be less than <i>maxbytes</i>.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -