xref: /csrg-svn/usr.bin/pascal/libpc/SEEK.c (revision 40865)
1*40865Sbostic /*-
2*40865Sbostic  * Copyright (c) 1979 The Regents of the University of California.
3*40865Sbostic  * All rights reserved.
4*40865Sbostic  *
5*40865Sbostic  * %sccs.include.redist.c%
6*40865Sbostic  */
71701Smckusick 
8*40865Sbostic #ifndef lint
9*40865Sbostic static char sccsid[] = "@(#)SEEK.c	1.5 (Berkeley) 04/09/90";
10*40865Sbostic #endif /* not lint */
111701Smckusick 
121701Smckusick #include "h00vars.h"
131701Smckusick 
141701Smckusick /*
151701Smckusick  * Random access routine
161701Smckusick  */
171701Smckusick SEEK(curfile, loc)
181701Smckusick 
191701Smckusick 	register struct iorec	*curfile;
203904Smckusic 	struct seekptr		*loc;
211701Smckusick {
221701Smckusick 	curfile->funit |= SYNC;
235031Smckusic 	curfile->funit &= ~(EOFF | EOLN | SPEOLN);
243904Smckusic 	if (fseek(curfile->fbuf, loc->cnt, 0) == -1) {
253904Smckusic 		PERROR("Could not seek ", curfile->pfname);
261701Smckusick 		return;
271701Smckusick 	}
281701Smckusick }
29