xref: /csrg-svn/usr.bin/pascal/libpc/SEEK.c (revision 62096)
140865Sbostic /*-
2*62096Sbostic  * Copyright (c) 1979, 1993
3*62096Sbostic  *	The Regents of the University of California.  All rights reserved.
440865Sbostic  *
540865Sbostic  * %sccs.include.redist.c%
640865Sbostic  */
71701Smckusick 
840865Sbostic #ifndef lint
9*62096Sbostic static char sccsid[] = "@(#)SEEK.c	8.1 (Berkeley) 06/06/93";
1040865Sbostic #endif /* not lint */
111701Smckusick 
121701Smckusick #include "h00vars.h"
131701Smckusick 
141701Smckusick /*
151701Smckusick  * Random access routine
161701Smckusick  */
SEEK(curfile,loc)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