19 #include "local_proto.h"
51 memcpy(SEG->
cache + ((
size_t)row * SEG->
ncols) * SEG->
len, buf,
59 size = scols * SEG->
len;
63 for (col = 0; col < ncols; col += scols) {
64 SEG->
address(SEG, row, col, &n, &index);
65 SEG->
seek(SEG, n, index);
67 if ((result = write(SEG->
fd, buf, size)) != size) {
68 G_warning(
"Segment_put_row write error %s", strerror(errno));
80 buf = ((
const char *)buf) + size;
83 if ((size = SEG->
spill * SEG->
len)) {
84 SEG->
address(SEG, row, col, &n, &index);
85 SEG->
seek(SEG, n, index);
87 if (write(SEG->
fd, buf, size) != size) {
88 G_warning(
"Segment_put_row final write error: %s", strerror(errno));
void G_warning(const char *,...) __attribute__((format(printf
int Segment_put_row(const SEGMENT *SEG, const void *buf, off_t row)
Write row to segment file.
int(* address)(const struct SEGMENT *, off_t, off_t, int *, int *)
int(* seek)(const struct SEGMENT *S, int, int)