17 #include <grass/gis.h>
18 #include <grass/glocale.h>
19 #include "local_proto.h"
48 int srows,
int scols,
int len,
int nseg)
53 G_warning(_(
"Segment file name is NULL"));
57 if (access(fname, F_OK) == 0) {
58 G_warning(_(
"Segment file exists already"));
65 if (-1 == (SEG->fd = creat(SEG->fname, 0666))) {
66 G_warning(_(
"Unable to create segment file"));
74 G_warning(_(
"Could not write segment file"));
78 G_warning(_(
"Illegal segment configuration parameter(s)"));
85 if (-1 == (SEG->fd = open(SEG->fname, 2))) {
87 G_warning(_(
"Unable to re-open segment file"));
94 G_warning(_(
"Could not read segment file"));
char * G_store(const char *s)
Copy string to allocated memory.
int Segment_open(SEGMENT *SEG, char *fname, off_t nrows, off_t ncols, int srows, int scols, int len, int nseg)
Initialize segment structure and open segment file.
int Segment_init(SEGMENT *SEG, int fd, int nseg)
Initialize segment structure.
void G_warning(const char *msg,...)
Print a warning message to stderr.