#include <stdio.h>
#include <assert.h>
#include <unistd.h>
#include "gpklib/readwrite.h"

BOOL hop_next_record(FILE *fp)
{
 BOOL ok;
 long beginning = ftell(fp);
 long next = -1;

 assert(beginning >= 0);

 ok = read_long_4(fp, &next);
 ok = ok && fseek(fp, next, SEEK_SET)==0;
 if(!ok && !ferror(fp))	{
 	fseek(fp, beginning, SEEK_SET);
	return FALSE;
 	}
 return TRUE;
}
