GRASS GIS 8 Programmer's Manual
8.5.0dev(2024)-d6dec75dd4
|
RowIO library - Setup. More...
#include <stdio.h>
#include <stdlib.h>
#include <grass/gis.h>
#include <grass/glocale.h>
#include <grass/rowio.h>
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. More... | |
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.
Definition in file rowio/setup.c.
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().
R | pointer to ROWIO structure |
fd | file descriptor |
nrows | number of rows |
getrow | get row function |
Definition at line 44 of file rowio/setup.c.
References _, ROWIO::buf, ROWIO::ROWIO_RCB::buf, ROWIO::cur, ROWIO::fd, G_malloc, G_warning(), ROWIO::getrow, ROWIO::len, ROWIO::nrows, NULL, ROWIO::putrow, ROWIO::rcb, and ROWIO::ROWIO_RCB::row.