Reactos
at master 29 lines 817 B view raw
1// 2// feoferr.cpp 3// 4// Copyright (c) Microsoft Corporation. All rights reserved. 5// 6// Defines feof() and ferror(), which test the end-of-file and error states of a 7// stream, respectively. 8// 9#include <corecrt_internal_stdio.h> 10 11 12 13// Tests the stream for the end-of-file condition. Returns nonzero if and only 14// if the stream is at end-of-file. 15extern "C" int __cdecl feof(FILE* const public_stream) 16{ 17 _VALIDATE_RETURN(public_stream != nullptr, EINVAL, 0); 18 return __crt_stdio_stream(public_stream).eof(); 19} 20 21 22 23// Tests the stream error indicator. Returns nonzero if and only if the error 24// indicator for the stream is set. 25extern "C" int __cdecl ferror(FILE* const public_stream) 26{ 27 _VALIDATE_RETURN(public_stream != nullptr, EINVAL, 0); 28 return __crt_stdio_stream(public_stream).error(); 29}