19 #include <grass/gis.h>
20 #include "local_proto.h"
51 memcpy(buf, SEG->cache + ((
size_t)row * SEG->ncols) * SEG->len, SEG->len * SEG->ncols);
56 ncols = SEG->ncols - SEG->spill;
58 size = scols * SEG->len;
60 for (col = 0; col < ncols; col += scols) {
61 SEG->address(SEG, row, col, &n, &index);
62 SEG->seek(SEG, n, index);
64 if (read(SEG->fd, buf, size) != size) {
65 G_warning(
"Segment_get_row: %s", strerror(errno));
74 buf = ((
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 (read(SEG->fd, buf, size) != size) {
81 G_warning(
"Segment_get_row: %s", strerror(errno));