GRASS Programmer's Manual  6.5.svn(2014)-r66266
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
G3d_intern.h
Go to the documentation of this file.
1 #include <rpc/types.h>
2 #include <rpc/xdr.h>
3 
4 /*---------------------------------------------------------------------------*/
5 
6 #include <grass/G3d.h>
7 #include <grass/gis.h>
8 
9 /*---------------------------------------------------------------------------*/
10 
11 #define G3D_LONG_LENGTH sizeof (long)
12 
13 #define G3D_XDR_INT_LENGTH 4
14 #define G3D_XDR_DOUBLE_LENGTH 8
15 #define G3D_XDR_FLOAT_LENGTH 4
16 
17 #define G3D_IS_CORRECT_TYPE(t) (((t) == FCELL_TYPE) || ((t) == DCELL_TYPE))
18 
19 #define G3D_WRITE_DATA 1
20 #define G3D_READ_DATA 0
21 
22 #define G3D_VALID_OPERATION(o) \
23  (((o) == G3D_WRITE_DATA) || ((o) == G3D_READ_DATA))
24 
25 #define G3D_MIN(a,b) ((a) <= (b) ? (a) : (b))
26 #define G3D_MAX(a,b) ((a) >= (b) ? (a) : (b))
27 
28 #define G3D_HAS_INDEX 1
29 #define G3D_NO_INDEX 0
30 
31 #define G3D_USE_XDR 1
32 #define G3D_NO_XDR 0
33 
34 #define G3D_VALID_XDR_OPTION(o) (((o) == G3D_USE_XDR) || ((o) == G3D_NO_XDR))
35 
36 /*---------------------------------------------------------------------------*/
37 
38 /* global arrays */
39 
40 extern void *tmpCompress; /* compression support array */
41 extern int tmpCompressLength; /* in bytes */
42 extern void *xdr; /* xdr support array */
43 extern int xdrLength; /* in bytes */
44 
45 /*---------------------------------------------------------------------------*/
46 
47 /* global variables */
48 
49 extern int g3d_do_compression; /* G3D_NO_COMPRESSION or G3D_COMPRESSION */
50 extern int g3d_do_lzw_compression; /* G3D_USE_LZW or G3D_NO_LZW */
51 extern int g3d_do_rle_compression; /* G3D_USE_RLE or G3D_NO_RLE */
52 extern int g3d_precision; /* G3D_ALLOW_PRECISION or G3D_NO_PRECISION */
53 extern int g3d_cache_default; /* in number of tiles; 0 ==> no cache */
54 extern int g3d_cache_max; /* in bytes */
55 extern int g3d_file_type; /* FCELL_TYPE or DCELL_TYPE */
56 extern int g3d_tile_dimension[3];
57 extern void (*g3d_error_fun) (const char *);
58 extern char *g3d_unit_default;
59 
60 extern G3D_Region g3d_window;
61 
62 /*---------------------------------------------------------------------------*/
63 
64 extern void G3d_fatalError(const char * /* msg */ , ...);
65 extern void G3d_fatalError_noargs(const char * /* msg */ );
66 
67 /*---------------------------------------------------------------------------*/
68 
69 /*---------------------------------------------------------------------------*/
70 
71 #define G3D_REGION_NORTH "North"
72 #define G3D_REGION_SOUTH "South"
73 #define G3D_REGION_EAST "East"
74 #define G3D_REGION_WEST "West"
75 #define G3D_REGION_TOP "Top"
76 #define G3D_REGION_BOTTOM "Bottom"
77 #define G3D_REGION_ROWS "nofRows"
78 #define G3D_REGION_COLS "nofCols"
79 #define G3D_REGION_DEPTHS "nofDepths"
80 #define G3D_REGION_PROJ "Proj"
81 #define G3D_REGION_ZONE "Zone"
82 #define G3D_REGION_EWRES "e-w resol"
83 #define G3D_REGION_NSRES "n-s resol"
84 #define G3D_REGION_TBRES "t-b resol"
int g3d_do_rle_compression
Definition: g3ddefaults.c:56
int g3d_precision
Definition: g3ddefaults.c:57
int g3d_cache_max
Definition: g3ddefaults.c:59
int g3d_do_compression
Definition: g3ddefaults.c:54
void * tmpCompress
Definition: g3d/header.c:12
int g3d_file_type
Definition: g3ddefaults.c:60
int g3d_cache_default
Definition: g3ddefaults.c:58
int g3d_tile_dimension[3]
Definition: g3ddefaults.c:61
int g3d_do_lzw_compression
Definition: g3ddefaults.c:55
int tmpCompressLength
Definition: g3d/header.c:13
void G3d_fatalError_noargs(const char *)
Definition: g3derror.c:70
void(* g3d_error_fun)(const char *)
Definition: g3ddefaults.c:63
G3D_Region g3d_window
Definition: g3dwindow.c:8
char * g3d_unit_default
Definition: g3ddefaults.c:64
void * xdr
Definition: g3d/header.c:14
int xdrLength
Definition: g3d/header.c:15
void G3d_fatalError(const char *,...)
This function prints the error message msg, and terminates the program with an error status...
Definition: g3derror.c:58