getc.3 (58f0484fa251c266ede97b591b499fe3dd4f578e) getc.3 (926bb1cf42949a3ae717ceef3054910fa28434e4)
1.\" Copyright (c) 1990, 1991, 1993
2.\" The Regents of the University of California. All rights reserved.
3.\"
4.\" This code is derived from software contributed to Berkeley by
5.\" Chris Torek and the American National Standards Committee X3,
6.\" on Information Processing Systems.
7.\"
8.\" Redistribution and use in source and binary forms, with or without

--- 47 unchanged lines hidden (view full) ---

56.Fn getw "FILE *stream"
57.Sh DESCRIPTION
58The
59.Fn fgetc
60function
61obtains the next input character (if present) from the stream pointed at by
62.Fa stream ,
63or the next character pushed back on the stream via
1.\" Copyright (c) 1990, 1991, 1993
2.\" The Regents of the University of California. All rights reserved.
3.\"
4.\" This code is derived from software contributed to Berkeley by
5.\" Chris Torek and the American National Standards Committee X3,
6.\" on Information Processing Systems.
7.\"
8.\" Redistribution and use in source and binary forms, with or without

--- 47 unchanged lines hidden (view full) ---

56.Fn getw "FILE *stream"
57.Sh DESCRIPTION
58The
59.Fn fgetc
60function
61obtains the next input character (if present) from the stream pointed at by
62.Fa stream ,
63or the next character pushed back on the stream via
64.Xr ungetc .
64.Xr ungetc 3 .
65.Pp
66The
67.Fn getc
68function
69acts essentially identically to
70.Fn fgetc ,
71but is a macro that expands in-line.
72.Pp

--- 25 unchanged lines hidden (view full) ---

98must be used to distinguish between end-of-file and error.
99If an error occurs, the global variable
100.Va errno
101is set to indicate the error.
102The end-of-file condition is remembered, even on a terminal, and all
103subsequent attempts to read will return
104.Dv EOF
105until the condition is cleared with
65.Pp
66The
67.Fn getc
68function
69acts essentially identically to
70.Fn fgetc ,
71but is a macro that expands in-line.
72.Pp

--- 25 unchanged lines hidden (view full) ---

98must be used to distinguish between end-of-file and error.
99If an error occurs, the global variable
100.Va errno
101is set to indicate the error.
102The end-of-file condition is remembered, even on a terminal, and all
103subsequent attempts to read will return
104.Dv EOF
105until the condition is cleared with
106.Xr clearerr .
106.Xr clearerr 3 .
107.Sh SEE ALSO
108.Xr ferror 3 ,
109.Xr fread 3 ,
110.Xr fopen 3 ,
111.Xr putc 3 ,
112.Xr ungetc 3
113.Sh STANDARDS
114The
115.Fn fgetc ,
116.Fn getc
117and
118.Fn getchar
119functions
120conform to
121.St -ansiC .
122.Sh BUGS
123Since
124.Dv EOF
125is a valid integer value,
107.Sh SEE ALSO
108.Xr ferror 3 ,
109.Xr fread 3 ,
110.Xr fopen 3 ,
111.Xr putc 3 ,
112.Xr ungetc 3
113.Sh STANDARDS
114The
115.Fn fgetc ,
116.Fn getc
117and
118.Fn getchar
119functions
120conform to
121.St -ansiC .
122.Sh BUGS
123Since
124.Dv EOF
125is a valid integer value,
126.Xr feof
126.Xr feof 3
127and
127and
128.Xr ferror
128.Xr ferror 3
129must be used to check for failure after calling
130.Fn getw .
131The size and byte order of an
132.Em int
133varies from one machine to another, and
134.Fn getw
135is not recommended for portable applications.
136.Pp
129must be used to check for failure after calling
130.Fn getw .
131The size and byte order of an
132.Em int
133varies from one machine to another, and
134.Fn getw
135is not recommended for portable applications.
136.Pp