|
1 /* |
|
2 * Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * FUNCTION |
|
16 * <<fgetc>>---get a character from a file or stream |
|
17 * INDEX |
|
18 * fgetc |
|
19 * ANSI_SYNOPSIS |
|
20 * #include <stdio.h> |
|
21 * int fgetc(FILE *<[fp]>); |
|
22 * TRAD_SYNOPSIS |
|
23 * #include <stdio.h> |
|
24 * int fgetc(<[fp]>) |
|
25 * FILE *<[fp]>; |
|
26 * Use <<fgetc>> to get the next single character from the file or stream |
|
27 * identified by <[fp]>. As a side effect, <<fgetc>> advances the file's |
|
28 * current position indicator. |
|
29 * For a macro version of this function, see <<getc>>. |
|
30 * RETURNS |
|
31 * The next character (read as an <<unsigned char>>, and cast to |
|
32 * <<int>>), unless there is no more data, or the host system reports a |
|
33 * read error; in either of these situations, <<fgetc>> returns <<EOF>>. |
|
34 * You can distinguish the two situations that cause an <<EOF>> result by |
|
35 * using the <<ferror>> and <<feof>> functions. |
|
36 * PORTABILITY |
|
37 * ANSI C requires <<fgetc>>. |
|
38 * Supporting OS subroutines required: <<close>>, <<fstat>>, <<isatty>>, |
|
39 * <<lseek>>, <<read>>, <<sbrk>>, <<write>>. |
|
40 * |
|
41 * |
|
42 */ |
|
43 |
|
44 |
|
45 |
|
46 #include <stdio.h> |
|
47 #include "LOCAL.H" |
|
48 |
|
49 /** |
|
50 Get the next character from a stream. |
|
51 Returns the next character of the stream and increases the file pointer |
|
52 to point to the following one. |
|
53 @return The character read is returned as an int value. |
|
54 If the End Of File has been reached or there has been an error reading, |
|
55 the function returns EOF. |
|
56 @param fp pointer to an open file. |
|
57 */ |
|
58 EXPORT_C int |
|
59 fgetc (FILE * fp) |
|
60 { |
|
61 return __sgetc (fp); |
|
62 } |