GRASS GIS 8 Programmer's Manual
8.5.0dev(2024)-d6dec75dd4
segment.h
Go to the documentation of this file.
1
#ifndef GRASS_SEGMENT_H
2
#define GRASS_SEGMENT_H
3
4
#include <
grass/gis.h
>
5
6
#ifdef HAVE_UNISTD_H
7
#include <unistd.h>
8
#endif
9
10
#ifdef HAVE_SYS_TYPES_H
11
#include <sys/types.h>
12
#endif
13
14
struct
aq
{
/* age queue */
15
int
cur
;
/* segment number */
16
struct
aq
*
younger
, *
older
;
/* pointer to next younger and next older */
17
};
18
19
typedef
struct
SEGMENT
{
20
int
open
;
/* open flag */
21
off_t
nrows
;
/* rows in original data */
22
off_t
ncols
;
/* cols in original data */
23
int
len
;
/* bytes per data value */
24
int
srows
;
/* rows in segments */
25
int
scols
;
/* cols in segments */
26
int
srowscols
;
/* rows x cols in segments */
27
int
size
;
/* size in bytes of a segment */
28
int
spr
;
/* segments per row */
29
int
spill
;
/* cols in last segment in row */
30
31
/* fast mode */
32
int
fast_adrs
;
/* toggles fast address mode */
33
off_t
scolbits
;
/* column bitshift */
34
off_t
srowbits
;
/* row bitshift */
35
off_t
segbits
;
/* segment bitshift */
36
int
fast_seek
;
/* toggles fast seek mode */
37
int
lenbits
;
/* data size bitshift */
38
int
sizebits
;
/* segment size bitshift */
39
int (*
address
)(
const
struct
SEGMENT
*, off_t, off_t,
int
*,
int
*);
40
int (*
seek
)(
const
struct
SEGMENT
*S, int, int);
41
42
char
*
fname
;
/* segment file name */
43
int
fd
;
/* file descriptor to read/write segment */
44
struct
scb
/* control blocks */
45
{
46
char
*
buf
;
/* data buffer */
47
char
dirty
;
/* dirty flag */
48
struct
aq
*
age
;
/* pointer to position in age queue */
49
int
n
;
/* segment number */
50
} *
scb
;
51
int
*
load_idx
;
/* index of loaded segments */
52
int
nfreeslots
;
/* number of free slots */
53
int
*
freeslot
;
/* array of free slots */
54
struct
aq
*
agequeue
,
/* queue of age for order of access */
55
*
youngest
,
/* youngest in age queue */
56
*
oldest
;
/* oldest in age queue */
57
int
nseg
;
/* number of segments in memory */
58
int
cur
;
/* last accessed segment */
59
int
offset
;
/* offset of data past header */
60
61
char
*
cache
;
/* all in memory cache */
62
}
SEGMENT
;
63
64
#include <
grass/defs/segment.h
>
65
66
#endif
/* GRASS_SEGMENT_H */
segment.h
gis.h
SEGMENT
struct SEGMENT SEGMENT
SEGMENT::scb
Definition:
segment.h:45
SEGMENT::scb::age
struct aq * age
Definition:
segment.h:48
SEGMENT::scb::n
int n
Definition:
segment.h:49
SEGMENT::scb::dirty
char dirty
Definition:
segment.h:47
SEGMENT::scb::buf
char * buf
Definition:
segment.h:46
SEGMENT
Definition:
segment.h:19
SEGMENT::len
int len
Definition:
segment.h:23
SEGMENT::spill
int spill
Definition:
segment.h:29
SEGMENT::nrows
off_t nrows
Definition:
segment.h:21
SEGMENT::freeslot
int * freeslot
Definition:
segment.h:53
SEGMENT::agequeue
struct aq * agequeue
Definition:
segment.h:54
SEGMENT::cur
int cur
Definition:
segment.h:58
SEGMENT::address
int(* address)(const struct SEGMENT *, off_t, off_t, int *, int *)
Definition:
segment.h:39
SEGMENT::segbits
off_t segbits
Definition:
segment.h:35
SEGMENT::fast_adrs
int fast_adrs
Definition:
segment.h:32
SEGMENT::youngest
struct aq * youngest
Definition:
segment.h:55
SEGMENT::lenbits
int lenbits
Definition:
segment.h:37
SEGMENT::oldest
struct aq * oldest
Definition:
segment.h:56
SEGMENT::scolbits
off_t scolbits
Definition:
segment.h:33
SEGMENT::load_idx
int * load_idx
Definition:
segment.h:51
SEGMENT::spr
int spr
Definition:
segment.h:28
SEGMENT::nfreeslots
int nfreeslots
Definition:
segment.h:52
SEGMENT::scb
struct SEGMENT::scb * scb
SEGMENT::ncols
off_t ncols
Definition:
segment.h:22
SEGMENT::nseg
int nseg
Definition:
segment.h:57
SEGMENT::cache
char * cache
Definition:
segment.h:61
SEGMENT::open
int open
Definition:
segment.h:20
SEGMENT::fd
int fd
Definition:
segment.h:43
SEGMENT::srowscols
int srowscols
Definition:
segment.h:26
SEGMENT::fast_seek
int fast_seek
Definition:
segment.h:36
SEGMENT::seek
int(* seek)(const struct SEGMENT *S, int, int)
Definition:
segment.h:40
SEGMENT::sizebits
int sizebits
Definition:
segment.h:38
SEGMENT::srowbits
off_t srowbits
Definition:
segment.h:34
SEGMENT::fname
char * fname
Definition:
segment.h:42
SEGMENT::offset
int offset
Definition:
segment.h:59
SEGMENT::size
int size
Definition:
segment.h:27
SEGMENT::srows
int srows
Definition:
segment.h:24
SEGMENT::scols
int scols
Definition:
segment.h:25
aq
Definition:
segment.h:14
aq::younger
struct aq * younger
Definition:
segment.h:16
aq::cur
int cur
Definition:
segment.h:15
aq::older
struct aq * older
Definition:
segment.h:16
include
grass
segment.h
Generated on Sun Dec 22 2024 07:38:20 for GRASS GIS 8 Programmer's Manual by
1.9.1