ReactOS 0.4.16-dev-2104-gb84fa49
feoferr.cpp
Go to the documentation of this file.
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//
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}
#define _VALIDATE_RETURN(expr, errorcode, retexpr)
#define __cdecl
Definition: corecrt.h:121
#define EINVAL
Definition: errno.h:44
int __cdecl feof(FILE *const public_stream)
Definition: feoferr.cpp:15
int __cdecl ferror(FILE *const public_stream)
Definition: feoferr.cpp:25