view docs/ccguide/setbuf.refentry @ 2798:b70d93f8d7ce lwtools-port

Updated coco1/modules/makefile and coco3/modules/makefile to help resolve issues with i(x) and s(x) descriptors. Updated level1/coco1/modules/makefile & level2/coco3/modules/makefile so that correct values would be sent to assembler when building superdesc.asm for s(x).dd and i(x).dd descriptors.
author drencor-xeen
date Mon, 28 Jan 2013 16:13:05 -0600
parents 03d745f92340
children
line wrap: on
line source

<refentry id="setbuf">
<refnamediv>
<refname>Setbuf</refname>
<refpurpose>fix file buffer</refpurpose>
</refnamediv>

<refsynopsisdiv>
<funcsynopsis>
<funcsynopsisinfo>
#include &lt;stdio.h&gt;
</funcsynopsisinfo>
<funcprototype>
  <funcdef><function>setbuf</function></funcdef>
  <paramdef>FILE *<parameter>fp</parameter></paramdef>
  <paramdef>char *<parameter>buffer</parameter></paramdef>
</funcprototype>
</funcsynopsis>

</refsynopsisdiv>

<refsect1><title>Description</title>
<para>
When the first character is written to or read from a file
after it has been opened by "fopen()", a buffer is obtained
from the system if required and assigned to it. Setbuf may be
used to forestall this by assigning a user buffer to the file.
</para>
<para>
Setbuf must be used after the file has been opened and before
any I/O has taken place.
</para>
<para>
The buffer must be of sufficient size and a value for a
manifest constant, BUFSIZ, is defined in the header file for
use in declarations.
</para>
<para>
If the "buffer" argument is NULL (0), the file becomes unbuffered
and characters are read or written singly.
</para>
<para>
NOTE that the standard error output is unbuffered and the
standard output is buffered.
</para>
</refsect1>
<refsect1><title>See Also</title>
<para>
<link linkend="fopen">fopen()</link>,
<link linkend="getc">getc()</link>,
<link linkend="putc">putc()</link>
</para>
</refsect1>
</refentry>