Update contrib.
3 * Portions Copyright (c) 1990-1999 Nokia Corporation and/or its subsidiary(-ies).
8 * Copyright (c) 1990 The Regents of the University of California.
11 * Redistribution and use in source and binary forms are permitted
12 * provided that the above copyright notice and this paragraph are
13 * duplicated in all such forms and that any documentation,
14 * advertising materials, and other materials related to such
15 * distribution and use acknowledge that the software was developed
16 * by the University of California, Berkeley. The name of the
17 * University may not be used to endorse or promote products derived
18 * from this software without specific prior written permission.
19 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
20 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
21 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
26 <<getc>>---read a character (macro)
33 int getc(FILE *<[fp]>);
41 <<getc>> is a macro, defined in <<stdio.h>>. You can use <<getc>>
42 to get the next single character from the file or stream
43 identified by <[fp]>. As a side effect, <<getc>> advances the file's
44 current position indicator.
46 For a subroutine version of this macro, see <<fgetc>>.
49 The next character (read as an <<unsigned char>>, and cast to
50 <<int>>), unless there is no more data, or the host system reports a
51 read error; in either of these situations, <<getc>> returns <<EOF>>.
53 You can distinguish the two situations that cause an <<EOF>> result by
54 using the <<ferror>> and <<feof>> functions.
57 ANSI C requires <<getc>>; it suggests, but does not require, that
58 <<getc>> be implemented as a macro. The standard explicitly permits
59 macro implementations of <<getc>> to use the argument more than once;
60 therefore, in a portable program, you should not use an expression
61 with side effects as the <<getc>> argument.
63 Supporting OS subroutines required: <<close>>, <<fstat>>, <<isatty>>,
64 <<lseek>>, <<read>>, <<sbrk>>, <<write>>.
71 * A subroutine version of the macro getc.
77 Get the next character.
78 Returns the next character of the stream and increases the file pointer
79 to point to the next character.
80 @return The character read is returned as an int value.
81 If the End Of File has been reached or there has been an error reading,
82 the function returns EOF.
83 @param fp pointer to an open file.
86 getc (register FILE *fp)
88 /* CHECK_INIT is called (eventually) by __srefill. */