19 #include <grass/gis.h>
20 #include "local_proto.h"
53 ncols = SEG->ncols - SEG->spill;
55 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 ((result = write(SEG->fd, buf, size)) != size) {
63 G_warning(
"Segment_put_row write error %s", strerror(errno));
73 buf = ((
const char *)buf) + size;
76 if ((size = SEG->spill * SEG->len)) {
77 SEG->address(SEG, row, col, &n, &index);
78 SEG->seek(SEG, n, index);
80 if (write(SEG->fd, buf, size) != size) {
81 G_warning(
"Segment_put_row final write error: %s",
int Segment_put_row(const SEGMENT *SEG, const void *buf, off_t row)
Write row to segment file.
void G_warning(const char *msg,...)
Print a warning message to stderr.