~ubuntu-branches/ubuntu/precise/manpages-posix/precise

1 by Francesco Paolo Lovergine
rules: linking manpages-posix not manpages.
1
.\" Copyright (c) 2001-2003 The Open Group, All Rights Reserved 
2 by Francesco Paolo Lovergine
* Alligned to linux main manpages edition.
2
.TH "GETC" P 2003 "IEEE/The Open Group" "POSIX Programmer's Manual"
1 by Francesco Paolo Lovergine
rules: linking manpages-posix not manpages.
3
.\" getc 
4
.SH NAME
5
getc \- get a byte from a stream
6
.SH SYNOPSIS
7
.LP
8
\fB#include <stdio.h>
9
.br
10
.sp
11
int getc(FILE *\fP\fIstream\fP\fB);
12
.br
13
\fP
14
.SH DESCRIPTION
15
.LP
16
The \fIgetc\fP() function shall be equivalent to \fIfgetc\fP() , except
17
that if it is implemented as
18
a macro it may evaluate \fIstream\fP more than once, so the argument
19
should never be an expression with side effects.
20
.SH RETURN VALUE
21
.LP
22
Refer to \fIfgetc\fP() .
23
.SH ERRORS
24
.LP
25
Refer to \fIfgetc\fP() .
26
.LP
27
\fIThe following sections are informative.\fP
28
.SH EXAMPLES
29
.LP
30
None.
31
.SH APPLICATION USAGE
32
.LP
33
If the integer value returned by \fIgetc\fP() is stored into a variable
34
of type \fBchar\fP and then compared against the
35
integer constant EOF, the comparison may never succeed, because sign-extension
36
of a variable of type \fBchar\fP on widening to
37
integer is implementation-defined.
38
.LP
39
Since it may be implemented as a macro, \fIgetc\fP() may treat incorrectly
40
a \fIstream\fP argument with side effects. In
41
particular, \fIgetc\fP(*\fIf\fP++) does not necessarily work as expected.
42
Therefore, use of this function should be preceded by
43
\fB"#undef getc"\fP in such situations; \fIfgetc\fP() could also be
44
used.
45
.SH RATIONALE
46
.LP
47
None.
48
.SH FUTURE DIRECTIONS
49
.LP
50
None.
51
.SH SEE ALSO
52
.LP
53
\fIfgetc\fP() , the Base Definitions volume of IEEE\ Std\ 1003.1-2001,
54
\fI<stdio.h>\fP
55
.SH COPYRIGHT
56
Portions of this text are reprinted and reproduced in electronic form
57
from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology
58
-- Portable Operating System Interface (POSIX), The Open Group Base
59
Specifications Issue 6, Copyright (C) 2001-2003 by the Institute of
60
Electrical and Electronics Engineers, Inc and The Open Group. In the
61
event of any discrepancy between this version and the original IEEE and
62
The Open Group Standard, the original IEEE and The Open Group Standard
63
is the referee document. The original Standard can be obtained online at
64
http://www.opengroup.org/unix/online.html .