GRASS GIS 8 Programmer's Manual  8.2.2dev(2023)-3d2c704037
rowio/get.c File Reference

RowIO library - Get a row. More...

#include <stdio.h>
#include <grass/rowio.h>
Include dependency graph for rowio/get.c:

Go to the source code of this file.

Functions

void * Rowio_get (ROWIO *R, int row)
 Read a row. More...
 
void Rowio_flush (ROWIO *R)
 Flush data. More...
 

Detailed Description

RowIO library - Get a row.

(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/get.c.

Function Documentation

◆ Rowio_flush()

void Rowio_flush ( ROWIO R)

Flush data.

Parameters
Rpointer to ROWIO strcuture

Definition at line 89 of file rowio/get.c.

References ROWIO::nrows.

◆ Rowio_get()

void* Rowio_get ( ROWIO R,
int  row 
)

Read a row.

Rowio_get() returns a buffer which holds the data for row from the file associated with ROWIO structure R. If the row requested is not in memory, the getrow() routine specified in Rowio_setup() is called to read row into memory and a pointer to the memory buffer containing the row is returned. If the data currently in the buffer had been changed by Rowio_put(), the putrow() routine specified in Rowio_setup() is called first to write the changed row to disk. If row is already in memory, no disk read is done. The pointer to the data is simply returned.

Parameters
Rpointer to ROWIO structure
rowrow number
Returns
NULL on error
pointer to the buffer containing row

Definition at line 41 of file rowio/get.c.