12491Sdlw /* 223072Skre * Copyright (c) 1980 Regents of the University of California. 323072Skre * All rights reserved. The Berkeley software License Agreement 423072Skre * specifies the terms and conditions for redistribution. 52491Sdlw * 6*24095Sjerry * @(#)endfile.c 5.2 07/30/85 723072Skre */ 823072Skre 923072Skre /* 102491Sdlw * endfile 112491Sdlw */ 122491Sdlw 132491Sdlw #include "fio.h" 142491Sdlw 1510673Sdlw static char endf[] = "endfile"; 162491Sdlw 1710673Sdlw f_end (a) 1810673Sdlw alist *a; 192491Sdlw { 2010673Sdlw unit *b; 21*24095Sjerry int n; 2210673Sdlw 232491Sdlw lfname = NULL; 242491Sdlw elist = NO; 252491Sdlw errflag = a->aerr; 262491Sdlw lunit = a->aunit; 2710673Sdlw if (not_legal(lunit)) 2810673Sdlw err (errflag, F_ERUNIT, endf) 292491Sdlw b = &units[lunit]; 30*24095Sjerry if(!b->ufd && (n = fk_open(READ, SEQ, FMT, (ftnint)lunit)) ) 31*24095Sjerry err(errflag, n, endf); 3210673Sdlw if (b->uend) 3310673Sdlw return(0); 342491Sdlw lfname = b->ufnm; 352491Sdlw b->uend = YES; 3614826Sdlw return ( t_runc (b, errflag, endf) ); 372491Sdlw } 38