GRASS GIS 8 Programmer's Manual
8.5.0dev(2024)-36359e2344
|
#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include <errno.h>
#include <grass/gis.h>
#include "local_proto.h"
Go to the source code of this file.
Functions | |
int | Segment_init (SEGMENT *SEG, int fd, int nseg) |
Initialize segment structure. More... | |
int Segment_init | ( | SEGMENT * | SEG, |
int | fd, | ||
int | nseg | ||
) |
Initialize segment structure.
Initializes the seg structure. The file on fd is a segment file created by Segment_format() and must be open for reading and writing. The segment file configuration parameters nrows, ncols, srows, scols, and len, as written to the file by Segment_format(), are read from the file and stored in the seg structure. nsegs specifies the number of segments that will be retained in memory. The minimum value allowed is 1.
Note: The size of a segment is scols*srows*len plus a few bytes for managing each segment.
[in,out] | SEG | segment |
[in] | fd | file descriptor |
[in] | nseg | number of segments to remain in memory |
Definition at line 56 of file segment/init.c.
References err(), SEGMENT::fd, G_warning(), SEGMENT::nseg, and SEGMENT::open.