GRASS GIS 8 Programmer's Manual  8.5.0dev(2024)-36359e2344
segment/open.c File Reference

Segment creation routine. More...

#include <unistd.h>
#include <fcntl.h>
#include <grass/gis.h>
#include <grass/glocale.h>
#include "local_proto.h"
Include dependency graph for segment/open.c:

Go to the source code of this file.

Functions

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. More...
 

Detailed Description

Segment creation routine.

This program is free software under the GNU General Public License (>=v2). Read the file COPYING that comes with GRASS for details.

Author
GRASS GIS Development Team
Date
2018

Definition in file segment/open.c.

Function Documentation

◆ Segment_open()

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.

Initializes the seg structure and prepares a temporary file. This fn is a wrapper for Segment_format() and Segment_init()

Note: The file with name fname will be created anew.

Parameters
[in,out]SEGsegment
[in]fnamefile name
[in]nrowsnumber of non-segmented rows
[in]ncolsnumber of non-segmented columns
[in]srowssegment rows
[in]scolssegment columns
[in]lenlength of data type
[in]nsegnumber of segments to remain in memory
Returns
1 if successful
-1 if file name is invalid
-2 if file write error
-3 if illegal parameters are passed
-4 if file could not be re-opened
-5 if prepared file could not be read
-6 if out of memory

Definition at line 45 of file segment/open.c.