gis.h 24 KB

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