|
|
1.1 root 1: /*
2: * Copyright (c) 1980 Regents of the University of California.
3: * All rights reserved. The Berkeley software License Agreement
4: * specifies the terms and conditions for redistribution.
5: *
6: * @(#)rewind.c 5.1 6/7/85
7: */
8:
9: /*
10: * rewind.c - f77 file rewind
11: */
12:
13: #include "fio.h"
14:
15: static char rwnd[] = "rewind";
16:
17: f_rew(a) alist *a;
18: { int n;
19: unit *b;
20:
21: lfname = NULL;
22: elist = NO;
23: external = YES; /* for err */
24: lunit = a->aunit;
25: errflag = a->aerr;
26: if(not_legal(lunit)) err(errflag,F_ERUNIT,rwnd)
27: b = &units[lunit];
28: if(!b->ufd && (n=fk_open(READ,SEQ,FMT,(ftnint)lunit)) )
29: err(errflag,n,rwnd)
30: lfname = b->ufnm;
31: if(!b->useek) err(errflag,F_ERNOBKSP,rwnd)
32: b->uend = NO;
33: if(b->uwrt)
34: if(n=t_runc(b,errflag,rwnd)) return(n);
35: rewind(b->ufd);
36: return(OK);
37: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.