xref: /original-bsd/usr.bin/pascal/libpc/SEEK.c (revision c3e32dec)
1 /*-
2  * Copyright (c) 1979, 1993
3  *	The Regents of the University of California.  All rights reserved.
4  *
5  * %sccs.include.redist.c%
6  */
7 
8 #ifndef lint
9 static char sccsid[] = "@(#)SEEK.c	8.1 (Berkeley) 06/06/93";
10 #endif /* not lint */
11 
12 #include "h00vars.h"
13 
14 /*
15  * Random access routine
16  */
17 SEEK(curfile, loc)
18 
19 	register struct iorec	*curfile;
20 	struct seekptr		*loc;
21 {
22 	curfile->funit |= SYNC;
23 	curfile->funit &= ~(EOFF | EOLN | SPEOLN);
24 	if (fseek(curfile->fbuf, loc->cnt, 0) == -1) {
25 		PERROR("Could not seek ", curfile->pfname);
26 		return;
27 	}
28 }
29