17 #include <grass/gis.h> 
   18 #include <grass/segment.h> 
   41     if (SEG->nrows <= 0 || SEG->ncols <= 0
 
   42         || SEG->srows <= 0 || SEG->scols <= 0
 
   43         || SEG->len <= 0 || SEG->nseg <= 0) {
 
   44         G_warning(
"segment_setup: illegal segment file parameters\n");
 
   49     SEG->offset = (
int)lseek(SEG->fd, 0L, SEEK_CUR);
 
   51     SEG->spr = SEG->ncols / SEG->scols;
 
   52     SEG->spill = SEG->ncols % SEG->scols;
 
   57          (
struct SEGMENT_SCB *)G_malloc(SEG->nseg *
 
   58                                         sizeof(
struct SEGMENT_SCB))) == 
NULL)
 
   61     SEG->size = SEG->srows * SEG->scols * SEG->len;
 
   63     for (i = 0; i < SEG->nseg; i++) {
 
   64         if ((SEG->scb[i].buf = G_malloc(SEG->size)) == 
NULL)
 
   68         SEG->scb[i].dirty = 0;
 
int segment_setup(SEGMENT *SEG)
Setup segment. 
 
G_warning("category support for [%s] in mapset [%s] %s", name, mapset, type)