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.2 07/30/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) return(OK); 29 lfname = b->ufnm; 30 if(!b->useek) err(errflag,F_ERNOBKSP,rwnd) 31 b->uend = NO; 32 if(b->uwrt) 33 if(n=t_runc(b,errflag,rwnd)) return(n); 34 rewind(b->ufd); 35 return(OK); 36 } 37