Loading...
Searching...
No Matches
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.

## 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 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] | SEG | segment
  [in] | fname | file name
  [in] | nrows | number of non-segmented rows
  [in] | ncols | number of non-segmented columns
  [in] | srows | segment rows
  [in] | scols | segment columns
  [in] | len | length of data type
  [in] | nseg | number 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 44 of file segment/open.c.

References G_store(), G_verbose_message(), G_warning(), NULL, Segment_format_nofill(), and Segment_init().