|
@@ -1,7 +1,7 @@
|
|
|
#ifndef GRASS_SEGMENT_H
|
|
|
#define GRASS_SEGMENT_H
|
|
|
|
|
|
-#include <grass/config.h>
|
|
|
+#include <grass/gis.h>
|
|
|
|
|
|
#ifdef HAVE_UNISTD_H
|
|
|
#include <unistd.h>
|
|
@@ -24,19 +24,19 @@ typedef struct
|
|
|
int len; /* bytes per data value */
|
|
|
int srows; /* rows in segments */
|
|
|
int scols; /* cols in segments */
|
|
|
- int srowscols; /* rows x cols in segments */
|
|
|
+ int srowscols; /* rows x cols in segments */
|
|
|
int size; /* size in bytes of a segment */
|
|
|
int spr; /* segments per row */
|
|
|
int spill; /* cols in last segment in row */
|
|
|
|
|
|
/* fast mode */
|
|
|
- int slow_adrs; /* toggles fast address mode */
|
|
|
- int scolbits; /* column bitshift */
|
|
|
- int srowbits; /* row bitshift */
|
|
|
- int segbits; /* segment bitshift */
|
|
|
- int slow_seek; /* toggles fast seek mode */
|
|
|
- int lenbits; /* data size bitshift */
|
|
|
- int sizebits; /* segment size bitshift */
|
|
|
+ int slow_adrs; /* toggles fast address mode */
|
|
|
+ int scolbits; /* column bitshift */
|
|
|
+ int srowbits; /* row bitshift */
|
|
|
+ int segbits; /* segment bitshift */
|
|
|
+ int slow_seek; /* toggles fast seek mode */
|
|
|
+ int lenbits; /* data size bitshift */
|
|
|
+ int sizebits; /* segment size bitshift */
|
|
|
|
|
|
int fd; /* file descriptor to read/write segment */
|
|
|
struct SEGMENT_SCB /* control blocks */
|
|
@@ -46,7 +46,7 @@ typedef struct
|
|
|
struct aq *age; /* pointer to position in age queue */
|
|
|
int n; /* segment number */
|
|
|
} *scb;
|
|
|
- struct RB_TREE *loaded; /* search tree of loaded segments */
|
|
|
+ int *load_idx; /* index of loaded segments */
|
|
|
int nfreeslots; /* number of free slots */
|
|
|
int *freeslot; /* array of free slots */
|
|
|
struct aq *agequeue, /* queue of age for order of access */
|
|
@@ -57,14 +57,6 @@ typedef struct
|
|
|
int offset; /* offset of data past header */
|
|
|
} SEGMENT;
|
|
|
|
|
|
-typedef struct
|
|
|
-{
|
|
|
- int i;
|
|
|
- int n;
|
|
|
-} SEGID;
|
|
|
-
|
|
|
-#include <grass/gis.h>
|
|
|
-
|
|
|
int segment_address(const SEGMENT *, int, int, int *, int *);
|
|
|
int segment_flush(SEGMENT *);
|
|
|
int segment_format(int, int, int, int, int, int);
|
|
@@ -79,6 +71,5 @@ int segment_put_row(const SEGMENT *, const void *, int);
|
|
|
int segment_release(SEGMENT *);
|
|
|
int segment_seek(const SEGMENT *, int, int);
|
|
|
int segment_setup(SEGMENT *);
|
|
|
-int segment_compare(const void *, const void *);
|
|
|
|
|
|
#endif /* GRASS_SEGMENT_H */
|