gis.h 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841
  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 the prototypes for all the functions in the
  8. * gis library (src/libes/gis).
  9. * COPYRIGHT: (C) 2000 by the GRASS Development Team
  10. *
  11. * This program is free software under the GNU General Public
  12. * License (>=v2). Read the file COPYING that comes with GRASS
  13. * for details.
  14. *
  15. *****************************************************************************/
  16. #ifndef GRASS_GISDEFS_H
  17. #define GRASS_GISDEFS_H
  18. /*============================= Include Files ==============================*/
  19. /* none */
  20. /*=========================== Constants/Defines ============================*/
  21. /* none (look in gis.h) */
  22. /*=========================== Typedefs/Structures ==========================*/
  23. /* none (look in gis.h) */
  24. /*============================== Prototypes ================================*/
  25. #include <grass/config.h>
  26. #ifdef __GNUC__
  27. # ifdef __MINGW32__
  28. # include <malloc.h>
  29. # else
  30. # if (defined(__unix__) || defined(unix)) && !defined(USG)
  31. # include <sys/param.h>
  32. # endif
  33. # if (defined(BSD))
  34. /* no malloc.h, no alloca.h ?
  35. * TODO: better
  36. * check if alloca.h exists,
  37. * if not, check if malloc.h exists,
  38. * if not use stdlib.h */
  39. # include <stdlib.h>
  40. # else
  41. # include <alloca.h>
  42. # endif
  43. # endif
  44. # define G_alloca(n) alloca(n)
  45. # define G_freea(p)
  46. #else
  47. # define G_alloca(n) G_malloc(n)
  48. # define G_freea(p) G_free(p)
  49. #endif
  50. #include <stdarg.h>
  51. #include <stdio.h>
  52. #ifndef CTYPESGEN
  53. #include <setjmp.h>
  54. #endif
  55. #include <sys/types.h>
  56. #include <sys/stat.h>
  57. #ifndef RELDIR
  58. #define RELDIR "?"
  59. #endif
  60. /* adj_cellhd.c */
  61. void G_adjust_Cell_head(struct Cell_head *, int, int);
  62. void G_adjust_Cell_head3(struct Cell_head *, int, int, int);
  63. int G_adjust_window_ll(struct Cell_head *cellhd);
  64. /* alloc.c */
  65. #define G_incr_void_ptr(ptr, size) \
  66. ((void *)((const unsigned char *)(ptr) + (size)))
  67. void *G__malloc(const char *, int, size_t);
  68. void *G__calloc(const char *, int, size_t, size_t);
  69. void *G__realloc(const char *, int, void *, size_t);
  70. void G_free(void *);
  71. #ifndef G_incr_void_ptr
  72. void *G_incr_void_ptr(const void *, size_t);
  73. #endif
  74. #ifndef CTYPESGEN
  75. #define G_malloc(n) G__malloc(RELDIR "/" __FILE__, __LINE__, (n))
  76. #define G_calloc(m, n) G__calloc(RELDIR "/" __FILE__, __LINE__, (m), (n))
  77. #define G_realloc(p, n) G__realloc(RELDIR "/" __FILE__, __LINE__, (p), (n))
  78. #else
  79. #define G_malloc(n) G__malloc("<ctypesgen>", 0, (n))
  80. #define G_calloc(m, n) G__calloc("<ctypesgen>", 0, (m), (n))
  81. #define G_realloc(p, n) G__realloc("<ctypesgen>", 0, (p), (n))
  82. #endif
  83. /* area.c */
  84. int G_begin_cell_area_calculations(void);
  85. double G_area_of_cell_at_row(int);
  86. int G_begin_polygon_area_calculations(void);
  87. double G_area_of_polygon(const double *, const double *, int);
  88. /* area_ellipse.c */
  89. void G_begin_zone_area_on_ellipsoid(double, double, double);
  90. double G_darea0_on_ellipsoid(double);
  91. double G_area_for_zone_on_ellipsoid(double, double);
  92. /* area_poly1.c */
  93. void G_begin_ellipsoid_polygon_area(double, double);
  94. double G_ellipsoid_polygon_area(const double *, const double *, int);
  95. /* area_poly2.c */
  96. double G_planimetric_polygon_area(const double *, const double *, int);
  97. /* area_sphere.c */
  98. void G_begin_zone_area_on_sphere(double, double);
  99. double G_darea0_on_sphere(double);
  100. double G_area_for_zone_on_sphere(double, double);
  101. /* ascii_chk.c */
  102. void G_ascii_check(char *);
  103. /* asprintf.c */
  104. /* Do it better if you know how */
  105. /* asprintf is not found on MINGW but exists */
  106. /*
  107. * Because configure script in GDAL test is G_asprintf exists in gis lib
  108. * the G_asprintf macro is disabled until a stable version of GDAL
  109. * with a different function becomes widely used
  110. */
  111. int G_vasprintf(char **, const char *, va_list);
  112. int G_asprintf(char **, const char *, ...)
  113. __attribute__ ((format(printf, 2, 3)));
  114. int G_rasprintf(char **, size_t *,const char *, ...)
  115. __attribute__ ((format(printf, 3, 4)));
  116. /* basename.c */
  117. char *G_basename(char *, const char *);
  118. size_t G_get_num_decimals(const char *);
  119. char *G_double_to_basename_format(double, size_t, size_t);
  120. char *G_get_basename_separator();
  121. char *G_join_basename_strings(const char**, size_t);
  122. char *G_generate_basename(const char*, double, size_t, size_t);
  123. /* bres_line.c */
  124. void G_bresenham_line(int, int, int, int, int (*)(int, int));
  125. /* clicker.c */
  126. void G_clicker(void);
  127. /* color_rules.c */
  128. char *G_color_rules_options(void);
  129. char *G_color_rules_descriptions(void);
  130. void G_list_color_rules(FILE *);
  131. int G_find_color_rule(const char *);
  132. /* color_str.c */
  133. int G_num_standard_colors(void);
  134. /* commas.c */
  135. int G_insert_commas(char *);
  136. void G_remove_commas(char *);
  137. /* compress.c */
  138. int G_compressor_number(char *);
  139. char *G_compressor_name(int);
  140. int G_check_compressor(int);
  141. int G_write_compressed(int, unsigned char *, int, int);
  142. int G_write_unompressed(int, unsigned char *, int);
  143. int G_read_compressed(int, int, unsigned char *, int, int);
  144. int G_compress(unsigned char *, int, unsigned char *, int, int);
  145. int G_expand(unsigned char *, int, unsigned char *, int, int);
  146. /* compress.c : no compression */
  147. int
  148. G_no_compress(unsigned char *src, int src_sz, unsigned char *dst,
  149. int dst_sz);
  150. int
  151. G_no_expand(unsigned char *src, int src_sz, unsigned char *dst,
  152. int dst_sz);
  153. /* cmprrle.c : Run Length Encoding (RLE) */
  154. int
  155. G_rle_compress(unsigned char *src, int src_sz, unsigned char *dst,
  156. int dst_sz);
  157. int
  158. G_rle_expand(unsigned char *src, int src_sz, unsigned char *dst,
  159. int dst_sz);
  160. /* cmprzlib.c : ZLIB's DEFLATE */
  161. int
  162. G_zlib_compress(unsigned char *src, int src_sz, unsigned char *dst,
  163. int dst_sz);
  164. int
  165. G_zlib_expand(unsigned char *src, int src_sz, unsigned char *dst,
  166. int dst_sz);
  167. /* cmprlz4.c : LZ4, extremely fast */
  168. int
  169. G_lz4_compress(unsigned char *src, int src_sz, unsigned char *dst,
  170. int dst_sz);
  171. int
  172. G_lz4_expand(unsigned char *src, int src_sz, unsigned char *dst,
  173. int dst_sz);
  174. /* cmprbzip.c : BZIP2, high compression, faster than ZLIB's DEFLATE with level 9 */
  175. int
  176. G_bz2_compress(unsigned char *src, int src_sz, unsigned char *dst,
  177. int dst_sz);
  178. int
  179. G_bz2_expand(unsigned char *src, int src_sz, unsigned char *dst,
  180. int dst_sz);
  181. /* add more compression methods here */
  182. /* copy_dir.c */
  183. int G_recursive_copy(const char *, const char *);
  184. /* copy_file.c */
  185. int G_copy_file(const char *, const char *);
  186. /* counter.c */
  187. int G_is_initialized(int *);
  188. void G_initialize_done(int *);
  189. void G_init_counter(struct Counter *, int);
  190. int G_counter_next(struct Counter *);
  191. /* date.c */
  192. const char *G_date(void);
  193. /* datum.c */
  194. int G_get_datum_by_name(const char *);
  195. const char *G_datum_name(int);
  196. const char *G_datum_description(int);
  197. const char *G_datum_ellipsoid(int);
  198. int G_get_datumparams_from_projinfo(const struct Key_Value *, char *, char *);
  199. void G_read_datum_table(void);
  200. /* debug.c */
  201. void G_init_debug(void);
  202. int G_debug(int, const char *, ...) __attribute__ ((format(printf, 2, 3)));
  203. /* distance.c */
  204. int G_begin_distance_calculations(void);
  205. double G_distance(double, double, double, double);
  206. double G_distance_between_line_segments(double, double, double, double,
  207. double, double, double, double);
  208. double G_distance_point_to_line_segment(double, double, double, double,
  209. double, double);
  210. /* done_msg.c */
  211. void G_done_msg(const char *, ...) __attribute__ ((format(printf, 1, 2)));
  212. /* endian.c */
  213. int G_is_little_endian(void);
  214. /* env.c */
  215. void G_init_env(void);
  216. const char *G_getenv(const char *);
  217. const char *G_getenv2(const char *, int);
  218. const char *G_getenv_nofatal(const char *);
  219. const char *G_getenv_nofatal2(const char *, int);
  220. void G_setenv(const char *, const char *);
  221. void G_setenv2(const char *, const char *, int);
  222. void G_setenv_nogisrc(const char *, const char *);
  223. void G_setenv_nogisrc2(const char *, const char *, int);
  224. void G_unsetenv(const char *);
  225. void G_unsetenv2(const char *, int);
  226. const char *G_get_env_name(int);
  227. void G_set_gisrc_mode(int);
  228. int G_get_gisrc_mode(void);
  229. void G_create_alt_env(void);
  230. void G_switch_env(void);
  231. void G__read_mapset_env(void);
  232. void G__read_gisrc_env(void);
  233. /* error.c */
  234. #ifndef CTYPESGEN
  235. jmp_buf *G_fatal_longjmp(int);
  236. #endif
  237. int G_info_format(void);
  238. void G_message(const char *, ...) __attribute__ ((format(printf, 1, 2)));
  239. void G_verbose_message(const char *, ...)
  240. __attribute__ ((format(printf, 1, 2)));
  241. void G_important_message(const char *, ...)
  242. __attribute__ ((format(printf, 1, 2)));
  243. void G_fatal_error(const char *, ...) __attribute__ ((format(printf, 1, 2)))
  244. __attribute__ ((noreturn));
  245. void G_warning(const char *, ...) __attribute__ ((format(printf, 1, 2)));
  246. int G_suppress_warnings(int);
  247. int G_sleep_on_error(int);
  248. void G_set_error_routine(int (*)(const char *, int));
  249. void G_unset_error_routine(void);
  250. void G_init_logging(void);
  251. /* file_name.c */
  252. char *G_file_name(char *, const char *, const char *, const char *);
  253. char *G_file_name_misc(char *, const char *, const char *, const char *,
  254. const char *);
  255. char *G_file_name_tmp(char *, const char *, const char *, const char *);
  256. /* find_file.c */
  257. const char *G_find_file(const char *, char *, const char *);
  258. const char *G_find_file2(const char *, const char *, const char *);
  259. const char *G_find_file_misc(const char *, const char *, char *, const char *);
  260. const char *G_find_file2_misc(const char *, const char *, const char *,
  261. const char *);
  262. /* find_etc.c */
  263. char *G_find_etc(const char *);
  264. /* find_rast.c */
  265. const char *G_find_raster(char *, const char *);
  266. const char *G_find_raster2(const char *, const char *);
  267. /* find_rast3d.c */
  268. const char *G_find_raster3d(const char *, const char *);
  269. /* find_vect.c */
  270. const char *G_find_vector(char *, const char *);
  271. const char *G_find_vector2(const char *, const char *);
  272. /* geodesic.c */
  273. int G_begin_geodesic_equation(double, double, double, double);
  274. double G_geodesic_lat_from_lon(double);
  275. /* geodist.c */
  276. void G_begin_geodesic_distance(double, double);
  277. void G_set_geodesic_distance_lat1(double);
  278. void G_set_geodesic_distance_lat2(double);
  279. double G_geodesic_distance_lon_to_lon(double, double);
  280. double G_geodesic_distance(double, double, double, double);
  281. /* get_ellipse.c */
  282. int G_get_ellipsoid_parameters(double *, double *);
  283. int G_get_spheroid_by_name(const char *, double *, double *, double *);
  284. int G_get_ellipsoid_by_name(const char *, double *, double *);
  285. const char *G_ellipsoid_name(int);
  286. const char *G_ellipsoid_description(int);
  287. int G_read_ellipsoid_table(int);
  288. /* get_projinfo.c */
  289. struct Key_Value *G_get_projunits(void);
  290. struct Key_Value *G_get_projinfo(void);
  291. struct Key_Value *G_get_projepsg(void);
  292. /* get_window.c */
  293. void G_get_window(struct Cell_head *);
  294. void G_get_default_window(struct Cell_head *);
  295. void G_get_element_window(struct Cell_head *, const char *, const char *,
  296. const char *);
  297. /* getl.c */
  298. int G_getl(char *, int, FILE *);
  299. int G_getl2(char *, int, FILE *);
  300. /* gisbase.c */
  301. const char *G_gisbase(void);
  302. /* gisdbase.c */
  303. const char *G_gisdbase(void);
  304. /* gisinit.c */
  305. void G__gisinit(const char *, const char *);
  306. void G__no_gisinit(const char *);
  307. void G_init_all(void);
  308. /* handler.c */
  309. void G_add_error_handler(void (*)(void *), void *);
  310. void G_remove_error_handler(void (*)(void *), void *);
  311. /* home.c */
  312. const char *G_home(void);
  313. const char *G_config_path(void);
  314. /* ilist.c */
  315. void G_init_ilist(struct ilist *);
  316. void G_free_ilist(struct ilist *);
  317. struct ilist * G_new_ilist();
  318. void G_ilist_add(struct ilist *, int);
  319. /* intersect.c */
  320. int G_intersect_line_segments(double, double, double, double, double, double,
  321. double, double, double *, double *, double *,
  322. double *);
  323. /* is.c */
  324. int G_is_gisbase(const char *);
  325. int G_is_location(const char *);
  326. int G_is_mapset(const char *);
  327. /* key_value1.c */
  328. struct Key_Value *G_create_key_value(void);
  329. void G_set_key_value(const char *, const char *, struct Key_Value *);
  330. const char *G_find_key_value(const char *, const struct Key_Value *);
  331. void G_free_key_value(struct Key_Value *);
  332. /* key_value2.c */
  333. int G_fwrite_key_value(FILE *, const struct Key_Value *);
  334. struct Key_Value *G_fread_key_value(FILE *);
  335. /* key_value3.c */
  336. void G_write_key_value_file(const char *, const struct Key_Value *);
  337. struct Key_Value *G_read_key_value_file(const char *);
  338. /* key_value4.c */
  339. void G_update_key_value_file(const char *, const char *, const char *);
  340. int G_lookup_key_value_from_file(const char *, const char *, char[], int);
  341. /* legal_name.c */
  342. int G_legal_filename(const char *);
  343. int G_check_input_output_name(const char *, const char *, int);
  344. /* line_dist.c */
  345. void G_set_distance_to_line_tolerance(double);
  346. double G_distance2_point_to_line(double, double, double, double, double,
  347. double);
  348. /* list.c */
  349. void G_list_element(const char *, const char *, const char *,
  350. int (*)(const char *, const char *, const char *));
  351. char **G_list(int, const char *, const char *, const char *);
  352. void G_free_list(char **);
  353. /* ll_format.c */
  354. void G_lat_format(double, char *);
  355. const char *G_lat_format_string(void);
  356. void G_lon_format(double, char *);
  357. const char *G_lon_format_string(void);
  358. void G_llres_format(double, char *);
  359. const char *G_llres_format_string(void);
  360. void G_lat_parts(double, int *, int *, double *, char *);
  361. void G_lon_parts(double, int *, int *, double *, char *);
  362. /* ll_scan.c */
  363. int G_lat_scan(const char *, double *);
  364. int G_lon_scan(const char *, double *);
  365. int G_llres_scan(const char *, double *);
  366. /* location.c */
  367. const char *G_location(void);
  368. char *G_location_path(void);
  369. /* lrand48.c */
  370. void G_srand48(long);
  371. long G_srand48_auto(void);
  372. long G_lrand48(void);
  373. long G_mrand48(void);
  374. double G_drand48(void);
  375. /* ls.c */
  376. void G_set_ls_filter(int (*)(const char *, void *), void *);
  377. void G_set_ls_exclude_filter(int (*)(const char *, void *), void *);
  378. char **G_ls2(const char *, int *);
  379. void G_ls(const char *, FILE *);
  380. void G_ls_format(char **, int, int, FILE *);
  381. /* ls_filter.c */
  382. #ifdef HAVE_REGEX_H
  383. void *G_ls_regex_filter(const char *, int, int, int);
  384. void *G_ls_glob_filter(const char *, int, int);
  385. void G_free_ls_filter(void *);
  386. #endif
  387. /* make_loc.c */
  388. int G_make_location(const char *, struct Cell_head *, const struct Key_Value *,
  389. const struct Key_Value *);
  390. int G_compare_projections(const struct Key_Value *, const struct Key_Value *,
  391. const struct Key_Value *, const struct Key_Value *);
  392. /* make_mapset.c */
  393. int G_make_mapset(const char *, const char *, const char *);
  394. /* mapcase.c */
  395. char *G_tolcase(char *);
  396. char *G_toucase(char *);
  397. /* mapset.c */
  398. const char *G_mapset(void);
  399. char *G_mapset_path(void);
  400. /* mapset_msc.c */
  401. int G_make_mapset_element(const char *);
  402. int G_make_mapset_element_tmp(const char *);
  403. int G__make_mapset_element_misc(const char *, const char *);
  404. int G_mapset_permissions(const char *);
  405. int G_mapset_permissions2(const char *, const char *, const char *);
  406. /* mapset_nme.c */
  407. const char *G_get_mapset_name(int);
  408. void G_create_alt_search_path(void);
  409. void G_switch_search_path(void);
  410. void G_reset_mapsets(void);
  411. char **G_get_available_mapsets(void);
  412. void G_add_mapset_to_search_path(const char *);
  413. int G_is_mapset_in_search_path(const char *);
  414. /* myname.c */
  415. char *G_myname(void);
  416. /* named_colr.c */
  417. int G_color_values(const char *, float *, float *, float *);
  418. const char *G_color_name(int);
  419. /* nl_to_spaces.c */
  420. void G_newlines_to_spaces(char *);
  421. /* nme_in_mps.c */
  422. int G_name_is_fully_qualified(const char *, char *, char *);
  423. char *G_fully_qualified_name(const char *, const char *);
  424. int G_unqualified_name(const char *, const char *, char *, char *);
  425. /* open.c */
  426. int G_open_new(const char *, const char *);
  427. int G_open_old(const char *, const char *, const char *);
  428. int G_open_update(const char *, const char *);
  429. FILE *G_fopen_new(const char *, const char *);
  430. FILE *G_fopen_old(const char *, const char *, const char *);
  431. FILE *G_fopen_append(const char *, const char *);
  432. FILE *G_fopen_modify(const char *, const char *);
  433. /* open_misc.c */
  434. int G_open_new_misc(const char *, const char *, const char *);
  435. int G_open_old_misc(const char *, const char *, const char *, const char *);
  436. int G_open_update_misc(const char *, const char *, const char *);
  437. FILE *G_fopen_new_misc(const char *, const char *, const char *);
  438. FILE *G_fopen_old_misc(const char *, const char *, const char *,
  439. const char *);
  440. FILE *G_fopen_append_misc(const char *, const char *, const char *);
  441. FILE *G_fopen_modify_misc(const char *, const char *, const char *);
  442. /* overwrite.c */
  443. int G_check_overwrite(int argc, char **argv);
  444. /* pager.c */
  445. FILE *G_open_pager(struct Popen *);
  446. void G_close_pager(struct Popen *);
  447. FILE *G_open_mail(struct Popen *);
  448. void G_close_mail(struct Popen *);
  449. /* parser.c */
  450. void G_disable_interactive(void);
  451. struct GModule *G_define_module(void);
  452. struct Flag *G_define_flag(void);
  453. struct Option *G_define_option(void);
  454. struct Option *G_define_standard_option(int);
  455. struct Flag *G_define_standard_flag(int);
  456. int G_parser(int, char **);
  457. void G_usage(void);
  458. char *G_recreate_command(void);
  459. void G_add_keyword(const char *);
  460. void G_set_keywords(const char *);
  461. int G_get_overwrite();
  462. char *G_option_to_separator(const struct Option *);
  463. FILE *G_open_option_file(const struct Option *);
  464. void G_close_option_file(FILE *);
  465. /* parser_dependencies.c */
  466. void G_option_rule(int, int, void **);
  467. void G_option_exclusive(void *, ...);
  468. void G_option_required(void *, ...);
  469. void G_option_requires(void *, ...);
  470. void G_option_requires_all(void *, ...);
  471. void G_option_excludes(void *, ...);
  472. void G_option_collective(void *, ...);
  473. /* paths.c */
  474. int G_mkdir(const char *);
  475. int G_is_dirsep(char);
  476. int G_is_absolute_path(const char *);
  477. char *G_convert_dirseps_to_host(char *);
  478. char *G_convert_dirseps_from_host(char *);
  479. int G_lstat(const char *, struct stat *);
  480. int G_stat(const char *, struct stat *);
  481. int G_owner(const char *);
  482. /* percent.c */
  483. void G_percent(long, long, int);
  484. void G_percent_reset(void);
  485. void G_progress(long, int);
  486. void G_set_percent_routine(int (*) (int));
  487. void G_unset_percent_routine(void);
  488. /* popen.c */
  489. void G_popen_clear(struct Popen *);
  490. FILE *G_popen_write(struct Popen *, const char *, const char **);
  491. FILE *G_popen_read(struct Popen *, const char *, const char **);
  492. void G_popen_close(struct Popen *);
  493. /* plot.c */
  494. void G_setup_plot(double, double, double, double, int (*)(int, int),
  495. int (*)(int, int));
  496. void G_setup_fill(int);
  497. void G_plot_where_xy(double, double, int *, int *);
  498. void G_plot_where_en(int, int, double *, double *);
  499. void G_plot_point(double, double);
  500. void G_plot_line(double, double, double, double);
  501. void G_plot_line2(double, double, double, double);
  502. int G_plot_polygon(const double *, const double *, int);
  503. int G_plot_area(double *const *, double *const *, int *, int);
  504. void G_plot_fx(double (*)(double), double, double);
  505. /* pole_in_poly.c */
  506. int G_pole_in_polygon(const double *, const double *, int);
  507. /* progrm_nme.c */
  508. const char *G_program_name(void);
  509. const char *G_original_program_name(void);
  510. void G_set_program_name(const char *);
  511. /* proj1.c */
  512. int G_projection(void);
  513. /* proj2.c */
  514. int G_projection_units(int);
  515. const char *G_projection_name(int);
  516. /* proj3.c */
  517. const char *G_database_unit_name(int);
  518. int G_database_unit();
  519. const char *G_database_projection_name(void);
  520. const char *G_database_datum_name(void);
  521. const char *G_database_ellipse_name(void);
  522. double G_database_units_to_meters_factor(void);
  523. const char *G_database_epsg_code(void);
  524. /* put_window.c */
  525. int G_put_window(const struct Cell_head *);
  526. int G_put_element_window(const struct Cell_head *, const char *, const char *);
  527. /* putenv.c */
  528. void G_putenv(const char *, const char *);
  529. /* radii.c */
  530. double G_meridional_radius_of_curvature(double, double, double);
  531. double G_transverse_radius_of_curvature(double, double, double);
  532. double G_radius_of_conformal_tangent_sphere(double, double, double);
  533. /* rd_cellhd.c */
  534. void G__read_Cell_head(FILE *, struct Cell_head *, int);
  535. void G__read_Cell_head_array(char **, struct Cell_head *, int);
  536. /* remove.c */
  537. int G_remove(const char *, const char *);
  538. int G_remove_misc(const char *, const char *, const char *);
  539. int G_recursive_remove(const char *);
  540. /* rename.c */
  541. int G_rename_file(const char *, const char *);
  542. int G_rename(const char *, const char *, const char *);
  543. /* rhumbline.c */
  544. int G_begin_rhumbline_equation(double, double, double, double);
  545. double G_rhumbline_lat_from_lon(double);
  546. /* rotate.c */
  547. void G_rotate_around_point(double, double, double *, double *, double);
  548. void G_rotate_around_point_int(int, int, int *, int *, double);
  549. /* seek.c */
  550. off_t G_ftell(FILE *);
  551. void G_fseek(FILE *, off_t, int);
  552. /* set_window.c */
  553. void G_get_set_window(struct Cell_head *);
  554. void G_set_window(struct Cell_head *);
  555. void G_unset_window();
  556. /* short_way.c */
  557. void G_shortest_way(double *, double *);
  558. /* sleep.c */
  559. void G_sleep(unsigned int);
  560. /* snprintf.c */
  561. int G_snprintf(char *, size_t, const char *, ...)
  562. __attribute__ ((format(printf, 3, 4)));
  563. /* strings.c */
  564. int G_strcasecmp(const char *, const char *);
  565. int G_strncasecmp(const char *, const char *, int);
  566. char *G_store(const char *);
  567. char *G_store_upper(const char *);
  568. char *G_store_lower(const char *);
  569. char *G_strchg(char *, char, char);
  570. char *G_str_replace(const char *, const char *, const char *);
  571. void G_strip(char *);
  572. char *G_chop(char *);
  573. void G_str_to_upper(char *);
  574. void G_str_to_lower(char *);
  575. int G_str_to_sql(char *);
  576. void G_squeeze(char *);
  577. char *G_strcasestr(const char *, const char *);
  578. /* tempfile.c */
  579. void G_init_tempfile(void);
  580. char *G_tempfile(void);
  581. char *G_tempfile_pid(int);
  582. void G_temp_element(char *);
  583. void G__temp_element(char *, int);
  584. /* mkstemp.c */
  585. char *G_mktemp(char *);
  586. int G_mkstemp(char *, int, int);
  587. FILE *G_mkstemp_fp(char *, int, int);
  588. /* timestamp.c */
  589. void G_init_timestamp(struct TimeStamp *);
  590. void G_set_timestamp(struct TimeStamp *, const struct DateTime *);
  591. void G_set_timestamp_range(struct TimeStamp *, const struct DateTime *,
  592. const struct DateTime *);
  593. int G_write_timestamp(FILE *, const struct TimeStamp *);
  594. void G_get_timestamps(const struct TimeStamp *, struct DateTime *, struct DateTime *, int *);
  595. int G_format_timestamp(const struct TimeStamp *, char *);
  596. int G_scan_timestamp(struct TimeStamp *, const char *);
  597. int G_has_raster_timestamp(const char *, const char *);
  598. int G_read_raster_timestamp(const char *, const char *, struct TimeStamp *);
  599. int G_write_raster_timestamp(const char *, const struct TimeStamp *);
  600. int G_remove_raster_timestamp(const char *);
  601. int G_has_vector_timestamp(const char *, const char *, const char *);
  602. int G_read_vector_timestamp(const char *, const char *, const char *, struct TimeStamp *);
  603. int G_write_vector_timestamp(const char *, const char *, const struct TimeStamp *);
  604. int G_remove_vector_timestamp(const char *, const char *);
  605. int G_has_raster3d_timestamp(const char *, const char *);
  606. int G_read_raster3d_timestamp(const char *, const char *, struct TimeStamp *);
  607. int G_remove_raster3d_timestamp(const char *);
  608. int G_write_raster3d_timestamp(const char *, const struct TimeStamp *);
  609. /* token.c */
  610. char **G_tokenize(const char *, const char *);
  611. char **G_tokenize2(const char *, const char *, const char *);
  612. int G_number_of_tokens(char **);
  613. void G_free_tokens(char **);
  614. /* trim_dec.c */
  615. void G_trim_decimal(char *);
  616. /* units.c */
  617. double G_meters_to_units_factor(int);
  618. double G_meters_to_units_factor_sq(int);
  619. const char *G_get_units_name(int, int, int);
  620. int G_units(const char *);
  621. int G_is_units_type_spatial(int);
  622. int G_is_units_type_temporal(int);
  623. /* user_config.c */
  624. #ifndef __MINGW32__
  625. char *G_rc_path(const char *, const char *);
  626. #endif
  627. /* verbose.c */
  628. int G_verbose(void);
  629. int G_verbose_min(void);
  630. int G_verbose_std(void);
  631. int G_verbose_max(void);
  632. int G_set_verbose(int);
  633. /* view.c */
  634. void G_3dview_warning(int);
  635. int G_get_3dview_defaults(struct G_3dview *, struct Cell_head *);
  636. int G_put_3dview(const char *, const char *, const struct G_3dview *,
  637. const struct Cell_head *);
  638. int G_get_3dview(const char *, const char *, struct G_3dview *);
  639. /* whoami.c */
  640. const char *G_whoami(void);
  641. /* wind_2_box.c */
  642. void G_adjust_window_to_box(const struct Cell_head *, struct Cell_head *, int,
  643. int);
  644. /* wind_format.c */
  645. void G_format_northing(double, char *, int);
  646. void G_format_easting(double, char *, int);
  647. void G_format_resolution(double, char *, int);
  648. /* wind_in.c */
  649. int G_point_in_region(double, double);
  650. int G_point_in_window(double, double, const struct Cell_head *);
  651. /* wind_limits.c */
  652. int G_limit_east(double *, int);
  653. int G_limit_west(double *, int);
  654. int G_limit_north(double *, int);
  655. int G_limit_south(double *, int);
  656. /* wind_overlap.c */
  657. int G_window_overlap(const struct Cell_head *, double, double, double,
  658. double);
  659. double G_window_percentage_overlap(const struct Cell_head *, double, double,
  660. double, double);
  661. /* wind_scan.c */
  662. int G_scan_northing(const char *, double *, int);
  663. int G_scan_easting(const char *, double *, int);
  664. int G_scan_resolution(const char *, double *, int);
  665. /* window_map.c */
  666. double G_adjust_east_longitude(double, double);
  667. double G_adjust_easting(double, const struct Cell_head *);
  668. void G__init_window(void);
  669. /* worker.c */
  670. void G_begin_execute(void (*func)(void *), void *, void **, int);
  671. void G_end_execute(void **);
  672. void G_init_workers(void);
  673. void G_finish_workers(void);
  674. /* wr_cellhd.c */
  675. void G__write_Cell_head(FILE *, const struct Cell_head *, int);
  676. void G__write_Cell_head3(FILE *, const struct Cell_head *, int);
  677. /* writ_zeros.c */
  678. void G_write_zeros(int, size_t);
  679. /* xdr.c */
  680. void G_xdr_get_int(int *, const void *);
  681. void G_xdr_put_int(void *, const int *);
  682. void G_xdr_get_float(float *, const void *);
  683. void G_xdr_put_float(void *, const float *);
  684. void G_xdr_get_double(double *, const void *);
  685. void G_xdr_put_double(void *, const double *);
  686. /* zero.c */
  687. void G_zero(void *, int);
  688. /* zone.c */
  689. int G_zone(void);
  690. #endif /* GRASS_GISDEFS_H */