19 #include <grass/gis.h>
20 #include "local_proto.h"
50 ncols = SEG->ncols - SEG->spill;
52 size = scols * SEG->len;
54 for (col = 0; col < ncols; col += scols) {
55 SEG->address(SEG, row, col, &n, &index);
56 SEG->seek(SEG, n, index);
58 if (read(SEG->fd, buf, size) != size) {
59 G_warning(
"Segment_get_row: %s", strerror(errno));
68 buf = ((
char *)buf) + size;
70 if ((size = SEG->spill * SEG->len)) {
71 SEG->address(SEG, row, col, &n, &index);
72 SEG->seek(SEG, n, index);
74 if (read(SEG->fd, buf, size) != size) {
75 G_warning(
"Segment_get_row: %s", strerror(errno));
int Segment_get_row(const SEGMENT *SEG, void *buf, off_t row)
void G_warning(const char *msg,...)
Print a warning message to stderr.