Debian Codegraph @

debian/external_deps/fetk/punc/src/vf2c/rewind.c

raw
1 #include "f2c.h"
2 #include "fio.h"
3 #ifdef __cplusplus
4 extern "C" {
5 #endif
6 #ifdef KR_headers
7 integer f_rew(a) alist *a;
8 #else
9 integer f_rew(alist *a)
10 #endif
11 {
12 unit *b;
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;
23 }
24 rewind(b->ufd);
25 b->uend=0;
26 return(0);
27 }
28 #ifdef __cplusplus
29 }
30 #endif