19 #include "local_proto.h"
48 memcpy(buf, SEG->
cache + ((
size_t)row * SEG->
ncols) * SEG->
len,
56 size = scols * SEG->
len;
58 for (col = 0; col < ncols; col += scols) {
59 SEG->
address(SEG, row, col, &n, &index);
60 SEG->
seek(SEG, n, index);
62 if (
read(SEG->
fd, buf, size) != size) {
63 G_warning(
"Segment_get_row: %s", strerror(errno));
72 buf = ((
char *)buf) + size;
74 if ((size = SEG->
spill * SEG->
len)) {
75 SEG->
address(SEG, row, col, &n, &index);
76 SEG->
seek(SEG, n, index);
78 if (
read(SEG->
fd, buf, size) != size) {
79 G_warning(
"Segment_get_row: %s", strerror(errno));
void G_warning(const char *,...) __attribute__((format(printf
int Segment_get_row(const SEGMENT *SEG, void *buf, off_t row)
int(* address)(const struct SEGMENT *, off_t, off_t, int *, int *)
int(* seek)(const struct SEGMENT *S, int, int)