gis.h 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644
  1. /*
  2. *****************************************************************************
  3. *
  4. * MODULE: Grass Include Files
  5. * AUTHOR(S): Original author unknown - probably CERL
  6. * Justin Hickey - Thailand - jhickey@hpcc.nectec.or.th
  7. * PURPOSE: This file contains definitions of variables and data types
  8. * for use with most, if not all, Grass programs. This file is
  9. * usually included in every Grass program.
  10. * COPYRIGHT: (C) 2000 by the GRASS Development Team
  11. *
  12. * This program is free software under the GNU General Public
  13. * License (>=v2). Read the file COPYING that comes with GRASS
  14. * for details.
  15. *
  16. *****************************************************************************/
  17. #ifndef GRASS_GIS_H
  18. #define GRASS_GIS_H
  19. /*============================= Include Files ==============================*/
  20. /* System include files */
  21. #include <stdio.h>
  22. #include <stdarg.h>
  23. /* Grass and local include files */
  24. #include <grass/config.h>
  25. #include <grass/datetime.h>
  26. /*=========================== Constants/Defines ============================*/
  27. #if !defined __GNUC__ || __GNUC__ < 2
  28. #undef __attribute__
  29. #define __attribute__(x)
  30. #endif
  31. static const char *GRASS_copyright __attribute__ ((unused))
  32. = "GRASS GNU GPL licensed Software";
  33. #define GIS_H_VERSION "$Revision$"
  34. #define G_gisinit(pgm) G__gisinit(GIS_H_VERSION, (pgm))
  35. #define G_no_gisinit() G__no_gisinit(GIS_H_VERSION)
  36. /* Define TRUE and FALSE for boolean comparisons */
  37. #ifndef TRUE
  38. #define TRUE 1
  39. #endif
  40. #ifndef FALSE
  41. #define FALSE 0
  42. #endif
  43. #define MAXEDLINES 50
  44. #define RECORD_LEN 80
  45. #define NEWLINE '\n'
  46. #define RECLASS_TABLE 1
  47. #define RECLASS_RULES 2
  48. #define RECLASS_SCALE 3
  49. #define METERS 1
  50. #define FEET 2
  51. #define DEGREES 3
  52. #define CELL_TYPE 0
  53. #define FCELL_TYPE 1
  54. #define DCELL_TYPE 2
  55. #define PROJECTION_XY 0
  56. #define PROJECTION_UTM 1
  57. #define PROJECTION_SP 2
  58. #define PROJECTION_LL 3
  59. #define PROJECTION_OTHER 99
  60. #define PROJECTION_FILE "PROJ_INFO"
  61. #define UNIT_FILE "PROJ_UNITS"
  62. /* define PI and friends */
  63. #undef M_PI
  64. #define M_PI 3.14159265358979323846 /* pi */
  65. #undef M_PI_2
  66. #define M_PI_2 1.57079632679489661923 /* pi/2 */
  67. #undef M_PI_4
  68. #define M_PI_4 0.78539816339744830962 /* pi/4 */
  69. /* epsilon (IEEE: 2.220446e-16) */
  70. #define GRASS_EPSILON 1.0e-15
  71. /* Location of envariment variables */
  72. #define G_VAR_GISRC 0
  73. #define G_VAR_MAPSET 1
  74. /* Where to find/store variables */
  75. #define G_GISRC_MODE_FILE 0 /* files */
  76. #define G_GISRC_MODE_MEMORY 1 /* memory only */
  77. /* for G_parser() */
  78. #define TYPE_INTEGER 1
  79. #define TYPE_DOUBLE 2
  80. #define TYPE_STRING 3
  81. #define YES 1
  82. #define NO 0
  83. #define GISPROMPT_COLOR "old,color,color"
  84. /* File/directory name lengths */
  85. #define GNAME_MAX 256
  86. #define GMAPSET_MAX 256
  87. #define GPATH_MAX 4096
  88. /* Macros for type size independent integers */
  89. /* Use these for portability to ensure integers are truly 32bit */
  90. /* and are handled in a uniform manner */
  91. /* Convert integer to 4 bytes - little endian */
  92. #define serialize_int32_le(buf, x) do { \
  93. (buf)[0] = ((x) >> 0) & 0xFF; \
  94. (buf)[1] = ((x) >> 8) & 0xFF; \
  95. (buf)[2] = ((x) >> 16) & 0xFF; \
  96. (buf)[3] = ((x) >> 24) & 0xFF; \
  97. } while(0)
  98. /* Convert 4 bytes to an integer - little endian */
  99. #define deserialize_int32_le(buf) (((buf)[0] << 0) | \
  100. ((buf)[1] << 8) | \
  101. ((buf)[2] << 16) | \
  102. ((buf)[3] << 24))
  103. /* Convert integer to 4 bytes - big endian */
  104. #define serialize_int32_be(buf, x) do { \
  105. (buf)[0] = ((x) >> 24) & 0xFF; \
  106. (buf)[1] = ((x) >> 16) & 0xFF; \
  107. (buf)[2] = ((x) >> 8) & 0xFF; \
  108. (buf)[3] = ((x) >> 0) & 0xFF; \
  109. } while(0)
  110. /* Convert 4 bytes to an integer - big endian */
  111. #define deserialize_int32_be(buf) (((buf)[0] << 24) | \
  112. ((buf)[1] << 16) | \
  113. ((buf)[2] << 8) | \
  114. ((buf)[3] << 0))
  115. /* Cross-platform Directory Separator Character and null device stuff */
  116. #define GRASS_DIRSEP '/'
  117. #ifdef __MINGW32__
  118. # define HOST_DIRSEP '\\'
  119. # define G_DEV_NULL "NUL:"
  120. #else
  121. # define HOST_DIRSEP '/'
  122. # define G_DEV_NULL "/dev/null"
  123. #endif
  124. /**/ typedef enum
  125. {
  126. G_OPT_DB_WHERE, /* SQL where conditions */
  127. G_OPT_DB_TABLE, /* table name */
  128. G_OPT_DB_DRIVER, /* driver name */
  129. G_OPT_DB_DATABASE, /* database name */
  130. G_OPT_DB_COLUMN, /* one attr column */
  131. G_OPT_DB_COLUMNS, /* one or more attr columns */
  132. G_OPT_I_GROUP, /* old input imagery group */
  133. G_OPT_I_SUBGROUP, /* old input imagery subgroup */
  134. G_OPT_R_INPUT, /* old input raster map */
  135. G_OPT_R_INPUTS, /* old input raster maps */
  136. G_OPT_R_OUTPUT, /* new output raster map */
  137. G_OPT_R_MAP, /* old input raster map */
  138. G_OPT_R_MAPS, /* old input rasters map */
  139. G_OPT_R_BASE, /* old input base raster map */
  140. G_OPT_R_COVER, /* old input cover raster map */
  141. G_OPT_R_ELEV, /* old input elevation raster map */
  142. G_OPT_R_ELEVS, /* old input elevation raster maps */
  143. G_OPT_R3_INPUT, /* old input raster3d map */
  144. G_OPT_R3_INPUTS, /* old input raster3d maps */
  145. G_OPT_R3_OUTPUT, /* new output raster3d map */
  146. G_OPT_R3_MAP, /* old input raster3d map */
  147. G_OPT_R3_MAPS, /* old input raster3d maps */
  148. G_OPT_V_INPUT, /* old input vector map */
  149. G_OPT_V_INPUTS, /* old input vector maps */
  150. G_OPT_V_OUTPUT, /* new output vector map */
  151. G_OPT_V_MAP, /* old input vector map */
  152. G_OPT_V_MAPS, /* old input vector maps */
  153. G_OPT_V_TYPE, /* primitive type */
  154. G_OPT_V_FIELD, /* layer number (layers used to be called fields) */
  155. G_OPT_V_CAT, /* one category */
  156. G_OPT_V_CATS, /* more categories */
  157. G_OPT_F_INPUT, /* old input file */
  158. G_OPT_F_OUTPUT, /* new output file */
  159. G_OPT_F_SEP, /* data field separator */
  160. G_OPT_C_FG, /* foreground color */
  161. G_OPT_C_BG /* background color */
  162. } STD_OPT;
  163. /* Message format */
  164. #define G_INFO_FORMAT_STANDARD 0 /* GRASS_MESSAGE_FORMAT=standard or not defined */
  165. #define G_INFO_FORMAT_GUI 1 /* GRASS_MESSAGE_FORMAT=gui */
  166. #define G_INFO_FORMAT_SILENT 2 /* GRASS_MESSAGE_FORMAT=silent */
  167. #define G_INFO_FORMAT_PLAIN 3 /* GRASS_MESSAGE_FORMAT=plain */
  168. /* Icon types */
  169. #define G_ICON_CROSS 0
  170. #define G_ICON_BOX 1
  171. #define G_ICON_ARROW 2
  172. /* default colors */
  173. #define DEFAULT_FG_COLOR "black"
  174. #define DEFAULT_BG_COLOR "white"
  175. /* for G_get_raster_sample(), INTERP_TYPE */
  176. #define UNKNOWN 0
  177. #define NEAREST 1 /* nearest neighbor interpolation */
  178. #define BILINEAR 2 /* bilinear interpolation */
  179. #define CUBIC 3 /* cubic interpolation */
  180. /* for raster maps */
  181. #define GR_FATAL_EXIT 0
  182. #define GR_FATAL_PRINT 1
  183. #define GR_FATAL_RETURN 2
  184. /* Element types */
  185. enum
  186. { /* Dir */
  187. G_ELEMENT_RASTER = 1, /* cell */
  188. G_ELEMENT_RASTER3D = 2, /* 3dcell */
  189. G_ELEMENT_VECTOR = 3, /* vector */
  190. G_ELEMENT_OLDVECTOR = 4, /* GRASS < 5.7 vector */
  191. G_ELEMENT_ASCIIVECTOR = 5, /* ASCII vector */
  192. G_ELEMENT_ICON = 6, /* icon */
  193. G_ELEMENT_LABEL = 7, /* labels */
  194. G_ELEMENT_SITE = 8, /* sites */
  195. G_ELEMENT_REGION = 9, /* region */
  196. G_ELEMENT_REGION3D = 10, /* 3dregion */
  197. G_ELEMENT_GROUP = 11, /* group */
  198. G_ELEMENT_3DVIEW = 12 /* 3dview */
  199. };
  200. /*=========================== Typedefs/Structures ==========================*/
  201. typedef int CELL;
  202. typedef double DCELL;
  203. typedef float FCELL;
  204. typedef int RASTER_MAP_TYPE;
  205. /* for G_get_raster_sample() */
  206. typedef int INTERP_TYPE;
  207. struct Cell_head
  208. {
  209. int format; /* max numer of bytes per cell minus 1 */
  210. int compressed; /* 0 = uncompressed, 1 = compressed, -1 pre 3.0 */
  211. int rows; /* number of rows in the data 2D */
  212. int rows3; /* number of rows in the data 3D */
  213. int cols; /* number of columns in the data 2D */
  214. int cols3; /* number of columns in the data 3D */
  215. int depths; /* number of depths in data */
  216. int proj; /* Projection (see #defines above) */
  217. int zone; /* Projection zone */
  218. double ew_res; /* East to West cell size 2D */
  219. double ew_res3; /* East to West cell size 3D */
  220. double ns_res; /* North to South cell size 2D */
  221. double ns_res3; /* North to South cell size 3D */
  222. double tb_res; /* Top to Bottom cell size */
  223. double north; /* coordinates of layer */
  224. double south;
  225. double east;
  226. double west;
  227. double top;
  228. double bottom;
  229. };
  230. struct _Color_Value_
  231. {
  232. DCELL value;
  233. unsigned char red;
  234. unsigned char grn;
  235. unsigned char blu;
  236. };
  237. struct _Color_Rule_
  238. {
  239. struct _Color_Value_ low, high;
  240. struct _Color_Rule_ *next;
  241. struct _Color_Rule_ *prev;
  242. };
  243. struct _Color_Info_
  244. {
  245. struct _Color_Rule_ *rules;
  246. int n_rules;
  247. struct
  248. {
  249. unsigned char *red;
  250. unsigned char *grn;
  251. unsigned char *blu;
  252. unsigned char *set;
  253. int nalloc;
  254. int active;
  255. } lookup;
  256. struct
  257. {
  258. DCELL *vals;
  259. /* pointers to color rules corresponding to the intervals btwn vals */
  260. struct _Color_Rule_ **rules;
  261. int nalloc;
  262. int active;
  263. } fp_lookup;
  264. DCELL min, max;
  265. };
  266. struct Colors
  267. {
  268. int version; /* set by read_colors: -1=old,1=new */
  269. DCELL shift;
  270. int invert;
  271. int is_float; /* defined on floating point raster data? */
  272. int null_set; /* the colors for null are set? */
  273. unsigned char null_red;
  274. unsigned char null_grn;
  275. unsigned char null_blu;
  276. int undef_set; /* the colors for cells not in range are set? */
  277. unsigned char undef_red;
  278. unsigned char undef_grn;
  279. unsigned char undef_blu;
  280. struct _Color_Info_ fixed;
  281. struct _Color_Info_ modular;
  282. DCELL cmin;
  283. DCELL cmax;
  284. };
  285. typedef struct
  286. {
  287. unsigned char r, g, b, a; /* red, green, blue, and alpha */
  288. } RGBA_Color;
  289. typedef RGBA_Color RGB_Color;
  290. /* RGBA_Color alpha presets */
  291. #define RGBA_COLOR_OPAQUE 255
  292. #define RGBA_COLOR_TRANSPARENT 0
  293. #define RGBA_COLOR_NONE 0
  294. struct Reclass
  295. {
  296. char *name; /* name of raster map being reclassed */
  297. char *mapset; /* mapset in which "name" is found */
  298. int type; /* type of reclass */
  299. int num; /* size of reclass table */
  300. CELL min; /* table min */
  301. CELL max; /* table max */
  302. CELL *table; /* reclass table */
  303. };
  304. struct FPReclass_table
  305. {
  306. DCELL dLow; /* domain low */
  307. DCELL dHigh; /* domain high */
  308. DCELL rLow; /* range low */
  309. DCELL rHigh; /* range high */
  310. };
  311. /* reclass structure from double to double used by r.recode to reclass */
  312. /* between types: int to double, float to int,... */
  313. struct FPReclass
  314. {
  315. int defaultDRuleSet; /* 1 if default domain rule set */
  316. int defaultRRuleSet; /* 1 if default range rule set */
  317. int infiniteLeftSet; /* 1 if negative infinite interval rule exists */
  318. int infiniteRightSet; /* 1 if positive infinite interval rule exists */
  319. int rRangeSet; /* 1 if range range (i.e. interval) is set */
  320. int maxNofRules;
  321. int nofRules;
  322. DCELL defaultDMin; /* default domain minimum value */
  323. DCELL defaultDMax; /* default domain maximum value */
  324. DCELL defaultRMin; /* default range minimum value */
  325. DCELL defaultRMax; /* default range maximum value */
  326. DCELL infiniteDLeft; /* neg infinite rule */
  327. DCELL infiniteDRight; /* neg infinite rule */
  328. DCELL infiniteRLeft; /* pos infinite rule */
  329. DCELL infiniteRRight; /* pos infinite rule */
  330. DCELL dMin; /* minimum domain values in rules */
  331. DCELL dMax; /* maximum domain values in rules */
  332. DCELL rMin; /* minimum range values in rules */
  333. DCELL rMax; /* maximum range values in rules */
  334. struct FPReclass_table *table;
  335. };
  336. struct Quant_table
  337. {
  338. DCELL dLow;
  339. DCELL dHigh;
  340. CELL cLow;
  341. CELL cHigh;
  342. };
  343. struct Quant
  344. {
  345. int truncate_only;
  346. int round_only;
  347. int defaultDRuleSet;
  348. int defaultCRuleSet;
  349. int infiniteLeftSet;
  350. int infiniteRightSet;
  351. int cRangeSet;
  352. int maxNofRules;
  353. int nofRules;
  354. DCELL defaultDMin;
  355. DCELL defaultDMax;
  356. CELL defaultCMin;
  357. CELL defaultCMax;
  358. DCELL infiniteDLeft;
  359. DCELL infiniteDRight;
  360. CELL infiniteCLeft;
  361. CELL infiniteCRight;
  362. DCELL dMin;
  363. DCELL dMax;
  364. CELL cMin;
  365. CELL cMax;
  366. struct Quant_table *table;
  367. struct
  368. {
  369. DCELL *vals;
  370. /* pointers to quant rules corresponding to the intervals btwn vals */
  371. struct Quant_table **rules;
  372. int nalloc;
  373. int active;
  374. DCELL inf_dmin;
  375. DCELL inf_dmax;
  376. CELL inf_min;
  377. CELL inf_max;
  378. /* all values smaller than inf_dmin become inf_min */
  379. /* all values larger than inf_dmax become inf_max */
  380. /* inf_min and/or inf_max can be NULL if there are no inf rules */
  381. } fp_lookup;
  382. };
  383. struct Categories
  384. {
  385. CELL ncats; /* total number of categories */
  386. CELL num; /* the highest cell values. Only exists
  387. for backwards compatibility = (CELL)
  388. max_fp_values in quant rules */
  389. char *title; /* name of data layer */
  390. char *fmt; /* printf-like format to generate labels */
  391. float m1; /* Multiplication coefficient 1 */
  392. float a1; /* Addition coefficient 1 */
  393. float m2; /* Multiplication coefficient 2 */
  394. float a2; /* Addition coefficient 2 */
  395. struct Quant q; /* rules mapping cell values to index in
  396. list of labels */
  397. char **labels; /* array of labels of size num */
  398. int *marks; /* was the value with this label was used? */
  399. int nalloc;
  400. int last_marked_rule;
  401. /* NOTE: to get a rule corresponfing to cats.labels[i], use */
  402. /* G_get_ith_c/f/d_raster_cat (pcats, i, val1, val2) */
  403. /* it calls */
  404. /* G_quant_get_ith_rule(&cats->q, i, val1, val2, &index, &index); */
  405. /* and idex ==i, because rule is added at the same time as a */
  406. /* label, and quant rules are never reordered. Olga apr,95 */
  407. };
  408. struct History
  409. {
  410. char mapid[RECORD_LEN];
  411. char title[RECORD_LEN];
  412. char mapset[RECORD_LEN];
  413. char creator[RECORD_LEN];
  414. char maptype[RECORD_LEN];
  415. char datsrc_1[RECORD_LEN];
  416. char datsrc_2[RECORD_LEN];
  417. char keywrd[RECORD_LEN];
  418. int edlinecnt;
  419. char edhist[MAXEDLINES][RECORD_LEN];
  420. };
  421. struct Cell_stats
  422. {
  423. struct Cell_stats_node
  424. {
  425. int idx;
  426. long *count;
  427. int left;
  428. int right;
  429. } *node; /* tree of values */
  430. int tlen; /* allocated tree size */
  431. int N; /* number of actual nodes in tree */
  432. int curp;
  433. long null_data_count;
  434. int curoffset;
  435. };
  436. struct Histogram
  437. {
  438. int num;
  439. struct Histogram_list
  440. {
  441. CELL cat;
  442. long count;
  443. } *list;
  444. };
  445. struct Range
  446. {
  447. CELL min;
  448. CELL max;
  449. int first_time; /* whether or not range was updated */
  450. };
  451. struct FPRange
  452. {
  453. DCELL min;
  454. DCELL max;
  455. int first_time; /* whether or not range was updated */
  456. };
  457. struct FP_stats {
  458. int geometric;
  459. int flip;
  460. int count;
  461. DCELL min, max;
  462. unsigned long *stats;
  463. unsigned long total;
  464. };
  465. /*
  466. ** Structure for I/O of 3dview files (view.c)
  467. */
  468. struct G_3dview
  469. {
  470. char pgm_id[40]; /* user-provided identifier */
  471. float from_to[2][3]; /* eye position & lookat position */
  472. float fov; /* field of view */
  473. float twist; /* right_hand rotation about from_to */
  474. float exag; /* terrain elevation exageration */
  475. int mesh_freq; /* cells per grid line */
  476. int poly_freq; /* cells per polygon */
  477. int display_type; /* 1 for mesh, 2 for poly, 3 for both */
  478. int lightson; /* boolean */
  479. int dozero; /* boolean */
  480. int colorgrid; /* boolean */
  481. int shading; /* boolean */
  482. int fringe; /* boolean */
  483. int surfonly; /* boolean */
  484. int doavg; /* boolean */
  485. char grid_col[40]; /* colors */
  486. char bg_col[40]; /* colors */
  487. char other_col[40]; /* colors */
  488. float lightpos[4]; /* east, north, height, 1.0 for local 0.0 infin */
  489. float lightcol[3]; /* values between 0.0 to 1.0 for red, grn, blu */
  490. float ambient;
  491. float shine;
  492. struct Cell_head vwin;
  493. };
  494. struct Key_Value
  495. {
  496. int nitems;
  497. int nalloc;
  498. char **key;
  499. char **value;
  500. };
  501. struct Option /* Structure that stores option info */
  502. {
  503. const char *key; /* Key word used on command line */
  504. int type; /* Option type */
  505. int required; /* REQUIRED or OPTIONAL */
  506. int multiple; /* Multiple entries OK */
  507. const char *options; /* Approved values or range or NULL */
  508. const char **opts; /* NULL or NULL terminated array of parsed options */
  509. const char *key_desc; /* one word describing the key */
  510. const char *label; /* Optional short label, used in GUI as item label */
  511. const char *description; /* String describing option */
  512. const char *descriptions; /* ';' separated pairs of option and option descriptions */
  513. /* For example: (with ->options = "break,rmdupl")
  514. * "break;break lines on intersections;"
  515. * "rmdupl;remove duplicates"
  516. */
  517. const char **descs; /* parsed descriptions, array of either NULL or string */
  518. /* in the same order as options */
  519. char *answer; /* Option answer */
  520. const char *def; /* Where original answer gets saved */
  521. char **answers; /* Option answers (for multiple=YES) */
  522. struct Option *next_opt; /* Pointer to next option struct */
  523. const char *gisprompt; /* Interactive prompt guidance */
  524. const char *guisection; /* GUI Layout guidance: ';' delimited heirarchical tree position */
  525. int (*checker) (); /* Routine to check answer or NULL */
  526. int count;
  527. };
  528. struct Flag /* Structure that stores flag info */
  529. {
  530. char key; /* Key char used on command line */
  531. char answer; /* Stores flag state: 0/1 */
  532. const char *label; /* Optional short label, used in GUI as item label */
  533. const char *description; /* String describing flag meaning */
  534. const char *guisection; /* GUI Layout guidance: ';' delimited heirarchical tree position */
  535. struct Flag *next_flag; /* Pointer to next flag struct */
  536. };
  537. struct GModule /* Structure that stores module info */
  538. {
  539. const char *label; /* Optional short description for GUI */
  540. const char *description; /* String describing module */
  541. const char *keywords; /* Keywords describing module */
  542. /* further items are possible: author(s), version */
  543. int overwrite; /* overwrite old files */
  544. int verbose; /* print all informations about progress and so on */
  545. };
  546. struct TimeStamp
  547. {
  548. DateTime dt[2]; /* two datetimes */
  549. int count;
  550. };
  551. struct GDAL_link;
  552. /*============================== Prototypes ================================*/
  553. /* Since there are so many prototypes for the gis library they are stored */
  554. /* in the file gisdefs.h */
  555. #include <grass/gisdefs.h>
  556. #endif /* GRASS_GIS_H */