12491Sdlw /* 2*23072Skre * Copyright (c) 1980 Regents of the University of California. 3*23072Skre * All rights reserved. The Berkeley software License Agreement 4*23072Skre * specifies the terms and conditions for redistribution. 52491Sdlw * 6*23072Skre * @(#)endfile.c 5.1 06/07/85 7*23072Skre */ 8*23072Skre 9*23072Skre /* 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; 2110673Sdlw 222491Sdlw lfname = NULL; 232491Sdlw elist = NO; 242491Sdlw errflag = a->aerr; 252491Sdlw lunit = a->aunit; 2610673Sdlw if (not_legal(lunit)) 2710673Sdlw err (errflag, F_ERUNIT, endf) 282491Sdlw b = &units[lunit]; 2910673Sdlw if (!b->ufd) 3010673Sdlw err (errflag, F_ERNOPEN, endf) 3110673Sdlw if (b->uend) 3210673Sdlw return(0); 332491Sdlw lfname = b->ufnm; 342491Sdlw b->uend = YES; 3514826Sdlw return ( t_runc (b, errflag, endf) ); 362491Sdlw } 37