* MAINTAINERS: Add myself as a vax port maintainer.
[official-gcc.git] / libf2c / libI77 / ftell_.c
blob63153420fbc3ccda4ceaaa604c4814700082095b
1 #include "config.h"
2 #include "f2c.h"
3 #include "fio.h"
5 static FILE *
6 unit_chk (integer Unit, char *who)
8 if (Unit >= MXUNIT || Unit < 0)
9 f__fatal (101, who);
10 return f__units[Unit].ufd;
13 integer
14 G77_ftell_0 (integer * Unit)
16 FILE *f;
17 return (f = unit_chk (*Unit, "ftell")) ? (integer) FTELL (f) : -1L;
20 integer
21 G77_fseek_0 (integer * Unit, integer * offset, integer * xwhence)
23 FILE *f;
24 int w = (int) *xwhence;
25 #ifdef SEEK_SET
26 static int wohin[3] = { SEEK_SET, SEEK_CUR, SEEK_END };
27 #endif
28 if (w < 0 || w > 2)
29 w = 0;
30 #ifdef SEEK_SET
31 w = wohin[w];
32 #endif
33 return !(f = unit_chk (*Unit, "fseek"))
34 || FSEEK (f, (off_t) * offset, w) ? 1 : 0;