gis.h 23 KB

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