gis.h 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761
  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_get_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. struct Key_Value *G_get_projepsg(void);
  237. /* get_window.c */
  238. void G_get_window(struct Cell_head *);
  239. void G_get_default_window(struct Cell_head *);
  240. void G__get_window(struct Cell_head *, const char *, const char *,
  241. const char *);
  242. /* getl.c */
  243. int G_getl(char *, int, FILE *);
  244. int G_getl2(char *, int, FILE *);
  245. /* gisbase.c */
  246. const char *G_gisbase(void);
  247. /* gisdbase.c */
  248. const char *G_gisdbase(void);
  249. /* gisinit.c */
  250. void G__gisinit(const char *, const char *);
  251. void G__no_gisinit(const char *);
  252. void G__check_gisinit(void);
  253. void G_init_all(void);
  254. /* handler.c */
  255. void G_add_error_handler(void (*)(void *), void *);
  256. void G_remove_error_handler(void (*)(void *), void *);
  257. void G__call_error_handlers(void);
  258. /* home.c */
  259. const char *G_home(void);
  260. const char *G__home(void);
  261. const char *G_config_path(void);
  262. /* ilist.c */
  263. void G_init_ilist(struct ilist *);
  264. void G_free_ilist(struct ilist *);
  265. struct ilist * G_new_ilist();
  266. void G_ilist_add(struct ilist *, int);
  267. /* intersect.c */
  268. int G_intersect_line_segments(double, double, double, double, double, double,
  269. double, double, double *, double *, double *,
  270. double *);
  271. /* is.c */
  272. int G_is_gisbase(const char *);
  273. int G_is_location(const char *);
  274. int G_is_mapset(const char *);
  275. /* key_value1.c */
  276. struct Key_Value *G_create_key_value(void);
  277. void G_set_key_value(const char *, const char *, struct Key_Value *);
  278. const char *G_find_key_value(const char *, const struct Key_Value *);
  279. void G_free_key_value(struct Key_Value *);
  280. /* key_value2.c */
  281. int G_fwrite_key_value(FILE *, const struct Key_Value *);
  282. struct Key_Value *G_fread_key_value(FILE *);
  283. /* key_value3.c */
  284. void G_write_key_value_file(const char *, const struct Key_Value *);
  285. struct Key_Value *G_read_key_value_file(const char *);
  286. /* key_value4.c */
  287. void G_update_key_value_file(const char *, const char *, const char *);
  288. int G_lookup_key_value_from_file(const char *, const char *, char[], int);
  289. /* legal_name.c */
  290. int G_legal_filename(const char *);
  291. int G_check_input_output_name(const char *, const char *, int);
  292. /* line_dist.c */
  293. void G_set_distance_to_line_tolerance(double);
  294. double G_distance2_point_to_line(double, double, double, double, double,
  295. double);
  296. /* list.c */
  297. void G_list_element(const char *, const char *, const char *,
  298. int (*)(const char *, const char *, const char *));
  299. char **G_list(int, const char *, const char *, const char *);
  300. void G_free_list(char **);
  301. /* ll_format.c */
  302. void G_lat_format(double, char *);
  303. const char *G_lat_format_string(void);
  304. void G_lon_format(double, char *);
  305. const char *G_lon_format_string(void);
  306. void G_llres_format(double, char *);
  307. const char *G_llres_format_string(void);
  308. void G_lat_parts(double, int *, int *, double *, char *);
  309. void G_lon_parts(double, int *, int *, double *, char *);
  310. /* ll_scan.c */
  311. int G_lat_scan(const char *, double *);
  312. int G_lon_scan(const char *, double *);
  313. int G_llres_scan(const char *, double *);
  314. /* location.c */
  315. const char *G_location(void);
  316. char *G_location_path(void);
  317. /* ls.c */
  318. void G_set_ls_filter(int (*)(const char *, void *), void *);
  319. void G_set_ls_exclude_filter(int (*)(const char *, void *), void *);
  320. char **G__ls(const char *, int *);
  321. void G_ls(const char *, FILE *);
  322. void G_ls_format(char **, int, int, FILE *);
  323. /* ls_filter.c */
  324. #ifdef HAVE_REGEX_H
  325. void *G_ls_regex_filter(const char *, int, int);
  326. void *G_ls_glob_filter(const char *, int);
  327. void G_free_ls_filter(void *);
  328. #endif
  329. /* mach_name.c */
  330. const char *G__machine_name(void);
  331. /* make_loc.c */
  332. int G_make_location(const char *, struct Cell_head *, const struct Key_Value *,
  333. const struct Key_Value *);
  334. int G_compare_projections(const struct Key_Value *, const struct Key_Value *,
  335. const struct Key_Value *, const struct Key_Value *);
  336. /* make_mapset.c */
  337. int G_make_mapset(const char *, const char *, const char *);
  338. /* mapcase.c */
  339. char *G_tolcase(char *);
  340. char *G_toucase(char *);
  341. /* mapset.c */
  342. const char *G_mapset(void);
  343. char *G_mapset_path(void);
  344. /* mapset_msc.c */
  345. int G__make_mapset_element(const char *);
  346. int G__make_mapset_element_misc(const char *, const char *);
  347. int G__mapset_permissions(const char *);
  348. int G__mapset_permissions2(const char *, const char *, const char *);
  349. /* mapset_nme.c */
  350. const char *G_get_mapset_name(int);
  351. void G__get_list_of_mapsets(void);
  352. void G_create_alt_search_path(void);
  353. void G_switch_search_path(void);
  354. void G__reset_mapsets(void);
  355. char **G_get_available_mapsets(void);
  356. void G_add_mapset_to_search_path(const char *);
  357. int G_is_mapset_in_search_path(const char *);
  358. /* myname.c */
  359. char *G_myname(void);
  360. /* named_colr.c */
  361. int G_color_values(const char *, float *, float *, float *);
  362. const char *G_color_name(int);
  363. /* nl_to_spaces.c */
  364. void G_newlines_to_spaces(char *);
  365. /* nme_in_mps.c */
  366. int G_name_is_fully_qualified(const char *, char *, char *);
  367. char *G_fully_qualified_name(const char *, const char *);
  368. int G_unqualified_name(const char *, const char *, char *, char *);
  369. /* open.c */
  370. int G_open_new(const char *, const char *);
  371. int G_open_old(const char *, const char *, const char *);
  372. int G_open_update(const char *, const char *);
  373. FILE *G_fopen_new(const char *, const char *);
  374. FILE *G_fopen_old(const char *, const char *, const char *);
  375. FILE *G_fopen_append(const char *, const char *);
  376. FILE *G_fopen_modify(const char *, const char *);
  377. /* open_misc.c */
  378. int G_open_new_misc(const char *, const char *, const char *);
  379. int G_open_old_misc(const char *, const char *, const char *, const char *);
  380. int G_open_update_misc(const char *, const char *, const char *);
  381. FILE *G_fopen_new_misc(const char *, const char *, const char *);
  382. FILE *G_fopen_old_misc(const char *, const char *, const char *,
  383. const char *);
  384. FILE *G_fopen_append_misc(const char *, const char *, const char *);
  385. FILE *G_fopen_modify_misc(const char *, const char *, const char *);
  386. /* overwrite.c */
  387. int G_check_overwrite(int argc, char **argv);
  388. /* pager.c */
  389. FILE *G_open_pager(struct Popen *);
  390. void G_close_pager(struct Popen *);
  391. FILE *G_open_mail(struct Popen *);
  392. void G_close_mail(struct Popen *);
  393. /* parser.c */
  394. void G_disable_interactive(void);
  395. struct GModule *G_define_module(void);
  396. struct Flag *G_define_flag(void);
  397. struct Option *G_define_option(void);
  398. struct Option *G_define_standard_option(int);
  399. struct Flag *G_define_standard_flag(int);
  400. int G_parser(int, char **);
  401. void G_usage(void);
  402. char *G_recreate_command(void);
  403. void G_add_keyword(const char *);
  404. void G_set_keywords(const char *);
  405. int G_get_overwrite();
  406. char *G_option_to_separator(const struct Option *);
  407. FILE *G_open_option_file(const struct Option *);
  408. void G_close_option_file(FILE *);
  409. /* paths.c */
  410. int G_mkdir(const char *);
  411. int G_is_dirsep(char);
  412. int G_is_absolute_path(const char *);
  413. char *G_convert_dirseps_to_host(char *);
  414. char *G_convert_dirseps_from_host(char *);
  415. int G_lstat(const char *, struct stat *);
  416. int G_stat(const char *, struct stat *);
  417. int G_owner(const char *);
  418. /* percent.c */
  419. void G_percent(long, long, int);
  420. void G_percent_reset(void);
  421. void G_progress(long, int);
  422. void G_set_percent_routine(int (*) (int));
  423. void G_unset_percent_routine(void);
  424. /* popen.c */
  425. void G_popen_clear(struct Popen *);
  426. FILE *G_popen_write(struct Popen *, const char *, const char **);
  427. FILE *G_popen_read(struct Popen *, const char *, const char **);
  428. void G_popen_close(struct Popen *);
  429. /* plot.c */
  430. void G_setup_plot(double, double, double, double, int (*)(int, int),
  431. int (*)(int, int));
  432. void G_setup_fill(int);
  433. void G_plot_where_xy(double, double, int *, int *);
  434. void G_plot_where_en(int, int, double *, double *);
  435. void G_plot_point(double, double);
  436. void G_plot_line(double, double, double, double);
  437. void G_plot_line2(double, double, double, double);
  438. int G_plot_polygon(const double *, const double *, int);
  439. int G_plot_area(double *const *, double *const *, int *, int);
  440. void G_plot_fx(double (*)(double), double, double);
  441. /* pole_in_poly.c */
  442. int G_pole_in_polygon(const double *, const double *, int);
  443. /* progrm_nme.c */
  444. const char *G_program_name(void);
  445. void G_set_program_name(const char *);
  446. /* proj1.c */
  447. int G_projection(void);
  448. /* proj2.c */
  449. int G__projection_units(int);
  450. const char *G__projection_name(int);
  451. /* proj3.c */
  452. const char *G_database_unit_name(int);
  453. const char *G_database_projection_name(void);
  454. const char *G_database_datum_name(void);
  455. const char *G_database_ellipse_name(void);
  456. double G_database_units_to_meters_factor(void);
  457. const char *G_database_epsg_code(void);
  458. /* put_window.c */
  459. int G_put_window(const struct Cell_head *);
  460. int G__put_window(const struct Cell_head *, const char *, const char *);
  461. /* putenv.c */
  462. void G_putenv(const char *, const char *);
  463. /* radii.c */
  464. double G_meridional_radius_of_curvature(double, double, double);
  465. double G_transverse_radius_of_curvature(double, double, double);
  466. double G_radius_of_conformal_tangent_sphere(double, double, double);
  467. /* rd_cellhd.c */
  468. void G__read_Cell_head(FILE *, struct Cell_head *, int);
  469. void G__read_Cell_head_array(char **, struct Cell_head *, int);
  470. /* remove.c */
  471. int G_remove(const char *, const char *);
  472. int G_remove_misc(const char *, const char *, const char *);
  473. /* rename.c */
  474. int G_rename_file(const char *, const char *);
  475. int G_rename(const char *, const char *, const char *);
  476. /* rhumbline.c */
  477. int G_begin_rhumbline_equation(double, double, double, double);
  478. double G_rhumbline_lat_from_lon(double);
  479. /* rotate.c */
  480. void G_rotate_around_point(double, double, double *, double *, double);
  481. void G_rotate_around_point_int(int, int, int *, int *, double);
  482. /* seek.c */
  483. off_t G_ftell(FILE *);
  484. void G_fseek(FILE *, off_t, int);
  485. /* set_window.c */
  486. void G_get_set_window(struct Cell_head *);
  487. void G_set_window(struct Cell_head *);
  488. void G_unset_window();
  489. /* short_way.c */
  490. void G_shortest_way(double *, double *);
  491. /* sleep.c */
  492. void G_sleep(unsigned int);
  493. /* snprintf.c */
  494. int G_snprintf(char *, size_t, const char *, ...)
  495. __attribute__ ((format(printf, 3, 4)));
  496. /* strings.c */
  497. int G_strcasecmp(const char *, const char *);
  498. int G_strncasecmp(const char *, const char *, int);
  499. char *G_store(const char *);
  500. char *G_strchg(char *, char, char);
  501. char *G_str_replace(const char *, const char *, const char *);
  502. void G_strip(char *);
  503. char *G_chop(char *);
  504. void G_str_to_upper(char *);
  505. void G_str_to_lower(char *);
  506. int G_str_to_sql(char *);
  507. void G_squeeze(char *);
  508. char *G_strcasestr(const char *, const char *);
  509. /* tempfile.c */
  510. void G_init_tempfile(void);
  511. char *G_tempfile(void);
  512. char *G__tempfile(int);
  513. void G__temp_element(char *);
  514. /* mkstemp.c */
  515. char *G_mktemp(char *);
  516. int G_mkstemp(char *, int, int);
  517. FILE *G_mkstemp_fp(char *, int, int);
  518. /* timestamp.c */
  519. void G_init_timestamp(struct TimeStamp *);
  520. void G_set_timestamp(struct TimeStamp *, const struct DateTime *);
  521. void G_set_timestamp_range(struct TimeStamp *, const struct DateTime *,
  522. const struct DateTime *);
  523. int G__read_timestamp(FILE *, struct TimeStamp *);
  524. int G__write_timestamp(FILE *, const struct TimeStamp *);
  525. void G_get_timestamps(const struct TimeStamp *, struct DateTime *, struct DateTime *, int *);
  526. int G_format_timestamp(const struct TimeStamp *, char *);
  527. int G_scan_timestamp(struct TimeStamp *, const char *);
  528. int G_has_raster_timestamp(const char *, const char *);
  529. int G_read_raster_timestamp(const char *, const char *, struct TimeStamp *);
  530. int G_write_raster_timestamp(const char *, const struct TimeStamp *);
  531. int G_remove_raster_timestamp(const char *);
  532. int G_has_vector_timestamp(const char *, const char *, const char *);
  533. int G_read_vector_timestamp(const char *, const char *, const char *, struct TimeStamp *);
  534. int G_write_vector_timestamp(const char *, const char *, const struct TimeStamp *);
  535. int G_remove_vector_timestamp(const char *, const char *);
  536. int G_has_raster3d_timestamp(const char *, const char *);
  537. int G_read_raster3d_timestamp(const char *, const char *, struct TimeStamp *);
  538. int G_remove_raster3d_timestamp(const char *);
  539. int G_write_raster3d_timestamp(const char *, const struct TimeStamp *);
  540. /* token.c */
  541. char **G_tokenize(const char *, const char *);
  542. char **G_tokenize2(const char *, const char *, const char *);
  543. int G_number_of_tokens(char **);
  544. void G_free_tokens(char **);
  545. /* trim_dec.c */
  546. void G_trim_decimal(char *);
  547. /* units.c */
  548. double G_meters_to_units_factor(int);
  549. double G_meters_to_units_factor_sq(int);
  550. const char *G_get_units_name(int, int, int);
  551. int G_units(const char *);
  552. int G_is_units_type_spatial(int);
  553. int G_is_units_type_temporal(int);
  554. /* user_config.c */
  555. #ifndef __MINGW32__
  556. char *G_rc_path(const char *, const char *);
  557. #endif
  558. /* verbose.c */
  559. int G_verbose(void);
  560. int G_verbose_min(void);
  561. int G_verbose_std(void);
  562. int G_verbose_max(void);
  563. int G_set_verbose(int);
  564. /* view.c */
  565. void G_3dview_warning(int);
  566. int G_get_3dview_defaults(struct G_3dview *, struct Cell_head *);
  567. int G_put_3dview(const char *, const char *, const struct G_3dview *,
  568. const struct Cell_head *);
  569. int G_get_3dview(const char *, const char *, struct G_3dview *);
  570. /* whoami.c */
  571. const char *G_whoami(void);
  572. /* wind_2_box.c */
  573. void G_adjust_window_to_box(const struct Cell_head *, struct Cell_head *, int,
  574. int);
  575. /* wind_format.c */
  576. void G_format_northing(double, char *, int);
  577. void G_format_easting(double, char *, int);
  578. void G_format_resolution(double, char *, int);
  579. /* wind_in.c */
  580. int G_point_in_region(double, double);
  581. int G_point_in_window(double, double, const struct Cell_head *);
  582. /* wind_limits.c */
  583. int G_limit_east(double *, int);
  584. int G_limit_west(double *, int);
  585. int G_limit_north(double *, int);
  586. int G_limit_south(double *, int);
  587. /* wind_overlap.c */
  588. int G_window_overlap(const struct Cell_head *, double, double, double,
  589. double);
  590. double G_window_percentage_overlap(const struct Cell_head *, double, double,
  591. double, double);
  592. /* wind_scan.c */
  593. int G_scan_northing(const char *, double *, int);
  594. int G_scan_easting(const char *, double *, int);
  595. int G_scan_resolution(const char *, double *, int);
  596. /* window_map.c */
  597. double G_adjust_east_longitude(double, double);
  598. double G_adjust_easting(double, const struct Cell_head *);
  599. void G__init_window(void);
  600. /* worker.c */
  601. void G_begin_execute(void (*func)(void *), void *, void **, int);
  602. void G_end_execute(void **);
  603. void G_init_workers(void);
  604. void G_finish_workers(void);
  605. /* wr_cellhd.c */
  606. void G__write_Cell_head(FILE *, const struct Cell_head *, int);
  607. void G__write_Cell_head3(FILE *, const struct Cell_head *, int);
  608. /* writ_zeros.c */
  609. void G_write_zeros(int, size_t);
  610. /* xdr.c */
  611. void G_xdr_get_int(int *, const void *);
  612. void G_xdr_put_int(void *, const int *);
  613. void G_xdr_get_float(float *, const void *);
  614. void G_xdr_put_float(void *, const float *);
  615. void G_xdr_get_double(double *, const void *);
  616. void G_xdr_put_double(void *, const double *);
  617. /* zero.c */
  618. void G_zero(void *, int);
  619. /* zone.c */
  620. int G_zone(void);
  621. #endif /* GRASS_GISDEFS_H */