GRASS GIS 8 Programmer's Manual  8.5.0dev(2024)-36359e2344
rowio/put.c File Reference

RowIO library - Write a row. More...

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

Go to the source code of this file.

Functions

int Rowio_put (ROWIO *R, const void *buf, int row)
 Write a row. More...
 

Detailed Description

RowIO library - Write 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/put.c.

Function Documentation

◆ Rowio_put()

int Rowio_put ( ROWIO R,
const void *  buf,
int  row 
)

Write a row.

Writes the buffer buf, which holds the data for row n, into the ROWIO structure r. If the row requested is currently in memory, the buffer is simply copied into the structure and marked as having been changed. It will be written out later. Otherwise it is written immediately. Note that when the row is finally written to disk, the putrow() routine specified in Rowio_setup() is called to write row n to the file. Rowio_flush() force pending updates to disk ROWIO *r; Rowio_flush() forces all rows modified by Rowio_put() to be written to the file. This routine must be called before closing the file or releasing the rowio structure if Rowio_put() has been called.

Parameters
Rpointer to ROWIO structure
bufpointer to data buffer
rowrow number
Returns

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

References ROWIO::ROWIO_RCB::buf, ROWIO::ROWIO_RCB::dirty, ROWIO::fd, ROWIO::len, ROWIO::nrows, ROWIO::putrow, ROWIO::rcb, and ROWIO::ROWIO_RCB::row.