scc

simple c99 compiler
git clone git://git.simple-cc.org/scc
Log | Files | Refs | Submodules | README | LICENSE

objpos.c (223B)


      1 #include <stdio.h>
      2 
      3 #include <scc/mach.h>
      4 
      5 #include "libmach.h"
      6 
      7 int
      8 objpos(Obj *obj, FILE *fp, long pos)
      9 {
     10 	if (fseek(fp, obj->pos, SEEK_SET) == EOF)
     11 		return 0;
     12 	if (fseek(fp, pos, SEEK_CUR) < 0)
     13 		return 0;
     14 	return 1;
     15 }