GRASS GIS 8 Programmer's Manual
8.5.0dev(2024)-36359e2344
flush.c
Go to the documentation of this file.
1
/**
2
* \file flush.c
3
*
4
* \brief Segment flush routines.
5
*
6
* This program is free software under the GNU General Public License
7
* (>=v2). Read the file COPYING that comes with GRASS for details.
8
*
9
* \author GRASS GIS Development Team
10
*
11
* \date 2005-2009
12
*/
13
14
#include "local_proto.h"
15
16
/**
17
* \fn int Segment_flush (SEGMENT *SEG)
18
*
19
* \brief Flush pending updates to disk.
20
*
21
* Forces all pending updates generated by <i>Segment_put()</i> to be
22
* written to the segment file <b>seg</b>. Must be called after the
23
* final <i>Segment_put()</i> to force all pending updates to disk. Must
24
* also be called before the first call to <i>Segment_get_row</i>.
25
*
26
* \param[in] SEG segment
27
* \return always returns 0
28
*/
29
30
int
Segment_flush
(
SEGMENT
*SEG)
31
{
32
int
i;
33
34
if
(SEG->
scb
) {
35
for
(i = 0; i < SEG->
nseg
; i++)
36
if
(SEG->
scb
[i].
n
>= 0 && SEG->
scb
[i].
dirty
)
37
seg_pageout
(SEG, i);
38
}
39
40
return
0;
41
}
Segment_flush
int Segment_flush(SEGMENT *SEG)
Flush pending updates to disk.
Definition:
flush.c:30
seg_pageout
int seg_pageout(SEGMENT *SEG, int i)
Internal use only.
Definition:
pageout.c:35
SEGMENT::scb::n
int n
Definition:
segment.h:49
SEGMENT::scb::dirty
char dirty
Definition:
segment.h:47
SEGMENT
Definition:
segment.h:19
SEGMENT::scb
struct SEGMENT::scb * scb
SEGMENT::nseg
int nseg
Definition:
segment.h:57
lib
segment
flush.c
Generated on Thu Nov 21 2024 07:03:26 for GRASS GIS 8 Programmer's Manual by
1.9.1