xref: /csrg-svn/usr.bin/pascal/libpc/SEEK.c (revision 5031)
11701Smckusick /* Copyright (c) 1979 Regents of the University of California */
21701Smckusick 
3*5031Smckusic static char sccsid[] = "@(#)SEEK.c 1.4 11/22/81";
41701Smckusick 
51701Smckusick #include "h00vars.h"
61701Smckusick 
71701Smckusick /*
81701Smckusick  * Random access routine
91701Smckusick  */
101701Smckusick SEEK(curfile, loc)
111701Smckusick 
121701Smckusick 	register struct iorec	*curfile;
133904Smckusic 	struct seekptr		*loc;
141701Smckusick {
151701Smckusick 	curfile->funit |= SYNC;
16*5031Smckusic 	curfile->funit &= ~(EOFF | EOLN | SPEOLN);
173904Smckusic 	if (fseek(curfile->fbuf, loc->cnt, 0) == -1) {
183904Smckusic 		PERROR("Could not seek ", curfile->pfname);
191701Smckusick 		return;
201701Smckusick 	}
211701Smckusick }
22