15 #include <sys/types.h>
20 #include "local_proto.h"
34 #define SEG_SEEK_FAST(SEG, n, index) \
35 ((((off_t)(n)) << (SEG)->sizebits) + (index) + (SEG)->offset)
37 #define SEG_SEEK_SLOW(SEG, n, index) \
38 ((off_t)(n) * (SEG)->size + (index) + (SEG)->offset)
42 if (lseek((SEG)->fd,
SEG_SEEK_FAST(SEG, n, index), SEEK_SET) == (off_t)-1) {
51 if (lseek((SEG)->fd,
SEG_SEEK_SLOW(SEG, n, index), SEEK_SET) == (off_t)-1) {
60 return SEG->
seek(SEG, n, index);
void void void void G_fatal_error(const char *,...) __attribute__((format(printf
int seg_seek(const SEGMENT *SEG, int n, int index)
int seg_seek_fast(const SEGMENT *SEG, int n, int index)
int seg_seek_slow(const SEGMENT *SEG, int n, int index)
#define SEG_SEEK_FAST(SEG, n, index)
Internal use only.
#define SEG_SEEK_SLOW(SEG, n, index)
int(* seek)(const struct SEGMENT *S, int, int)