summaryrefslogtreecommitdiff
path: root/src/stdio/feof.c
blob: 26c9a5a8cbef17bb66527bde4798d4e6ba2ea3e4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#include <stdio.h>
#include "nonstd/io.h"
#include "nonstd/assert.h"

/** test for end-of-file **/
int feof(FILE *stream)
{
	ASSERT_NONNULL(stream);
	flockfile(stream);

	if (stream->eof) {
		return 1;
	}
	/* TODO */
	/* system level test */
	funlockfile(stream);
	/*
	RETURN(0, the end-of-file indicator is not set);
	RETURN(NONZERO, the end-of-file indicator is set);
	*/
	return stream->eof;
}

/***
tests for the end-of-file indicator of ARGUMENT(stream).
***/
/*
STDC(1)
*/