This file is indexed.

/usr/lib/grass72/include/grass/raster3d.h is in grass-dev 7.2.0-2.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
#ifndef GRASS_RASTER3D_H
#define GRASS_RASTER3D_H

#include <grass/gis.h>
#include <grass/raster.h>

#define RASTER3D_MAP_VERSION 2 /* Second version of the raster 3D map layout.
                                * Old maps withput version information are
                                * defined as version == 1 when reading the header.
                                */

#define RASTER3D_TILE_SAME_AS_FILE 2

#define RASTER3D_NO_COMPRESSION 0
#define RASTER3D_COMPRESSION 1

#define RASTER3D_MAX_PRECISION -1

#define RASTER3D_NO_CACHE 0
#define RASTER3D_USE_CACHE_DEFAULT -1
#define RASTER3D_USE_CACHE_X -2
#define RASTER3D_USE_CACHE_Y -3
#define RASTER3D_USE_CACHE_Z -4
#define RASTER3D_USE_CACHE_XY -5
#define RASTER3D_USE_CACHE_XZ -6
#define RASTER3D_USE_CACHE_YZ -7
#define RASTER3D_USE_CACHE_XYZ -8

#define RASTER3D_DEFAULT_WINDOW NULL

#define RASTER3D_DIRECTORY      "grid3"
#define RASTER3D_CELL_ELEMENT   "cell"
#define RASTER3D_CATS_ELEMENT   "cats"
#define RASTER3D_RANGE_ELEMENT  "range"
#define RASTER3D_HEADER_ELEMENT "cellhd"
#define RASTER3D_HISTORY_ELEMENT "hist"
#define RASTER3D_COLOR_ELEMENT  "color"
#define RASTER3D_COLOR2_DIRECTORY  "colr2"
#define RASTER3D_MASK_MAP       "RASTER3D_MASK"
#define RASTER3D_WINDOW_ELEMENT   "WIND3"
#define RASTER3D_DEFAULT_WINDOW_ELEMENT   "DEFAULT_WIND3"
#define RASTER3D_WINDOW_DATABASE "windows3d"
#define RASTER3D_PERMANENT_MAPSET "PERMANENT"

/*---------------------------------------------------------------------------*/

typedef struct
{

    double north, south;
    double east, west;
    double top, bottom;

    /* dimension of data in "cells"; rows == #x; cols == #y; depths == #z */
    int rows, cols, depths;

    double ns_res, ew_res, tb_res;

    int proj;			/* Projection (see gis.h) */
    int zone;			/* Projection zone (see gis.h) */

} RASTER3D_Region;

/*---------------------------------------------------------------------------*/

struct RASTER3D_Map;

typedef void resample_fn(struct RASTER3D_Map *, int, int, int, void *, int);

/*---------------------------------------------------------------------------*/

