Loading...
Searching...
No Matches
setup.c File Reference

RowIO library - Setup. More...

`#include <stdio.h>`
`#include <stdlib.h>`
`#include <grass/gis.h>`
`#include <grass/glocale.h>`
`#include <grass/rowio.h>`
Include dependency graph for rowio/setup.c:

Go to the source code of this file.

## Functions

int | Rowio_setup (ROWIO *R, int fd, int nrows, int len, int(*getrow)(int, void *, int, int), int(*putrow)(int, const void *, int, int))
| Configure rowio structure.

## Detailed Description

RowIO library - Setup.

(C) 2001-2009 by the GRASS Development Team

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

Author
  Original author CERL

Definition in file rowio/setup.c.

## Function Documentation

## Rowio_setup()

int Rowio_setup | ( | ROWIO * | R,
|  | int | fd,
|  | int | nrows,
|  | int | len,
|  | int(* | getrow )(int, void *, int, int),
|  | int(* | putrow )(int, const void *, int, int) )

Configure rowio structure.

Rowio_setup() initializes the ROWIO structure r and allocates the required memory buffers. The file descriptor fd must be open for reading. The number of rows to be held in memory is nrows. The length in bytes of each row is len. The routine which will be called to read data from the file is getrow() and must be provided by the programmer. If the application requires that the rows be written back into the file if changed, the file descriptor fd must be open for write as well, and the programmer must provide a putrow() routine to write the data into the file. If no writing of the file is to occur, specify NULL for putrow().

Parameters

  R | pointer to ROWIO structure
  fd | file descriptor
  nrows | number of rows
  getrow | get row function

Returns
  1 on success
  -1 no memory

Definition at line 43 of file rowio/setup.c.

References G_warning(), and NULL.