[GRASS-SVN] r39601 - grass/trunk/include

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Oct 21 11:48:14 EDT 2009


Author: mmetz
Date: 2009-10-21 11:48:12 -0400 (Wed, 21 Oct 2009)
New Revision: 39601

Modified:
   grass/trunk/include/segment.h
Log:
updated header for segment library

Modified: grass/trunk/include/segment.h
===================================================================
--- grass/trunk/include/segment.h	2009-10-21 06:42:28 UTC (rev 39600)
+++ grass/trunk/include/segment.h	2009-10-21 15:48:12 UTC (rev 39601)
@@ -11,6 +11,11 @@
 #include <sys/types.h>
 #endif
 
+struct aq {			/* age queue */
+    int cur;			/* segment number */
+    struct aq *younger, *older;	/* pointer to next younger and next older */
+} ;
+
 typedef struct
 {
     int open;			/* open flag */
@@ -19,22 +24,45 @@
     int len;			/* bytes per data value */
     int srows;			/* rows in segments */
     int scols;			/* 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 fd;			/* file descriptor to read/write segment */
     struct SEGMENT_SCB		/* control blocks */
     {
 	char *buf;		/* data buffer */
 	char dirty;		/* dirty flag */
-	int age;		/* for order of access */
+	struct aq *age;		/* pointer to position in age queue */
 	int n;			/* segment number */
     } *scb;
+    struct RB_TREE *loaded;	/* search tree 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 */ 
+              *youngest, 	/* youngest in age queue */
+	      *oldest;	        /* oldest in age queue */
     int nseg;			/* number of segments in memory */
     int cur;			/* last accessed segment */
     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 *);
@@ -51,5 +79,6 @@
 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 */



More information about the grass-commit mailing list