1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/ossrv/genericopenlibs/cstdlib/LSTDIO/FGETC.C Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,62 @@
1.4 +/*
1.5 +* Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
1.6 +* All rights reserved.
1.7 +* This component and the accompanying materials are made available
1.8 +* under the terms of "Eclipse Public License v1.0"
1.9 +* which accompanies this distribution, and is available
1.10 +* at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.11 +*
1.12 +* Initial Contributors:
1.13 +* Nokia Corporation - initial contribution.
1.14 +*
1.15 +* Contributors:
1.16 +*
1.17 +* Description:
1.18 +* FUNCTION
1.19 +* <<fgetc>>---get a character from a file or stream
1.20 +* INDEX
1.21 +* fgetc
1.22 +* ANSI_SYNOPSIS
1.23 +* #include <stdio.h>
1.24 +* int fgetc(FILE *<[fp]>);
1.25 +* TRAD_SYNOPSIS
1.26 +* #include <stdio.h>
1.27 +* int fgetc(<[fp]>)
1.28 +* FILE *<[fp]>;
1.29 +* Use <<fgetc>> to get the next single character from the file or stream
1.30 +* identified by <[fp]>. As a side effect, <<fgetc>> advances the file's
1.31 +* current position indicator.
1.32 +* For a macro version of this function, see <<getc>>.
1.33 +* RETURNS
1.34 +* The next character (read as an <<unsigned char>>, and cast to
1.35 +* <<int>>), unless there is no more data, or the host system reports a
1.36 +* read error; in either of these situations, <<fgetc>> returns <<EOF>>.
1.37 +* You can distinguish the two situations that cause an <<EOF>> result by
1.38 +* using the <<ferror>> and <<feof>> functions.
1.39 +* PORTABILITY
1.40 +* ANSI C requires <<fgetc>>.
1.41 +* Supporting OS subroutines required: <<close>>, <<fstat>>, <<isatty>>,
1.42 +* <<lseek>>, <<read>>, <<sbrk>>, <<write>>.
1.43 +*
1.44 +*
1.45 +*/
1.46 +
1.47 +
1.48 +
1.49 +#include <stdio.h>
1.50 +#include "LOCAL.H"
1.51 +
1.52 +/**
1.53 +Get the next character from a stream.
1.54 +Returns the next character of the stream and increases the file pointer
1.55 +to point to the following one.
1.56 +@return The character read is returned as an int value.
1.57 +If the End Of File has been reached or there has been an error reading,
1.58 +the function returns EOF.
1.59 +@param fp pointer to an open file.
1.60 +*/
1.61 +EXPORT_C int
1.62 +fgetc (FILE * fp)
1.63 +{
1.64 + return __sgetc (fp);
1.65 +}