blob: ad23bf317db07d0467fa39985a538f855c39373f (
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
30
31
32
33
34
|
#include <stdio.h>
#include "_stdio.h"
/** get the file position indicator **/
long int ftell(FILE *stream)
{
long int ret = -1L;
SIGNAL_SAFE(0);
ASSERT_STREAM(stream, 0, 0);
/*
RETURN_SUCCESS(the current file position);
RETURN_FAILURE(LITERAL(-1L));
*/
if (stream->text) {
ADD_PREV(ret, stream->valid_ftell, stream->nvalid_ftell);
}
return ret;
}
/***
obtains the current value of the file position indicitor of ARGUMENT(stream).
For binary streams, the indicator is the current byte position.
***/
/*
UNSPECIFIED(The meaning of the file position indicator for text streams)
STDC(1)
*/
|