annotate docs/ccguide/setbuf.refentry @ 527:10d95ea9f140

Finished these entries
author roug
date Fri, 11 Oct 2002 19:11:01 +0000
parents 60b821f18853
children 032365886652
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
466
bea58398bb15 Skeletons for the C Compiler User's Guide, 1983
roug
parents:
diff changeset
1 <refentry id="setbuf">
bea58398bb15 Skeletons for the C Compiler User's Guide, 1983
roug
parents:
diff changeset
2 <refnamediv>
527
10d95ea9f140 Finished these entries
roug
parents: 468
diff changeset
3 <refname>Setbuf</refname>
10d95ea9f140 Finished these entries
roug
parents: 468
diff changeset
4 <refpurpose>fix file buffer</refpurpose>
466
bea58398bb15 Skeletons for the C Compiler User's Guide, 1983
roug
parents:
diff changeset
5 </refnamediv>
bea58398bb15 Skeletons for the C Compiler User's Guide, 1983
roug
parents:
diff changeset
6
bea58398bb15 Skeletons for the C Compiler User's Guide, 1983
roug
parents:
diff changeset
7 <refsynopsisdiv>
bea58398bb15 Skeletons for the C Compiler User's Guide, 1983
roug
parents:
diff changeset
8 <funcsynopsis>
468
60b821f18853 A little here and there.
roug
parents: 466
diff changeset
9 <funcsynopsisinfo>
60b821f18853 A little here and there.
roug
parents: 466
diff changeset
10 #include &lt;stdio.h&gt;
60b821f18853 A little here and there.
roug
parents: 466
diff changeset
11 </funcsynopsisinfo>
466
bea58398bb15 Skeletons for the C Compiler User's Guide, 1983
roug
parents:
diff changeset
12 <funcprototype>
bea58398bb15 Skeletons for the C Compiler User's Guide, 1983
roug
parents:
diff changeset
13 <funcdef><function>setbuf</function></funcdef>
527
10d95ea9f140 Finished these entries
roug
parents: 468
diff changeset
14 <paramdef>FILE *<parameter>fp</parameter></paramdef>
10d95ea9f140 Finished these entries
roug
parents: 468
diff changeset
15 <paramdef>char *<parameter>buffer</parameter></paramdef>
466
bea58398bb15 Skeletons for the C Compiler User's Guide, 1983
roug
parents:
diff changeset
16 </funcprototype>
bea58398bb15 Skeletons for the C Compiler User's Guide, 1983
roug
parents:
diff changeset
17 </funcsynopsis>
bea58398bb15 Skeletons for the C Compiler User's Guide, 1983
roug
parents:
diff changeset
18
bea58398bb15 Skeletons for the C Compiler User's Guide, 1983
roug
parents:
diff changeset
19 </refsynopsisdiv>
bea58398bb15 Skeletons for the C Compiler User's Guide, 1983
roug
parents:
diff changeset
20
bea58398bb15 Skeletons for the C Compiler User's Guide, 1983
roug
parents:
diff changeset
21 <refsect1><title>Description</title>
bea58398bb15 Skeletons for the C Compiler User's Guide, 1983
roug
parents:
diff changeset
22 <para>
527
10d95ea9f140 Finished these entries
roug
parents: 468
diff changeset
23 When the first character is written to or read from a file
10d95ea9f140 Finished these entries
roug
parents: 468
diff changeset
24 after it has been opened by "fopen()", a buffer is obtained
10d95ea9f140 Finished these entries
roug
parents: 468
diff changeset
25 from the system if required and assigned to it. Setbuf may be
10d95ea9f140 Finished these entries
roug
parents: 468
diff changeset
26 used to forestall this by assigning a user buffer to the file.
10d95ea9f140 Finished these entries
roug
parents: 468
diff changeset
27 </para>
10d95ea9f140 Finished these entries
roug
parents: 468
diff changeset
28 <para>
10d95ea9f140 Finished these entries
roug
parents: 468
diff changeset
29 Setbuf must be used after the file has been opened and before
10d95ea9f140 Finished these entries
roug
parents: 468
diff changeset
30 any I/O has taken place.
10d95ea9f140 Finished these entries
roug
parents: 468
diff changeset
31 </para>
10d95ea9f140 Finished these entries
roug
parents: 468
diff changeset
32 <para>
10d95ea9f140 Finished these entries
roug
parents: 468
diff changeset
33 The buffer must be of sufficient size and a value for a
10d95ea9f140 Finished these entries
roug
parents: 468
diff changeset
34 manifest constant, BUFSIZ, is defined in the header file for
10d95ea9f140 Finished these entries
roug
parents: 468
diff changeset
35 use in declarations.
10d95ea9f140 Finished these entries
roug
parents: 468
diff changeset
36 </para>
10d95ea9f140 Finished these entries
roug
parents: 468
diff changeset
37 <para>
10d95ea9f140 Finished these entries
roug
parents: 468
diff changeset
38 If the "buffer" argument is NULL (0), the file becomes unbuffered
10d95ea9f140 Finished these entries
roug
parents: 468
diff changeset
39 and characters are read or written singly.
10d95ea9f140 Finished these entries
roug
parents: 468
diff changeset
40 </para>
10d95ea9f140 Finished these entries
roug
parents: 468
diff changeset
41 <para>
10d95ea9f140 Finished these entries
roug
parents: 468
diff changeset
42 NOTE that the standard error output is unbuffered and the
10d95ea9f140 Finished these entries
roug
parents: 468
diff changeset
43 standard output is buffered.
10d95ea9f140 Finished these entries
roug
parents: 468
diff changeset
44 </para>
10d95ea9f140 Finished these entries
roug
parents: 468
diff changeset
45 </refsect1>
10d95ea9f140 Finished these entries
roug
parents: 468
diff changeset
46 <refsect1><title>See Also</title>
10d95ea9f140 Finished these entries
roug
parents: 468
diff changeset
47 <para>
10d95ea9f140 Finished these entries
roug
parents: 468
diff changeset
48 fopen(),getc(),putc()
466
bea58398bb15 Skeletons for the C Compiler User's Guide, 1983
roug
parents:
diff changeset
49 </para>
bea58398bb15 Skeletons for the C Compiler User's Guide, 1983
roug
parents:
diff changeset
50 </refsect1>
bea58398bb15 Skeletons for the C Compiler User's Guide, 1983
roug
parents:
diff changeset
51 </refentry>
527
10d95ea9f140 Finished these entries
roug
parents: 468
diff changeset
52 </refentry>