gis.h 24 KB

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