20#include "local_proto.h"
54 memcpy(SEG->cache + ((
size_t)row * SEG->ncols) * SEG->len, buf, SEG->len * SEG->ncols);
59 ncols = SEG->ncols - SEG->spill;
61 size = scols * SEG->len;
64 for (col = 0; col < ncols; col += scols) {
65 SEG->address(SEG, row, col, &n, &index);
66 SEG->seek(SEG, n, index);
68 if ((result = write(SEG->fd, buf, size)) != size) {
69 G_warning(
"Segment_put_row write error %s", strerror(errno));
79 buf = ((
const char *)buf) + size;
82 if ((size = SEG->spill * SEG->len)) {
83 SEG->address(SEG, row, col, &n, &index);
84 SEG->seek(SEG, n, index);
86 if (write(SEG->fd, buf, size) != size) {
87 G_warning(
"Segment_put_row final write error: %s",
void G_warning(const char *msg,...)
Print a warning message to stderr.
int Segment_put_row(const SEGMENT *SEG, const void *buf, off_t row)
Write row to segment file.