typedef struct RASTER3D_Map
{
	int version; /* The version of the raster 3D map layout */

    char *fileName;
    char *tempName;
    char *mapset;

    /* operation performed on map */
    int operation;		/* RASTER3D_WRITE_DATA or RASTER3D_READ_DATA */

    /* region */
    RASTER3D_Region region;

    /* window for map */
    RASTER3D_Region window;

    /* resmapling function used for map. default is nearest neighbor */
    resample_fn *resampleFun;

    /* units */
    char* unit;          /* space (U_METER, ...) */
    int vertical_unit; /* space or time (U_METER, ..., U_YEAR, ...) */

    /* dimension of a single tile in "cells" */
    int tileX, tileY, tileZ;

    /* # of tiles in x, y, and z direction */
    int nx, ny, nz;

    /* data file specific information */

    /* file descriptor */
    int data_fd;		/* file descriptor */

    /* type in which data is stored on file */
    int type;			/* DCELL_TYPE or FCELL_TYPE */

    /* data concering the compression */
    int precision;		/* RASTER3D_MAX_PRECISION or, 0 .. 23 for float, 
				   0 .. 52 for double */
    int compression;		/* RASTER3D_NO_COMPRESSION or RASTER3D_COMPRESSION */
    int useLzw;			/* RASTER3D_USE_LZW or RASTER3D_NO_LZW !!! only kept for backward compatibility */
    int useRle;			/* RASTER3D_USE_RLE or RASTER3D_NO_RLE !!! only kept for backward compatibility */
    int useXdr;			/* RASTER3D_USE_XDR or RASTER3D_NO_XDR !!! only kept for backward compatibility */

    /* pointer to first tile in file */
    int offset;

    /* pointer to the first index entry in file */
    long indexOffset;

    /* sizeof (long) of the system on which the file is/was written */
    int indexLongNbytes;

    /* max # bytes used in the representation of indices; this is equal to */
    /* # bytes used in the representation of "indexOffset" */
    int indexNbytesUsed;

    /* pointer to the last entry in the file */
    int fileEndPtr;

    /* indicates if index is stored in file; used for RASTER3D_READ_DATA only */
    int hasIndex;		/* RASTER3D_HAS_INDEX or RASTER3D_NO_INDEX */

    /* information concerning internal storage of data */

    /* index specific information */
    /* index[i] == the offset of tile "i" in the data file */
    long *index;

    /* tileLength[i] == # bytes used to store tile "i" */
    int *tileLength;

    /* tile specific information */

    /* type in which data is stored in memory */
    int typeIntern;		/* DCELL_TYPE or FCELL_TYPE */

    /* in non-cache mode the "data" array is used to store one tile */
    char *data;

    /* index of tile currently stored in "data"; -1 if none */
    int currentIndex;

    /* cache related variables */

    int useCache;		/* 1 if cache is used */
    void *cache;		/* pointer to cache structure */
    int cacheFD;		/* file descriptor of cache file -- write mode only */
    char *cacheFileName;	/* filename of cache file -- write mode only */
    long cachePosLast;		/* position of last entry in cache file -- write */
    /* mode only */

    /* range info */
    struct FPRange range;

    /* some constants stored for efficiency */

    /* number of bytes required to store a single value of "type" */
    int numLengthExtern;

    /* number of bytes required to store a single value of "typeIntern" */
    int numLengthIntern;

    /* see header.c for details */
    int clipX, clipY, clipZ;
    int tileXY, tileSize;
    int nxy, nTiles;

    /* mask related information */

    int useMask;		/* 1 if mask is used; 0 otherwise */

} RASTER3D_Map;

/*---------------------------------------------------------------------------*/

typedef struct
{

    char *elts;			/* ptr to array of elts */
    int nofElts;		/* size of "elts" */
    int eltSize;		/* size of elt in "elts" */

    int *names;			/* name[i] is the name of elts[i] */

    char *locks;		/* lock[i] == 1 iff elts[i] is locked
				   lock[i] == 0 iff elts[i] is unlocked but active
				   lock[i] == 2 iff elts[i] doesn't contain valid data */
    int autoLock;		/* 1 if auto locking is turned on */
    int nofUnlocked;		/* nof tiles which are unlocked */
    int minUnlocked;		/* min nof elts which have to remain unlocked. min = 1 */

    int *next, *prev;		/* prev/next pointers for fifo */
    int first, last;		/* index (into next) of first and last elt in fifo */
    /* first == -1 iff fifo is empty */

    int (*eltRemoveFun) ();	/* callback activated if the contents of an 
				   elt needs to be removed */
    void *eltRemoveFunData;	/* pointer to user data passed along with 
				   eltRemoveFun */
    int (*eltLoadFun) ();	/* callback activated to load contents of an elt */
    void *eltLoadFunData;	/* pointer to user data passed along with 
				   eltLoadFun */

    void *hash;			/* ptr to hashTable used to relate external names to
				   internal indices (elts) */

} RASTER3D_cache;

/*---------------------------------------------------------------------------*/

typedef struct
{

    int nofNames;
    int *index;
    char *active;
    int lastName;
    int lastIndex;
    int lastIndexActive;

} Rast3d_cache_hash;

/*---------------------------------------------------------------------------*/

/*Structures */
typedef struct _d_interval
{
    double low, high;
    int inf;
    struct _d_interval *next;
} d_Interval;

typedef struct _d_mask
{
    d_Interval *list;
} d_Mask;

/*---------------------------------------------------------------------------*/

typedef int write_fn(int, const void *, void *);
typedef int read_fn(int, void *, void *);

/*---------------------------------------------------------------------------*/
/* for storing values of 3D raster block in a flat array */
typedef struct
{
    DCELL *array;
    int sx;
    int sy;
    int sz;

} RASTER3D_Array_double;

#define RASTER3D_ARRAY_ACCESS(arr, x, y, z) \
    ((arr)->array[(arr)->sx * (arr)->sy * (z) + (arr)->sx * (y) + (x)])

/*============================== Prototypes ================================*/

#include <grass/defs/raster3d.h>

#endif /* #ifndef GRASS_RASTER3D_H */