34 #if !defined __GNUC__ || __GNUC__ < 2
36 #define __attribute__(x)
44 #if (defined(__GNUC__) || defined(__APPLE__)) && !defined(_MSC_VER)
45 #define UNUSED __attribute__((unused))
50 static const char *GRASS_copyright
UNUSED =
"GRASS GNU GPL licensed Software";
56 #if (defined(__GNUC__) && __GNUC__ >= 7) || \
57 (defined(__clang__) && __clang_major__ >= 12)
58 #define FALLTHROUGH __attribute__((__fallthrough__))
60 #define FALLTHROUGH ((void)0)
66 #define GIS_H_VERSION GRASS_HEADERS_VERSION
70 #define GIS_H_DATE GRASS_HEADERS_DATE
72 #define G_gisinit(pgm) G__gisinit(GIS_H_VERSION, (pgm))
73 #define G_no_gisinit() G__no_gisinit(GIS_H_VERSION)
89 #define HOST_NEWLINE "\r\n"
91 #define HOST_NEWLINE "\n"
95 #if __GNUC__ && (__GNUC__ >= 3 && __GNUC_MINOR__ >= 4)
96 #define WARN_UNUSED_RESULT __attribute__((warn_unused_result))
98 #define WARN_UNUSED_RESULT
104 #define U_UNDEFINED -1
108 #define U_KILOMETERS 3
116 #define U_YEARS DATETIME_YEAR
117 #define U_MONTHS DATETIME_MONTH
118 #define U_DAYS DATETIME_DAY
119 #define U_HOURS DATETIME_HOUR
120 #define U_MINUTES DATETIME_MINUTE
121 #define U_SECONDS DATETIME_SECOND
124 #define PROJECTION_XY 0
126 #define PROJECTION_UTM 1
128 #define PROJECTION_SP 2
130 #define PROJECTION_LL 3
132 #define PROJECTION_OTHER 99
134 #define PROJECTION_FILE "PROJ_INFO"
135 #define UNIT_FILE "PROJ_UNITS"
136 #define EPSG_FILE "PROJ_EPSG"
137 #define WKT_FILE "PROJ_WKT"
138 #define SRID_FILE "PROJ_SRID"
141 #define CONFIG_DIR "GRASS8"
143 #define CONFIG_DIR ".grass8"
149 #define MAX(a, b) ((a) > (b) ? (a) : (b))
154 #define MIN(a, b) ((a) < (b) ? (a) : (b))
158 #define M_PI 3.14159265358979323846
161 #define M_PI_2 1.57079632679489661923
164 #define M_PI_4 0.78539816339744830962
167 #define M_R2D 57.295779513082320877
170 #define M_D2R 0.017453292519943295769
173 #define GRASS_EPSILON 1.0e-15
176 #define G_VAR_GISRC 0
177 #define G_VAR_MAPSET 1
180 #define G_GISRC_MODE_FILE 0
181 #define G_GISRC_MODE_MEMORY 1
184 #define TYPE_INTEGER 1
185 #define TYPE_DOUBLE 2
186 #define TYPE_STRING 3
191 #define GNAME_MAX 256
192 #define GMAPSET_MAX 256
194 #define GPATH_MAX 4096
197 #define GBASENAME_SEP "_"
204 #define serialize_int32_le(buf, x) \
206 (buf)[0] = ((x) >> 0) & 0xFF; \
207 (buf)[1] = ((x) >> 8) & 0xFF; \
208 (buf)[2] = ((x) >> 16) & 0xFF; \
209 (buf)[3] = ((x) >> 24) & 0xFF; \
213 #define deserialize_int32_le(buf) \
214 (((buf)[0] << 0) | ((buf)[1] << 8) | ((buf)[2] << 16) | ((buf)[3] << 24))
217 #define serialize_int32_be(buf, x) \
219 (buf)[0] = ((x) >> 24) & 0xFF; \
220 (buf)[1] = ((x) >> 16) & 0xFF; \
221 (buf)[2] = ((x) >> 8) & 0xFF; \
222 (buf)[3] = ((x) >> 0) & 0xFF; \
226 #define deserialize_int32_be(buf) \
227 (((buf)[0] << 24) | ((buf)[1] << 16) | ((buf)[2] << 8) | ((buf)[3] << 0))
230 #define GRASS_DIRSEP '/'
232 #define HOST_DIRSEP '\\'
233 #define G_DEV_NULL "NUL:"
235 #define HOST_DIRSEP '/'
236 #define G_DEV_NULL "/dev/null"
387 #define G_INFO_FORMAT_STANDARD \
389 #define G_INFO_FORMAT_GUI 1
390 #define G_INFO_FORMAT_SILENT 2
391 #define G_INFO_FORMAT_PLAIN 3
394 #define G_ICON_CROSS 0
396 #define G_ICON_ARROW 2
399 #define DEFAULT_FG_COLOR "black"
400 #define DEFAULT_BG_COLOR "white"
401 #define DEFAULT_COLOR_TABLE "viridis"
404 #define G_FATAL_EXIT 0
405 #define G_FATAL_PRINT 1
406 #define G_FATAL_RETURN 2
409 #define ENDIAN_LITTLE 0
411 #define ENDIAN_OTHER 2
417 #define GV_KEY_COLUMN "cat"
634 #include <sys/types.h>
636 #elif defined(__MINGW32__)
638 #elif HAVE_LONG_LONG_INT
640 #elif HAVE_LARGEFILES
643 #error "no 64 bit integer available"
STD_OPT
Standard option identifiers (enum)
@ G_OPT_R_BASENAME_OUTPUT
@ G_OPT_R3_TILE_DIMENSION
#define UNUSED
A macro for an attribute, if attached to a variable, indicating that the variable is not used.
STD_FLG
Standard flag identifiers (enum)
2D/3D raster map header (used also for region)
int cols3
Number of columns for 3D data.
double ew_res
Resolution - east to west cell size for 2D data.
double north
Extent coordinates (north)
double bottom
Extent coordinates (bottom) - 3D data.
int compressed
Compression mode (raster header only)
int format
Max number of bytes per raster data value minus 1 (raster header only)
int zone
Projection zone (UTM)
int depths
number of depths for 3D data
double east
Extent coordinates (east)
double ew_res3
Resolution - east to west cell size for 3D data.
double ns_res
Resolution - north to south cell size for 2D data.
double ns_res3
Resolution - north to south cell size for 3D data.
double top
Extent coordinates (top) - 3D data.
int rows3
Number of rows for 3D data.
int rows
Number of rows for 2D data.
int cols
Number of columns for 2D data.
double south
Extent coordinates (south)
double tb_res
Resolution - top to bottom cell size for 3D data.
double west
Extent coordinates (west)
struct _Color_Info_ fixed
struct _Color_Info_ modular
Structure that stores flag info.
Structure that stores module info.
Structure that stores option information.
int(* checker)(const char *)
const char * descriptions
const char * guidependency
struct _Color_Info_::@3 lookup
struct _Color_Info_::@4 fp_lookup
struct _Color_Rule_ * rules
struct _Color_Rule_ ** rules
struct _Color_Rule_ * prev
struct _Color_Rule_ * next
struct _Color_Value_ low high
int n_values
Number of values in the list.
int * value
Array of values.
int alloc_values
Allocated space for values.