grass  7.8.6
About: GRASS (Geographic Resources Analysis Support System) is a raster- and vector-based GIS, image processing system, graphics production system and spatial modeling system.
  Fossies Dox: grass-7.8.6.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

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 setup.c:

Go to the source code of this file.


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

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.

Original author CERL

Definition in file setup.c.

Function Documentation

◆ Rowio_setup()

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

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().

Rpointer to ROWIO structure
fdfile descriptor
nrowsnumber of rows
getrowget row function
1 on success
-1 no memory

Definition at line 44 of file setup.c.

References _, ROWIO::buf, ROWIO::ROWIO_RCB::buf, ROWIO::cur, ROWIO::fd, G_warning(), ROWIO::getrow, ROWIO::len, ROWIO::nrows, NULL, ROWIO::putrow, ROWIO::rcb, and ROWIO::ROWIO_RCB::row.