source: trunk/third/gcc/libf2c/libI77/rewind.c @ 14548

Revision 14548, 462 bytes checked in by ghudson, 24 years ago (diff)
This commit was generated by cvs2svn to compensate for changes in r14547, which included commits to RCS files with non-trunk default branches.
Line 
1#include "f2c.h"
2#include "fio.h"
3#ifdef KR_headers
4integer f_rew(a) alist *a;
5#else
6integer f_rew(alist *a)
7#endif
8{
9        unit *b;
10        if (f__init & 2)
11                f__fatal (131, "I/O recursion");
12        if(a->aunit>=MXUNIT || a->aunit<0)
13                err(a->aerr,101,"rewind");
14        b = &f__units[a->aunit];
15        if(b->ufd == NULL || b->uwrt == 3)
16                return(0);
17        if(!b->useek)
18                err(a->aerr,106,"rewind");
19        if(b->uwrt) {
20                (void) t_runc(a);
21                b->uwrt = 3;
22                }
23        rewind(b->ufd);
24        b->uend=0;
25        return(0);
26}
Note: See TracBrowser for help on using the repository browser.