| Server IP : 209.209.40.120 / Your IP : 216.73.217.112 Web Server : Microsoft-IIS/10.0 System : Windows NT NEWWWW 10.0 build 17763 (Windows Server 2019) i586 User : NEWWWW$ ( 0) PHP Version : 8.3.30 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /Program Files (x86)/Windows Kits/10/Source/10.0.19041.0/ucrt/stdio/ |
Upload File : |
//
// fgetc.cpp
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// Functions that read the next character from a stream and return it. If the
// read causes the stream to reach EOF, EOF is returned and the EOF bit is set
// on the stream.
//
#include <corecrt_internal_stdio.h>
extern "C" int __cdecl _fgetc_nolock(FILE* const public_stream)
{
__crt_stdio_stream const stream(public_stream);
_VALIDATE_RETURN(stream.valid(), EINVAL, EOF);
--stream->_cnt;
if (stream->_cnt < 0)
return __acrt_stdio_refill_and_read_narrow_nolock(stream.public_stream());
char const c = *stream->_ptr;
++stream->_ptr;
return c & 0xff;
}
extern "C" int __cdecl _getc_nolock(FILE* const stream)
{
return _fgetc_nolock(stream);
}
extern "C" int __cdecl fgetc(FILE* const public_stream)
{
__crt_stdio_stream const stream(public_stream);
_VALIDATE_RETURN(stream.valid(), EINVAL, EOF);
int return_value = 0;
_lock_file(stream.public_stream());
__try
{
_VALIDATE_STREAM_ANSI_RETURN(stream, EINVAL, EOF);
return_value = _fgetc_nolock(stream.public_stream());
}
__finally
{
_unlock_file(stream.public_stream());
}
return return_value;
}
extern "C" int __cdecl getc(FILE* const stream)
{
return fgetc(stream);
}
extern "C" int __cdecl _fgetchar()
{
return fgetc(stdin);
}
extern "C" int __cdecl getchar()
{
return _fgetchar();
}