Daily bump.
[official-gcc.git] / libf2c / libI77 / rewind.c
blob06915195d67030190a8fb263b05df4055ccc4c07
1 #include "config.h"
2 #include "f2c.h"
3 #include "fio.h"
4 #ifdef KR_headers
5 integer f_rew(a) alist *a;
6 #else
7 integer f_rew(alist *a)
8 #endif
10 unit *b;
11 if (f__init & 2)
12 f__fatal (131, "I/O recursion");
13 if(a->aunit>=MXUNIT || a->aunit<0)
14 err(a->aerr,101,"rewind");
15 b = &f__units[a->aunit];
16 if(b->ufd == NULL || b->uwrt == 3)
17 return(0);
18 if(!b->useek)
19 err(a->aerr,106,"rewind");
20 if(b->uwrt) {
21 (void) t_runc(a);
22 b->uwrt = 3;
24 FSEEK(b->ufd, 0, SEEK_SET);
25 b->uend=0;
26 return(0);