From 7ef8a7379f7f7d09e71ccae2a0b688c3cd80423f Mon Sep 17 00:00:00 2001 From: Jakob Kaivo Date: Fri, 8 Feb 2019 18:42:39 -0500 Subject: merge sources into single tree --- src/stdio/ferror.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 src/stdio/ferror.c (limited to 'src/stdio/ferror.c') diff --git a/src/stdio/ferror.c b/src/stdio/ferror.c new file mode 100644 index 00000000..609f7640 --- /dev/null +++ b/src/stdio/ferror.c @@ -0,0 +1,21 @@ +#include +#include "nonstd/assert.h" +#include "nonstd/io.h" + +/** tests the file stream error indicator **/ +int ferror(FILE *stream) +{ + ASSERT_NONNULL(stream); + /* + RETURN(0, the error indicator is not set); + RETURN(NONZERO, the error indicator is set); + */ + return stream->err; +} + +/*** +tests the error indicator of ARGUMENT(stream). +***/ +/* +STDC(1) +*/ -- cgit v1.2.1