outs for programs using alternae memory allocators:
[unix-history] / usr / src / lib / libc / stdio / putc.3
CommitLineData
3b5c989e 1.\" @(#)putc.3 6.2 (Berkeley) %G%
d71fbdb0 2.\"
01a8d7b9 3.TH PUTC 3S ""
d71fbdb0
KM
4.AT 3
5.SH NAME
6putc, putchar, fputc, putw \- put character or word on a stream
7.SH SYNOPSIS
8.B #include <stdio.h>
9.PP
10.B int putc(c, stream)
11.br
12.B char c;
13.br
14.SM
15.B FILE
16.B *stream;
17.PP
3b5c989e 18.B int putchar(c)
d71fbdb0 19.PP
3b5c989e 20.B int fputc(c, stream)
d71fbdb0
KM
21.br
22.SM
23.B FILE
24.B *stream;
25.PP
3b5c989e 26.B int putw(w, stream)
d71fbdb0
KM
27.br
28.SM
29.B FILE
30.B *stream;
31.SH DESCRIPTION
32.I Putc
33appends the character
34.I c
35to the named output
36.IR stream .
37It returns the character written.
38.PP
2e84d5a7 39.IR Putchar ( c )
d71fbdb0 40is defined as
2e84d5a7
KM
41.IR putc ( c ,
42.BR stdout ).
d71fbdb0
KM
43.PP
44.I Fputc
45behaves like
2e84d5a7 46.IR putc ,
d71fbdb0 47but is a genuine function rather than a macro.
d71fbdb0
KM
48.PP
49.I Putw
2e84d5a7 50appends word (that is,
d71fbdb0
KM
51.BR int )
52.I w
53to the output
54.IR stream .
55It returns the word written.
56.I Putw
57neither assumes nor causes special alignment in the file.
d71fbdb0 58.SH "SEE ALSO"
2e84d5a7
KM
59fopen(3S),
60fclose(3S),
61getc(3S),
62puts(3S),
63printf(3S),
64fread(3S)
d71fbdb0
KM
65.SH DIAGNOSTICS
66These functions return the constant
67.SM
68.B EOF
2e84d5a7
KM
69upon error. Since this is a good integer,
70.IR ferror (3S)
d71fbdb0
KM
71should be used to detect
72.I putw
73errors.
74.SH BUGS
75Because it is implemented as a macro,
76.I putc
77treats a
78.I stream
2e84d5a7
KM
79argument with side effects improperly. In particular
80.IP "putc(c, *f++);"
81.PP
d71fbdb0
KM
82doesn't work sensibly.
83.PP
84Errors can occur long after the call to
2e84d5a7 85.IR putc .