OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [newlib/] [newlib/] [libc/] [stdio/] [fgetc.c] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 39 lampret
/*
2
FUNCTION
3
<<fgetc>>---get a character from a file or stream
4
 
5
INDEX
6
        fgetc
7
 
8
ANSI_SYNOPSIS
9
        #include <stdio.h>
10
        int fgetc(FILE *<[fp]>);
11
 
12
TRAD_SYNOPSIS
13
        #include <stdio.h>
14
        int fgetc(<[fp]>)
15
        FILE *<[fp]>;
16
 
17
DESCRIPTION
18
Use <<fgetc>> to get the next single character from the file or stream
19
identified by <[fp]>.  As a side effect, <<fgetc>> advances the file's
20
current position indicator.
21
 
22
For a macro version of this function, see <<getc>>.
23
 
24
RETURNS
25
The next character (read as an <<unsigned char>>, and cast to
26
<<int>>), unless there is no more data, or the host system reports a
27
read error; in either of these situations, <<fgetc>> returns <<EOF>>.
28
 
29
You can distinguish the two situations that cause an <<EOF>> result by
30
using the <<ferror>> and <<feof>> functions.
31
 
32
PORTABILITY
33
ANSI C requires <<fgetc>>.
34
 
35
Supporting OS subroutines required: <<close>>, <<fstat>>, <<isatty>>,
36
<<lseek>>, <<read>>, <<sbrk>>, <<write>>.
37
*/
38
 
39
#include <stdio.h>
40
 
41
int
42
_DEFUN (fgetc, (fp),
43
        FILE * fp)
44
{
45
  return __sgetc (fp);
46
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.