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)  

get.c File Reference

RowIO library - Get a row. More...

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

Go to the source code of this file.

Functions

static void * my_select (ROWIO *, int)
 
static void pageout (ROWIO *, int)
 
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 get.c.

Function Documentation

◆ my_select()

static void * my_select ( ROWIO R,
int  n 
)
static

◆ pageout()

static void pageout ( ROWIO R,
int  cur 
)
static

◆ Rowio_flush()

void Rowio_flush ( ROWIO R)

Flush data.

Parameters
Rpointer to ROWIO strcuture

Definition at line 89 of file get.c.

References ROWIO::nrows, and pageout().

◆ 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 get.c.

References ROWIO::ROWIO_RCB::age, ROWIO::buf, ROWIO::ROWIO_RCB::buf, ROWIO::cur, cur, ROWIO::ROWIO_RCB::dirty, ROWIO::fd, ROWIO::getrow, ROWIO::len, my_select(), ROWIO::nrows, NULL, pageout(), ROWIO::rcb, and ROWIO::ROWIO_RCB::row.