GRASS GIS 8 Programmer's Manual  8.5.0dev(2024)-d6dec75dd4
defs/gis.h
Go to the documentation of this file.
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 
17 #ifndef GRASS_GISDEFS_H
18 #define GRASS_GISDEFS_H
19 
20 /*============================= Include Files ==============================*/
21 
22 /* none */
23 
24 /*=========================== Constants/Defines ============================*/
25 
26 /* none (look in gis.h) */
27 
28 /*=========================== Typedefs/Structures ==========================*/
29 
30 /* none (look in gis.h) */
31 
32 /*============================== Prototypes ================================*/
33 
34 #include <grass/config.h>
35 
36 #ifdef __GNUC__
37 #ifdef __MINGW32__
38 #include <malloc.h>
39 #else
40 #if (defined(__unix__) || defined(unix)) && !defined(USG)
41 #include <sys/param.h>
42 #endif
43 #if (defined(BSD))
44 /* no malloc.h, no alloca.h ?
45  * TODO: better
46  * check if alloca.h exists,
47  * if not, check if malloc.h exists,
48  * if not use stdlib.h */
49 #include <stdlib.h>
50 #else
51 #include <alloca.h>
52 #endif
53 #endif
54 #define G_alloca(n) alloca(n)
55 #define G_freea(p)
56 #else
57 #define G_alloca(n) G_malloc(n)
58 #define G_freea(p) G_free(p)
59 #endif
60 
61 #include <stdarg.h>
62 #include <stdio.h>
63 
64 #ifndef CTYPESGEN
65 #include <setjmp.h>
66 #endif
67 
68 #include <sys/types.h>
69 #include <sys/stat.h>
70 
71 #ifndef RELDIR
72 #define RELDIR "?"
73 #endif
74 
75 /* adj_cellhd.c */
76 void G_adjust_Cell_head(struct Cell_head *, int, int);
77 void G_adjust_Cell_head3(struct Cell_head *, int, int, int);
78 int G_adjust_window_ll(struct Cell_head *cellhd);
79 
80 /* alloc.c */
81 #define G_incr_void_ptr(ptr, size) \
82  ((void *)((const unsigned char *)(ptr) + (size)))
83 
84 void *G__malloc(const char *, int, size_t);
85 void *G__calloc(const char *, int, size_t, size_t);
86 void *G__realloc(const char *, int, void *, size_t);
87 void G_free(void *);
88 
89 #ifndef G_incr_void_ptr
90 void *G_incr_void_ptr(const void *, size_t);
91 #endif
92 
93 #ifndef CTYPESGEN
94 #define G_malloc(n) G__malloc(RELDIR "/" __FILE__, __LINE__, (n))
95 #define G_calloc(m, n) G__calloc(RELDIR "/" __FILE__, __LINE__, (m), (n))
96 #define G_realloc(p, n) G__realloc(RELDIR "/" __FILE__, __LINE__, (p), (n))
97 #else
98 #define G_malloc(n) G__malloc("<ctypesgen>", 0, (n))
99 #define G_calloc(m, n) G__calloc("<ctypesgen>", 0, (m), (n))
100 #define G_realloc(p, n) G__realloc("<ctypesgen>", 0, (p), (n))
101 #endif
102 
103 /* area.c */
105 double G_area_of_cell_at_row(int);
107 double G_area_of_polygon(const double *, const double *, int);
108 
109 /* area_ellipse.c */
110 void G_begin_zone_area_on_ellipsoid(double, double, double);
111 double G_darea0_on_ellipsoid(double);
112 double G_area_for_zone_on_ellipsoid(double, double);
113 
114 /* area_poly1.c */
115 void G_begin_ellipsoid_polygon_area(double, double);
116 double G_ellipsoid_polygon_area(const double *, const double *, int);
117 
118 /* area_poly2.c */
119 double G_planimetric_polygon_area(const double *, const double *, int);
120 
121 /* area_sphere.c */
122 void G_begin_zone_area_on_sphere(double, double);
123 double G_darea0_on_sphere(double);
124 double G_area_for_zone_on_sphere(double, double);
125 
126 /* ascii_chk.c */
127 void G_ascii_check(char *);
128 
129 /* asprintf.c */
130 /* Do it better if you know how */
131 /* asprintf is not found on MINGW but exists */
132 
133 /*
134  * Because configure script in GDAL test is G_asprintf exists in gis lib
135  * the G_asprintf macro is disabled until a stable version of GDAL
136  * with a different function becomes widely used
137  */
138 int G_vasprintf(char **, const char *, va_list);
139 int G_asprintf(char **, const char *, ...)
140  __attribute__((format(printf, 2, 3)));
141 
142 int G_rasprintf(char **, size_t *, const char *, ...)
143  __attribute__((format(printf, 3, 4)));
144 
145 /* aprintf.c */
146 int G_aprintf(const char *, ...);
147 int G_faprintf(FILE *, const char *, ...);
148 int G_saprintf(char *, const char *, ...);
149 int G_snaprintf(char *, size_t, const char *, ...);
150 int G_vaprintf(const char *, va_list);
151 int G_vfaprintf(FILE *, const char *, va_list);
152 int G_vsaprintf(char *, const char *, va_list);
153 int G_vsnaprintf(char *, size_t, const char *, va_list);
154 
155 /* strlcat.c */
156 size_t G_strlcat(char *, const char *, size_t);
157 
158 /* strlcpy.c */
159 size_t G_strlcpy(char *, const char *, size_t);
160 
161 /* basename.c */
162 char *G_basename(char *, const char *);
163 size_t G_get_num_decimals(const char *);
164 char *G_double_to_basename_format(double, size_t, size_t);
165 char *G_get_basename_separator(void);
166 char *G_join_basename_strings(const char **, size_t);
167 char *G_generate_basename(const char *, double, size_t, size_t);
168 
169 /* bres_line.c */
170 void G_bresenham_line(int, int, int, int, int (*)(int, int));
171 
172 /* clicker.c */
173 void G_clicker(void);
174 
175 /* color_rules.c */
176 char *G_color_rules_options(void);
177 char *G_color_rules_descriptions(void);
179 void G_list_color_rules(FILE *);
180 void G_list_color_rules_description_type(FILE *, char *);
181 int G_find_color_rule(const char *);
182 
183 /* color_str.c */
184 int G_num_standard_colors(void);
185 
186 /* commas.c */
187 int G_insert_commas(char *);
188 void G_remove_commas(char *);
189 
190 /* compress.c */
191 int G_compressor_number(char *);
192 char *G_compressor_name(int);
193 int G_default_compressor(void);
194 int G_check_compressor(int);
195 int G_write_compressed(int, unsigned char *, int, int);
196 int G_write_unompressed(int, unsigned char *, int);
197 int G_read_compressed(int, int, unsigned char *, int, int);
198 int G_compress_bound(int, int);
199 int G_compress(unsigned char *, int, unsigned char *, int, int);
200 int G_expand(unsigned char *, int, unsigned char *, int, int);
201 
202 /* compress.c : no compression */
203 int G_no_compress(unsigned char *src, int src_sz, unsigned char *dst,
204  int dst_sz);
205 int G_no_expand(unsigned char *src, int src_sz, unsigned char *dst, int dst_sz);
206 
207 /* cmprrle.c : Run Length Encoding (RLE) */
208 int G_rle_compress(unsigned char *src, int src_sz, unsigned char *dst,
209  int dst_sz);
210 int G_rle_expand(unsigned char *src, int src_sz, unsigned char *dst,
211  int dst_sz);
212 
213 /* cmprzlib.c : ZLIB's DEFLATE */
214 int G_zlib_compress(unsigned char *src, int src_sz, unsigned char *dst,
215  int dst_sz);
216 int G_zlib_expand(unsigned char *src, int src_sz, unsigned char *dst,
217  int dst_sz);
218 
219 /* cmprlz4.c : LZ4, extremely fast */
220 int G_lz4_compress(unsigned char *src, int src_sz, unsigned char *dst,
221  int dst_sz);
222 int G_lz4_expand(unsigned char *src, int src_sz, unsigned char *dst,
223  int dst_sz);
224 
225 /* cmprbzip.c : BZIP2, high compression, faster than ZLIB's DEFLATE with level 9
226  */
227 int G_bz2_compress(unsigned char *src, int src_sz, unsigned char *dst,
228  int dst_sz);
229 int G_bz2_expand(unsigned char *src, int src_sz, unsigned char *dst,
230  int dst_sz);
231 
232 /* cmprzstd.c : ZSTD, compression similar to ZLIB's DEFLATE but faster */
233 int G_zstd_compress(unsigned char *src, int src_sz, unsigned char *dst,
234  int dst_sz);
235 int G_zstd_expand(unsigned char *src, int src_sz, unsigned char *dst,
236  int dst_sz);
237 
238 /* add more compression methods here */
239 
240 /* copy_dir.c */
241 int G_recursive_copy(const char *, const char *);
242 
243 /* copy_file.c */
244 int G_copy_file(const char *, const char *);
245 
246 /* counter.c */
247 int G_is_initialized(int *);
248 void G_initialize_done(int *);
249 void G_init_counter(struct Counter *, int);
250 int G_counter_next(struct Counter *);
251 
252 /* date.c */
253 const char *G_date(void);
254 
255 /* datum.c */
256 int G_get_datum_by_name(const char *);
257 const char *G_datum_name(int);
258 const char *G_datum_description(int);
259 const char *G_datum_ellipsoid(int);
260 int G_get_datumparams_from_projinfo(const struct Key_Value *, char *, char *);
261 void G_read_datum_table(void);
262 
263 /* debug.c */
264 void G_init_debug(void);
265 int G_debug(int, const char *, ...) __attribute__((format(printf, 2, 3)));
266 
267 /* distance.c */
269 double G_distance(double, double, double, double);
270 double G_distance_between_line_segments(double, double, double, double, double,
271  double, double, double);
272 double G_distance_point_to_line_segment(double, double, double, double, double,
273  double);
274 
275 /* done_msg.c */
276 void G_done_msg(const char *, ...) __attribute__((format(printf, 1, 2)));
277 
278 /* endian.c */
279 int G_is_little_endian(void);
280 
281 /* env.c */
282 void G_init_env(void);
283 const char *G_getenv(const char *);
284 const char *G_getenv2(const char *, int);
285 const char *G_getenv_nofatal(const char *);
286 const char *G_getenv_nofatal2(const char *, int);
287 void G_setenv(const char *, const char *);
288 void G_setenv2(const char *, const char *, int);
289 void G_setenv_nogisrc(const char *, const char *);
290 void G_setenv_nogisrc2(const char *, const char *, int);
291 void G_unsetenv(const char *);
292 void G_unsetenv2(const char *, int);
293 const char *G_get_env_name(int);
294 void G_set_gisrc_mode(int);
295 int G_get_gisrc_mode(void);
296 void G_create_alt_env(void);
297 void G_switch_env(void);
298 void G__read_mapset_env(void);
299 void G__read_gisrc_env(void);
300 void G__read_gisrc_path(void);
301 
302 /* error.c */
303 #ifndef CTYPESGEN
304 jmp_buf *G_fatal_longjmp(int);
305 #endif
306 
307 int G_info_format(void);
308 void G_message(const char *, ...) __attribute__((format(printf, 1, 2)));
309 void G_verbose_message(const char *, ...) __attribute__((format(printf, 1, 2)));
310 void G_important_message(const char *, ...)
311  __attribute__((format(printf, 1, 2)));
312 void G_fatal_error(const char *, ...) __attribute__((format(printf, 1, 2)))
313 __attribute__((noreturn));
314 void G_warning(const char *, ...) __attribute__((format(printf, 1, 2)));
315 int G_suppress_warnings(int);
316 int G_sleep_on_error(int);
317 void G_set_error_routine(int (*)(const char *, int));
318 void G_unset_error_routine(void);
319 void G_init_logging(void);
320 
321 /* file_name.c */
322 char *G_file_name(char *, const char *, const char *, const char *);
323 char *G_file_name_misc(char *, const char *, const char *, const char *,
324  const char *);
325 char *G_file_name_tmp(char *, const char *, const char *, const char *);
326 char *G_file_name_basedir(char *, const char *, const char *, const char *,
327  const char *);
328 
329 /* find_file.c */
330 const char *G_find_file(const char *, char *, const char *);
331 const char *G_find_file2(const char *, const char *, const char *);
332 const char *G_find_file_misc(const char *, const char *, char *, const char *);
333 const char *G_find_file2_misc(const char *, const char *, const char *,
334  const char *);
335 
336 /* find_etc.c */
337 char *G_find_etc(const char *);
338 
339 /* find_rast.c */
340 const char *G_find_raster(char *, const char *);
341 const char *G_find_raster2(const char *, const char *);
342 
343 /* find_rast3d.c */
344 const char *G_find_raster3d(const char *, const char *);
345 
346 /* find_vect.c */
347 const char *G_find_vector(char *, const char *);
348 const char *G_find_vector2(const char *, const char *);
349 
350 /* geodesic.c */
351 int G_begin_geodesic_equation(double, double, double, double);
352 double G_geodesic_lat_from_lon(double);
353 
354 /* geodist.c */
355 void G_begin_geodesic_distance(double, double);
356 void G_set_geodesic_distance_lat1(double);
357 void G_set_geodesic_distance_lat2(double);
358 double G_geodesic_distance_lon_to_lon(double, double);
359 double G_geodesic_distance(double, double, double, double);
360 
361 /* get_ellipse.c */
362 int G_get_ellipsoid_parameters(double *, double *);
363 int G_get_spheroid_by_name(const char *, double *, double *, double *);
364 int G_get_ellipsoid_by_name(const char *, double *, double *);
365 const char *G_ellipsoid_name(int);
366 const char *G_ellipsoid_description(int);
367 int G_read_ellipsoid_table(int);
368 
369 /* get_projinfo.c */
370 struct Key_Value *G_get_projunits(void);
371 struct Key_Value *G_get_projinfo(void);
372 struct Key_Value *G_get_projepsg(void);
373 char *G_get_projwkt(void);
374 char *G_get_projsrid(void);
375 
376 /* get_window.c */
377 void G_get_window(struct Cell_head *);
378 void G_get_default_window(struct Cell_head *);
379 void G_get_element_window(struct Cell_head *, const char *, const char *,
380  const char *);
381 
382 /* getl.c */
383 int G_getl(char *, int, FILE *);
384 int G_getl2(char *, int, FILE *);
385 
386 /* gisbase.c */
387 const char *G_gisbase(void);
388 
389 /* gisdbase.c */
390 const char *G_gisdbase(void);
391 
392 /* gisinit.c */
393 void G__gisinit(const char *, const char *);
394 void G__no_gisinit(const char *);
395 void G_init_all(void);
396 
397 /* handler.c */
398 void G_add_error_handler(void (*)(void *), void *);
399 void G_remove_error_handler(void (*)(void *), void *);
400 
401 /* home.c */
402 const char *G_home(void);
403 const char *G_config_path(void);
404 
405 /* ilist.c */
406 void G_init_ilist(struct ilist *);
407 void G_free_ilist(struct ilist *);
408 struct ilist *G_new_ilist(void);
409 void G_ilist_add(struct ilist *, int);
410 
411 /* intersect.c */
412 int G_intersect_line_segments(double, double, double, double, double, double,
413  double, double, double *, double *, double *,
414  double *);
415 
416 /* is.c */
417 int G_is_gisbase(const char *);
418 int G_is_location(const char *);
419 int G_is_mapset(const char *);
420 
421 /* key_value1.c */
422 struct Key_Value *G_create_key_value(void);
423 void G_set_key_value(const char *, const char *, struct Key_Value *);
424 const char *G_find_key_value(const char *, const struct Key_Value *);
425 void G_free_key_value(struct Key_Value *);
426 
427 /* key_value2.c */
428 int G_fwrite_key_value(FILE *, const struct Key_Value *);
429 struct Key_Value *G_fread_key_value(FILE *);
430 
431 /* key_value3.c */
432 void G_write_key_value_file(const char *, const struct Key_Value *);
433 struct Key_Value *G_read_key_value_file(const char *);
434 
435 /* key_value4.c */
436 void G_update_key_value_file(const char *, const char *, const char *);
437 int G_lookup_key_value_from_file(const char *, const char *, char[], int);
438 
439 /* legal_name.c */
440 int G_legal_filename(const char *);
441 int G_check_input_output_name(const char *, const char *, int);
442 
443 /* line_dist.c */
445 double G_distance2_point_to_line(double, double, double, double, double,
446  double);
447 
448 /* list.c */
449 void G_list_element(const char *, const char *, const char *,
450  int (*)(const char *, const char *, char *));
451 char **G_list(int, const char *, const char *, const char *);
452 void G_free_list(char **);
453 
454 /* ll_format.c */
455 void G_lat_format(double, char *);
456 const char *G_lat_format_string(void);
457 void G_lon_format(double, char *);
458 const char *G_lon_format_string(void);
459 void G_llres_format(double, char *);
460 const char *G_llres_format_string(void);
461 void G_lat_parts(double, int *, int *, double *, char *);
462 void G_lon_parts(double, int *, int *, double *, char *);
463 
464 /* ll_scan.c */
465 int G_lat_scan(const char *, double *);
466 int G_lon_scan(const char *, double *);
467 int G_llres_scan(const char *, double *);
468 
469 /* location.c */
470 const char *G_location(void);
471 char *G_location_path(void);
472 
473 /* lrand48.c */
474 void G_srand48(long);
475 long G_srand48_auto(void);
476 long G_lrand48(void);
477 long G_mrand48(void);
478 double G_drand48(void);
479 
480 /* ls.c */
481 void G_set_ls_filter(int (*)(const char *, void *), void *);
482 void G_set_ls_exclude_filter(int (*)(const char *, void *), void *);
483 char **G_ls2(const char *, int *);
484 void G_ls(const char *, FILE *);
485 void G_ls_format(char **, int, int, FILE *);
486 
487 /* ls_filter.c */
488 #ifdef HAVE_REGEX_H
489 void *G_ls_regex_filter(const char *, int, int, int);
490 void *G_ls_glob_filter(const char *, int, int);
491 void G_free_ls_filter(void *);
492 #endif
493 
494 /* make_loc.c */
495 int G_make_location(const char *, struct Cell_head *, const struct Key_Value *,
496  const struct Key_Value *);
497 int G_make_location_epsg(const char *, struct Cell_head *,
498  const struct Key_Value *, const struct Key_Value *,
499  const struct Key_Value *);
500 int G_make_location_crs(const char *, struct Cell_head *,
501  const struct Key_Value *, const struct Key_Value *,
502  const char *, const char *);
503 int G_write_projsrid(const char *, const char *);
504 int G_write_projwkt(const char *, const char *);
505 int G_compare_projections(const struct Key_Value *, const struct Key_Value *,
506  const struct Key_Value *, const struct Key_Value *);
507 
508 /* make_mapset.c */
509 int G_make_mapset(const char *, const char *, const char *);
510 
511 /* mapcase.c */
512 char *G_tolcase(char *);
513 char *G_toucase(char *);
514 
515 /* mapset.c */
516 const char *G_mapset(void);
517 char *G_mapset_path(void);
518 
519 /* mapset_msc.c */
520 int G_make_mapset_element(const char *);
521 int G_make_mapset_element_tmp(const char *);
522 int G_make_mapset_object_group(const char *);
523 int G_make_mapset_dir_object(const char *, const char *);
524 int G_make_mapset_object_group_tmp(const char *);
525 int G_make_mapset_object_group_basedir(const char *, const char *);
526 int G__make_mapset_element_misc(const char *, const char *);
527 int G_mapset_permissions(const char *);
528 int G_mapset_permissions2(const char *, const char *, const char *);
529 
530 /* mapset_nme.c */
531 const char *G_get_mapset_name(int);
532 void G_create_alt_search_path(void);
533 void G_switch_search_path(void);
534 void G_reset_mapsets(void);
535 char **G_get_available_mapsets(void);
536 void G_add_mapset_to_search_path(const char *);
537 int G_is_mapset_in_search_path(const char *);
538 
539 /* myname.c */
540 char *G_myname(void);
541 
542 /* named_colr.c */
543 int G_color_values(const char *, float *, float *, float *);
544 const char *G_color_name(int);
545 
546 /* nl_to_spaces.c */
547 void G_newlines_to_spaces(char *);
548 
549 /* nme_in_mps.c */
550 int G_name_is_fully_qualified(const char *, char *, char *);
551 char *G_fully_qualified_name(const char *, const char *);
552 int G_unqualified_name(const char *, const char *, char *, char *);
553 
554 /* omp_threads.c */
555 int G_set_omp_num_threads(struct Option *);
556 
557 /* open.c */
558 int G_open_new(const char *, const char *);
559 int G_open_old(const char *, const char *, const char *);
560 int G_open_update(const char *, const char *);
561 FILE *G_fopen_new(const char *, const char *);
562 FILE *G_fopen_old(const char *, const char *, const char *);
563 FILE *G_fopen_append(const char *, const char *);
564 FILE *G_fopen_modify(const char *, const char *);
565 
566 /* open_misc.c */
567 int G_open_new_misc(const char *, const char *, const char *);
568 int G_open_old_misc(const char *, const char *, const char *, const char *);
569 int G_open_update_misc(const char *, const char *, const char *);
570 FILE *G_fopen_new_misc(const char *, const char *, const char *);
571 FILE *G_fopen_old_misc(const char *, const char *, const char *, const char *);
572 FILE *G_fopen_append_misc(const char *, const char *, const char *);
573 FILE *G_fopen_modify_misc(const char *, const char *, const char *);
574 
575 /* overwrite.c */
576 int G_check_overwrite(int argc, char **argv);
577 
578 /* pager.c */
579 FILE *G_open_pager(struct Popen *);
580 void G_close_pager(struct Popen *);
581 FILE *G_open_mail(struct Popen *);
582 void G_close_mail(struct Popen *);
583 
584 /* parser.c */
585 void G_disable_interactive(void);
586 struct GModule *G_define_module(void);
587 struct Flag *G_define_flag(void);
588 struct Option *G_define_option(void);
589 struct Option *G_define_standard_option(int);
590 struct Flag *G_define_standard_flag(int);
591 int G_parser(int, char **);
592 void G_usage(void);
593 char *G_recreate_command(void);
594 void G_add_keyword(const char *);
595 void G_set_keywords(const char *);
596 int G_get_overwrite(void);
597 char *G_option_to_separator(const struct Option *);
598 FILE *G_open_option_file(const struct Option *);
599 void G_close_option_file(FILE *);
600 
601 /* parser_dependencies.c */
602 void G_option_rule(int, int, void **);
603 void G_option_exclusive(void *, ...);
604 void G_option_required(void *, ...);
605 void G_option_requires(void *, ...);
606 void G_option_requires_all(void *, ...);
607 void G_option_excludes(void *, ...);
608 void G_option_collective(void *, ...);
609 
610 /* paths.c */
611 int G_mkdir(const char *);
612 int G_is_dirsep(char);
613 int G_is_absolute_path(const char *);
614 char *G_convert_dirseps_to_host(char *);
615 char *G_convert_dirseps_from_host(char *);
616 int G_lstat(const char *, struct stat *);
617 int G_stat(const char *, struct stat *);
618 int G_owner(const char *);
619 
620 /* percent.c */
621 void G_percent(long, long, int);
622 void G_percent_reset(void);
623 void G_progress(long, int);
624 void G_set_percent_routine(int (*)(int));
625 void G_unset_percent_routine(void);
626 
627 /* popen.c */
628 void G_popen_clear(struct Popen *);
629 FILE *G_popen_write(struct Popen *, const char *, const char **);
630 FILE *G_popen_read(struct Popen *, const char *, const char **);
631 void G_popen_close(struct Popen *);
632 
633 /* plot.c */
634 void G_setup_plot(double, double, double, double, int (*)(int, int),
635  int (*)(int, int));
636 void G_setup_fill(int);
637 void G_plot_where_xy(double, double, int *, int *);
638 void G_plot_where_en(int, int, double *, double *);
639 void G_plot_point(double, double);
640 void G_plot_line(double, double, double, double);
641 void G_plot_line2(double, double, double, double);
642 int G_plot_polygon(const double *, const double *, int);
643 int G_plot_area(double *const *, double *const *, int *, int);
644 void G_plot_fx(double (*)(double), double, double);
645 
646 /* pole_in_poly.c */
647 int G_pole_in_polygon(const double *, const double *, int);
648 
649 /* progrm_nme.c */
650 const char *G_program_name(void);
651 const char *G_original_program_name(void);
652 void G_set_program_name(const char *);
653 
654 /* proj1.c */
655 int G_projection(void);
656 
657 /* proj2.c */
658 int G_projection_units(int);
659 const char *G_projection_name(int);
660 
661 /* proj3.c */
662 const char *G_database_unit_name(int);
663 int G_database_unit(void);
664 const char *G_database_projection_name(void);
665 const char *G_database_datum_name(void);
666 const char *G_database_ellipse_name(void);
668 const char *G_database_epsg_code(void);
669 
670 /* put_window.c */
671 int G_put_window(const struct Cell_head *);
672 int G_put_element_window(const struct Cell_head *, const char *, const char *);
673 
674 /* putenv.c */
675 void G_putenv(const char *, const char *);
676 
677 /* radii.c */
678 double G_meridional_radius_of_curvature(double, double, double);
679 double G_transverse_radius_of_curvature(double, double, double);
680 double G_radius_of_conformal_tangent_sphere(double, double, double);
681 
682 /* rd_cellhd.c */
683 void G__read_Cell_head(FILE *, struct Cell_head *);
684 void G__read_Cell_head_array(char **, struct Cell_head *);
685 
686 /* remove.c */
687 int G_remove(const char *, const char *);
688 int G_remove_misc(const char *, const char *, const char *);
689 int G_recursive_remove(const char *);
690 
691 /* rename.c */
692 int G_rename_file(const char *, const char *);
693 int G_rename(const char *, const char *, const char *);
694 
695 /* rhumbline.c */
696 int G_begin_rhumbline_equation(double, double, double, double);
697 double G_rhumbline_lat_from_lon(double);
698 
699 /* rotate.c */
700 void G_rotate_around_point(double, double, double *, double *, double);
701 void G_rotate_around_point_int(int, int, int *, int *, double);
702 
703 /* seek.c */
704 off_t G_ftell(FILE *);
705 void G_fseek(FILE *, off_t, int);
706 
707 /* set_window.c */
708 void G_get_set_window(struct Cell_head *);
709 void G_set_window(struct Cell_head *);
710 void G_unset_window(void);
711 
712 /* short_way.c */
713 void G_shortest_way(double *, double *);
714 
715 /* sleep.c */
716 void G_sleep(unsigned int);
717 
718 /* snprintf.c */
719 int G_snprintf(char *, size_t, const char *, ...)
720  __attribute__((format(printf, 3, 4)));
721 
722 /* strings.c */
723 int G_strcasecmp(const char *, const char *);
724 int G_strncasecmp(const char *, const char *, int);
725 char *G_store(const char *);
726 char *G_store_upper(const char *);
727 char *G_store_lower(const char *);
728 char *G_strchg(char *, char, char);
729 char *G_str_replace(const char *, const char *, const char *);
730 char *G_str_concat(const char **, int, const char *, int);
731 void G_strip(char *);
732 char *G_chop(char *);
733 void G_str_to_upper(char *);
734 void G_str_to_lower(char *);
735 int G_str_to_sql(char *);
736 void G_squeeze(char *);
737 char *G_strcasestr(const char *, const char *);
738 
739 /* tempfile.c */
740 void G_init_tempfile(void);
741 char *G_tempfile(void);
742 char *G_tempfile_basedir(const char *);
743 char *G_tempfile_pid(int);
744 char *G_tempfile_pid_basedir(int, const char *);
745 void G_temp_element(char *);
746 void G__temp_element(char *, int);
747 void G__temp_element_basedir(char *, const char *);
748 
749 /* mkstemp.c */
750 char *G_mktemp(char *);
751 int G_mkstemp(char *, int, int);
752 FILE *G_mkstemp_fp(char *, int, int);
753 
754 /* timestamp.c */
755 void G_init_timestamp(struct TimeStamp *);
756 void G_set_timestamp(struct TimeStamp *, const struct DateTime *);
757 void G_set_timestamp_range(struct TimeStamp *, const struct DateTime *,
758  const struct DateTime *);
759 int G_write_timestamp(FILE *, const struct TimeStamp *);
760 void G_get_timestamps(const struct TimeStamp *, struct DateTime *,
761  struct DateTime *, int *);
762 int G_format_timestamp(const struct TimeStamp *, char *);
763 int G_scan_timestamp(struct TimeStamp *, const char *);
764 int G_has_raster_timestamp(const char *, const char *);
765 int G_read_raster_timestamp(const char *, const char *, struct TimeStamp *);
766 int G_write_raster_timestamp(const char *, const struct TimeStamp *);
767 int G_remove_raster_timestamp(const char *);
768 int G_has_vector_timestamp(const char *, const char *, const char *);
769 int G_read_vector_timestamp(const char *, const char *, const char *,
770  struct TimeStamp *);
771 int G_write_vector_timestamp(const char *, const char *,
772  const struct TimeStamp *);
773 int G_remove_vector_timestamp(const char *, const char *);
774 int G_has_raster3d_timestamp(const char *, const char *);
775 int G_read_raster3d_timestamp(const char *, const char *, struct TimeStamp *);
776 int G_remove_raster3d_timestamp(const char *);
777 int G_write_raster3d_timestamp(const char *, const struct TimeStamp *);
778 
779 /* token.c */
780 char **G_tokenize(const char *, const char *);
781 char **G_tokenize2(const char *, const char *, const char *);
782 int G_number_of_tokens(char **);
783 void G_free_tokens(char **);
784 
785 /* trim_dec.c */
786 void G_trim_decimal(char *);
787 
788 /* units.c */
789 double G_meters_to_units_factor(int);
790 double G_meters_to_units_factor_sq(int);
791 const char *G_get_units_name(int, int, int);
792 int G_units(const char *);
793 int G_is_units_type_spatial(int);
794 int G_is_units_type_temporal(int);
795 
796 /* user_config.c */
797 #ifndef __MINGW32__
798 char *G_rc_path(const char *, const char *);
799 #endif
800 
801 /* verbose.c */
802 int G_verbose(void);
803 int G_verbose_min(void);
804 int G_verbose_std(void);
805 int G_verbose_max(void);
806 int G_set_verbose(int);
807 
808 /* view.c */
809 void G_3dview_warning(int);
810 int G_get_3dview_defaults(struct G_3dview *, struct Cell_head *);
811 int G_put_3dview(const char *, const struct G_3dview *,
812  const struct Cell_head *);
813 int G_get_3dview(const char *, const char *, struct G_3dview *);
814 
815 /* whoami.c */
816 const char *G_whoami(void);
817 
818 /* wind_2_box.c */
819 void G_adjust_window_to_box(const struct Cell_head *, struct Cell_head *, int,
820  int);
821 
822 /* wind_format.c */
823 void G_format_northing(double, char *, int);
824 void G_format_easting(double, char *, int);
825 void G_format_resolution(double, char *, int);
826 
827 /* wind_in.c */
828 int G_point_in_region(double, double);
829 int G_point_in_window(double, double, const struct Cell_head *);
830 
831 /* wind_limits.c */
832 int G_limit_east(double *, int);
833 int G_limit_west(double *, int);
834 int G_limit_north(double *, int);
835 int G_limit_south(double *, int);
836 
837 /* wind_overlap.c */
838 int G_window_overlap(const struct Cell_head *, double, double, double, double);
839 double G_window_percentage_overlap(const struct Cell_head *, double, double,
840  double, double);
841 
842 /* wind_scan.c */
843 int G_scan_northing(const char *, double *, int);
844 int G_scan_easting(const char *, double *, int);
845 int G_scan_resolution(const char *, double *, int);
846 
847 /* window_map.c */
848 double G_adjust_east_longitude(double, double);
849 double G_adjust_easting(double, const struct Cell_head *);
850 void G__init_window(void);
851 
852 /* worker.c */
853 void G_begin_execute(void (*func)(void *), void *, void **, int);
854 void G_end_execute(void **);
855 void G_init_workers(void);
856 void G_finish_workers(void);
857 
858 /* wr_cellhd.c */
859 void G__write_Cell_head(FILE *, const struct Cell_head *, int);
860 void G__write_Cell_head3(FILE *, const struct Cell_head *, int);
861 
862 /* writ_zeros.c */
863 void G_write_zeros(int, size_t);
864 
865 /* xdr.c */
866 void G_xdr_get_int(int *, const void *);
867 void G_xdr_put_int(void *, const int *);
868 void G_xdr_get_float(float *, const void *);
869 void G_xdr_put_float(void *, const float *);
870 void G_xdr_get_double(double *, const void *);
871 void G_xdr_put_double(void *, const double *);
872 
873 /* zero.c */
874 void G_zero(void *, int);
875 
876 /* zone.c */
877 int G_zone(void);
878 
879 #endif /* GRASS_GISDEFS_H */
char * G_file_name_misc(char *, const char *, const char *, const char *, const char *)
Builds full path names to GIS misc data files.
Definition: file_name.c:101
int G_has_vector_timestamp(const char *, const char *, const char *)
Check if timestamp for vector map exists.
Definition: timestamp.c:422
int G_open_update(const char *, const char *)
Open a database file for update.
Definition: gis/open.c:191
void G_unsetenv(const char *)
Remove name from environment.
Definition: env.c:499
void G_percent(long, long, int)
Print percent complete messages.
Definition: percent.c:61
int G_zlib_expand(unsigned char *src, int src_sz, unsigned char *dst, int dst_sz)
Definition: cmprzlib.c:165
void G_3dview_warning(int)
Turns 3D View warnings on and off.
Definition: view.c:45
void G_ascii_check(char *)
Removes non-ascii characters from buffer.
Definition: ascii_chk.c:31
double G_geodesic_distance_lon_to_lon(double, double)
Calculates geodesic distance.
Definition: geodist.c:121
int G_read_raster3d_timestamp(const char *, const char *, struct TimeStamp *)
Read timestamp from 3D raster map.
Definition: timestamp.c:594
int G_put_window(const struct Cell_head *)
Writes the region (window)
Definition: put_window.c:46
void G_set_percent_routine(int(*)(int))
Establishes percent_routine as the routine that will handle the printing of percentage progress messa...
Definition: percent.c:192
void G__read_Cell_head_array(char **, struct Cell_head *)
Read window from NULL terminated array of strings (for internal use only)
Definition: rd_cellhd.c:96
int G_name_is_fully_qualified(const char *, char *, char *)
Check if map name is fully qualified (map @ mapset)
Definition: nme_in_mps.c:36
void G_plot_fx(double(*)(double), double, double)
Plot f(east1) to f(east2)
Definition: plot.c:782
void G_free_list(char **)
Free list.
Definition: gis/list.c:248
char * G_double_to_basename_format(double, size_t, size_t)
Convert a double to a string substituting the dot with underscore 12.3456 => '12_3456'.
Definition: basename.c:76
void G_begin_geodesic_distance(double, double)
Begin geodesic distance.
Definition: geodist.c:50
struct GModule * G_define_module(void)
Initializes a new module.
Definition: parser.c:256
char * G_generate_basename(const char *, double, size_t, size_t)
Generate the format string.
Definition: basename.c:162
int G_make_location_epsg(const char *, struct Cell_head *, const struct Key_Value *, const struct Key_Value *, const struct Key_Value *)
Create a new location.
Definition: make_loc.c:126
void G_percent_reset(void)
Reset G_percent() to 0%; do not add newline.
Definition: percent.c:117
int G_mapset_permissions(const char *)
Check for user mapset permission.
Definition: mapset_msc.c:291
int G_num_standard_colors(void)
Get number of named colors (RGB triplets)
Definition: color_str.c:54
FILE * G_fopen_old(const char *, const char *, const char *)
Open a database file for reading.
Definition: gis/open.c:251
void G_begin_ellipsoid_polygon_area(double, double)
Begin area calculations.
Definition: area_poly1.c:66
void G_unset_percent_routine(void)
After this call subsequent percentage progress messages will be handled in the default method.
Definition: percent.c:203
double G_rhumbline_lat_from_lon(double)
Calculates rhumbline latitude.
Definition: rhumbline.c:97
char * G_basename(char *, const char *)
Truncates filename to the base part (before the last '.') if it matches the extension,...
Definition: basename.c:36
int int G_rasprintf(char **, size_t *, const char *,...) __attribute__((format(printf
const char * G_find_vector2(const char *, const char *)
Find a vector map (look but don't touch)
Definition: find_vect.c:62
char * G_tolcase(char *)
convert string to lower case
Definition: mapcase.c:18
int G_recursive_copy(const char *, const char *)
Copy recursively source directory to destination directory.
Definition: copy_dir.c:70
int G_getl2(char *, int, FILE *)
Gets a line of text from a file of any pedigree.
Definition: getl.c:60
void G_init_all(void)
Initialize environment.
Definition: gisinit.c:174
void G_init_workers(void)
Definition: worker.c:181
const char * G_database_epsg_code(void)
Get EPGS code for the current location.
Definition: proj3.c:236
int G_make_location_crs(const char *, struct Cell_head *, const struct Key_Value *, const struct Key_Value *, const char *, const char *)
Create a new location.
Definition: make_loc.c:185
FILE * G_mkstemp_fp(char *, int, int)
Returns a file descriptor.
Definition: mkstemp.c:163
void G_xdr_put_float(void *, const float *)
Definition: gis/xdr.c:84
struct ilist * G_new_ilist(void)
Return a new integer list.
Definition: ilist.c:43
char ** G_tokenize2(const char *, const char *, const char *)
Tokenize string.
Definition: gis/token.c:83
int G_sleep_on_error(int)
Turn on/off no_sleep flag.
Definition: gis/error.c:242
void G_zero(void *, int)
Zero out a buffer, buf, of length i.
Definition: gis/zero.c:23
int G_vfaprintf(FILE *, const char *, va_list)
vfprintf() version of G_aprintf(). See G_aprintf() for more details.
Definition: aprintf.c:392
void G_free(void *)
Free allocated memory.
Definition: gis/alloc.c:150
int G_is_gisbase(const char *)
Test if specified directory is GISBASE.
Definition: is.c:49
void G_squeeze(char *)
Remove superfluous white space.
Definition: strings.c:446
struct Key_Value * G_get_projinfo(void)
Gets projection information for location.
Definition: get_projinfo.c:61
void G_close_option_file(FILE *)
Close an input/output file returned by G_open_option_file(). If the file pointer is stdin,...
Definition: parser.c:1958
double G_area_of_polygon(const double *, const double *, int)
Area in square meters of polygon.
Definition: gis/area.c:159
char * G_color_rules_options(void)
Get list of color rules for Option->options.
void G_plot_line2(double, double, double, double)
Plot line between latlon coordinates (slowline)
Definition: plot.c:224
FILE * G_fopen_old_misc(const char *, const char *, const char *, const char *)
open a database misc file for reading
Definition: open_misc.c:205
void G_shortest_way(double *, double *)
Shortest way between two eastings.
Definition: short_way.c:28
void G_reset_mapsets(void)
Reset number of mapsets.
Definition: mapset_nme.c:135
void G_set_timestamp(struct TimeStamp *, const struct DateTime *)
void G_switch_env(void)
Switch environments.
Definition: env.c:591
int G_bz2_compress(unsigned char *src, int src_sz, unsigned char *dst, int dst_sz)
Definition: cmprbzip.c:85
long G_mrand48(void)
Generate an integer in the range [-2^31, 2^31)
Definition: lrand48.c:151
char * G_mapset_path(void)
Get current mapset UNIX-like path.
Definition: gis/mapset.c:73
void G__read_Cell_head(FILE *, struct Cell_head *)
Read cell header (for internal use only)
Definition: rd_cellhd.c:56
void G__write_Cell_head(FILE *, const struct Cell_head *, int)
Write cell header or window.
Definition: wr_cellhd.c:28
FILE * G_open_mail(struct Popen *)
Definition: pager.c:45
int G_unqualified_name(const char *, const char *, char *, char *)
Returns unqualified map name (without @ mapset)
Definition: nme_in_mps.c:134
const char * G_database_projection_name(void)
Query cartographic projection for the current location.
Definition: proj3.c:118
const char * G_find_file2(const char *, const char *, const char *)
Searches for a file from the mapset search list or in a specified mapset. (look but don't touch)
Definition: find_file.c:234
int G__make_mapset_element_misc(const char *, const char *)
Create misc element in the current mapset.
Definition: mapset_msc.c:260
const char * G_datum_ellipsoid(int)
Definition: gis/datum.c:76
void void void void G_fatal_error(const char *,...) __attribute__((format(printf
struct Key_Value * G_get_projunits(void)
Gets units information for location.
Definition: get_projinfo.c:32
long G_lrand48(void)
Generate an integer in the range [0, 2^31)
Definition: lrand48.c:136
double G_darea0_on_sphere(double)
Calculates integral for area between two latitudes.
Definition: area_sphere.c:47
const char * G_date(void)
Current date and time.
Definition: date.c:26
int G_faprintf(FILE *, const char *,...)
fprintf() version of G_aprintf(). See G_aprintf() for more details.
Definition: aprintf.c:485
int G_mkstemp(char *, int, int)
Returns a file descriptor.
Definition: mkstemp.c:128
int G_is_location(const char *)
Test if specified directory is location.
Definition: is.c:62
char * G_option_to_separator(const struct Option *)
Get separator string from the option.
Definition: parser.c:1857
void G_warning(const char *,...) __attribute__((format(printf
int G_write_vector_timestamp(const char *, const char *, const struct TimeStamp *)
Write timestamp of vector map.
Definition: timestamp.c:507
int G_parser(int, char **)
Parse command line.
Definition: parser.c:321
int G_pole_in_polygon(const double *, const double *, int)
Check if pole is in polygon.
Definition: pole_in_poly.c:35
void G_option_rule(int, int, void **)
Set generic option rule.
void G_temp_element(char *)
Populates element with a path string.
Definition: tempfile.c:147
int G_expand(unsigned char *, int, unsigned char *, int, int)
Definition: compress.c:233
FILE * G_fopen_append_misc(const char *, const char *, const char *)
Definition: open_misc.c:217
int G_verbose_max(void)
Get max verbosity level.
Definition: verbose.c:81
void G_finish_workers(void)
Definition: worker.c:185
int G_make_mapset_dir_object(const char *, const char *)
Create directory for an object of a given type.
Definition: mapset_msc.c:108
int G_write_timestamp(FILE *, const struct TimeStamp *)
Output TimeStamp structure to a file as a formatted string.
Definition: timestamp.c:160
void G_lat_format(double, char *)
Definition: ll_format.c:40
void G_xdr_get_int(int *, const void *)
Definition: gis/xdr.c:69
double G_area_of_cell_at_row(int)
Cell area in specified row.
Definition: gis/area.c:87
void G_putenv(const char *, const char *)
Sets the UNIX environment variable name to value.
Definition: putenv.c:31
int G_get_spheroid_by_name(const char *, double *, double *, double *)
Get spheroid parameters by name.
Definition: get_ellipse.c:153
FILE * G_open_pager(struct Popen *)
Definition: pager.c:13
void G_plot_point(double, double)
Plot point.
Definition: plot.c:190
int G_scan_easting(const char *, double *, int)
ASCII easting to double.
Definition: wind_scan.c:69
FILE * G_popen_read(struct Popen *, const char *, const char **)
Definition: popen.c:67
void G_set_error_routine(int(*)(const char *, int))
Establishes error_routine as the routine that will handle the printing of subsequent error messages.
Definition: gis/error.c:260
void * G_ls_regex_filter(const char *, int, int, int)
Definition: ls_filter.c:151
void G_setenv(const char *, const char *)
Set environment variable (updates .gisrc)
Definition: env.c:442
char * G_file_name(char *, const char *, const char *, const char *)
Builds full path names to GIS data files.
Definition: file_name.c:61
int G_color_values(const char *, float *, float *, float *)
Definition: named_colr.c:20
int G_begin_cell_area_calculations(void)
Begin cell area calculations.
Definition: gis/area.c:46
void G_plot_where_en(int, int, double *, double *)
Converts x,y to east,north.
Definition: plot.c:178
void G_free_ilist(struct ilist *)
Free allocated memory of an integer list.
Definition: ilist.c:27
void G_setenv2(const char *, const char *, int)
Set environment variable from specific place (updates .gisrc)
Definition: env.c:459
int G_snprintf(char *, size_t, const char *,...) __attribute__((format(printf
char * G_store_upper(const char *)
Copy string to allocated memory and convert copied string to upper case.
Definition: strings.c:117
int G_get_3dview(const char *, const char *, struct G_3dview *)
Gets a 3D View.
Definition: view.c:243
int G_find_color_rule(const char *)
Check if color rule is defined.
void G_done_msg(const char *,...) __attribute__((format(printf
int G_get_ellipsoid_parameters(double *, double *)
get ellipsoid parameters
Definition: get_ellipse.c:66
double G_database_units_to_meters_factor(void)
Conversion to meters.
Definition: proj3.c:146
int G_window_overlap(const struct Cell_head *, double, double, double, double)
Determines if a box overlays a map window.
Definition: wind_overlap.c:35
int G_compare_projections(const struct Key_Value *, const struct Key_Value *, const struct Key_Value *, const struct Key_Value *)
Compare projections including units.
Definition: make_loc.c:231
void G_get_set_window(struct Cell_head *)
Get the current working window (region)
void G_newlines_to_spaces(char *)
Definition: nl_to_spaces.c:3
int G_open_new(const char *, const char *)
Open a new database file.
Definition: gis/open.c:149
int G_write_raster_timestamp(const char *, const struct TimeStamp *)
Write timestamp of raster map.
Definition: timestamp.c:391
char * G_toucase(char *)
convert string to upper case
Definition: mapcase.c:46
void G_progress(long, int)
Print progress info messages.
Definition: percent.c:158
const char * G_get_mapset_name(int)
Get name of the n'th mapset from the current mapset search path.
Definition: mapset_nme.c:44
void G__gisinit(const char *, const char *)
Initialize GIS Library and ensures a valid mapset is available.
Definition: gisinit.c:43
void G_close_pager(struct Popen *)
Definition: pager.c:35
char * G_get_projsrid(void)
Get srid (spatial reference id) for the current location.
Definition: get_projinfo.c:237
void G_init_ilist(struct ilist *)
Init an integer list and free allocated memory.
Definition: ilist.c:58
void G_popen_clear(struct Popen *)
Definition: popen.c:56
struct Option * G_define_standard_option(int)
Create standardised Option structure.
void G_rotate_around_point_int(int, int, int *, int *, double)
Rotate point (int version)
Definition: rotate.c:60
double G_transverse_radius_of_curvature(double, double, double)
Transverse radius of curvature.
Definition: radii.c:106
void G__write_Cell_head3(FILE *, const struct Cell_head *, int)
Write 3D cell header or window.
Definition: wr_cellhd.c:74
int G_rename_file(const char *, const char *)
Rename a file or a directory in the filesystem.
Definition: rename.c:31
void G_option_exclusive(void *,...)
Sets the options to be mutually exclusive.
char * G_tempfile_basedir(const char *)
Returns a temporary file name.
Definition: tempfile.c:77
int G_begin_geodesic_equation(double, double, double, double)
Definition: geodesic.c:38
double G_area_for_zone_on_sphere(double, double)
Calculates area between latitudes.
Definition: area_sphere.c:69
long G_srand48_auto(void)
Seed the pseudo-random number generator from the time and PID.
Definition: lrand48.c:72
void G_lon_format(double, char *)
Definition: ll_format.c:55
jmp_buf * G_fatal_longjmp(int)
Definition: gis/error.c:66
char * G_tempfile_pid_basedir(int, const char *)
Create tempfile from process id in given base directory.
Definition: tempfile.c:120
int G_lz4_compress(unsigned char *src, int src_sz, unsigned char *dst, int dst_sz)
Definition: cmprlz4.c:78
const char * G_gisdbase(void)
Get name of top level database directory.
Definition: gisdbase.c:26
double G_meters_to_units_factor_sq(int)
Units conversion from square meters to square units.
Definition: units.c:88
int G_limit_east(double *, int)
void * G__realloc(const char *, int, void *, size_t)
Memory reallocation.
Definition: gis/alloc.c:119
int G_default_compressor(void)
Definition: compress.c:126
int G_legal_filename(const char *)
Check for legal database file name.
Definition: legal_name.c:34
int G_bz2_expand(unsigned char *src, int src_sz, unsigned char *dst, int dst_sz)
Definition: cmprbzip.c:168
int G_write_raster3d_timestamp(const char *, const struct TimeStamp *)
Write timestamp of 3D raster map.
Definition: timestamp.c:611
char * G_str_replace(const char *, const char *, const char *)
Replace all occurrences of old_str in buffer with new_str.
Definition: strings.c:189
void int G_is_little_endian(void)
Tests for little ENDIAN.
Definition: endian.c:24
void G_xdr_get_float(float *, const void *)
Definition: gis/xdr.c:79
const char * G_find_key_value(const char *, const struct Key_Value *)
Find given key (case sensitive)
Definition: key_value1.c:85
const char * G_home(void)
Get user's home directory.
Definition: home.c:32
void G_set_gisrc_mode(int)
Set where to find/store variables.
Definition: env.c:63
FILE * G_open_option_file(const struct Option *)
Get an input/output file pointer from the option. If the file name is omitted or '-',...
Definition: parser.c:1919
void G_setup_plot(double, double, double, double, int(*)(int, int), int(*)(int, int))
Initialize plotting routines.
Definition: plot.c:97
struct Option * G_define_option(void)
Initializes an Option struct.
Definition: parser.c:211
int G_format_timestamp(const struct TimeStamp *, char *)
Create text string from TimeStamp structure.
Definition: timestamp.c:183
void G_end_execute(void **)
void G_str_to_upper(char *)
Convert string to upper case.
Definition: strings.c:365
void G_set_geodesic_distance_lat1(double)
Sets geodesic distance lat1.
Definition: geodist.c:69
int G_lon_scan(const char *, double *)
Definition: ll_scan.c:50
int G_get_ellipsoid_by_name(const char *, double *, double *)
Get ellipsoid parameters by name.
Definition: get_ellipse.c:104
int G_open_old_misc(const char *, const char *, const char *, const char *)
open a database misc file for reading
Definition: open_misc.c:132
int G_fwrite_key_value(FILE *, const struct Key_Value *)
Write key/value pairs to file.
Definition: key_value2.c:25
FILE * G_fopen_modify_misc(const char *, const char *, const char *)
Definition: open_misc.c:230
int G_str_to_sql(char *)
Make string SQL compliant.
Definition: strings.c:403
int G_snaprintf(char *, size_t, const char *,...)
snprintf() version of G_aprintf(). See G_aprintf() for more details.
Definition: aprintf.c:527
void G__temp_element(char *, int)
Populates element with a path string (internal use only!)
Definition: tempfile.c:159
const char * G_find_file_misc(const char *, const char *, char *, const char *)
Searches for a misc file from the mapset search list or in a specified mapset.
Definition: find_file.c:208
const char * G_config_path(void)
Get user's config path directory.
Definition: home.c:98
int G_read_raster_timestamp(const char *, const char *, struct TimeStamp *)
Read timestamp from raster map.
Definition: timestamp.c:374
void G_option_required(void *,...)
Sets the options to be required.
const char * G_datum_description(int)
Definition: gis/datum.c:66
int G_make_mapset_object_group(const char *)
Create directory for group of elements of a given type.
Definition: mapset_msc.c:74
void G_unsetenv2(const char *, int)
Remove name from environment from specific place.
Definition: env.c:514
int int int G_aprintf(const char *,...)
Adjust the width of string specifiers to the display space instead of the number of bytes for wide ch...
Definition: aprintf.c:465
void G_fseek(FILE *, off_t, int)
Change the file position of the stream.
Definition: gis/seek.c:50
void G_ls(const char *, FILE *)
Prints a directory listing to a stream, in prettified column format.
Definition: ls.c:137
const char * G_find_raster2(const char *, const char *)
Find a raster map (look but don't touch)
Definition: find_rast.c:76
void G_set_ls_exclude_filter(int(*)(const char *, void *), void *)
void G_free_ls_filter(void *)
Definition: ls_filter.c:190
void G_option_collective(void *,...)
Sets the options to be collective.
void void G_verbose_message(const char *,...) __attribute__((format(printf
const char * G_whoami(void)
Gets user's name.
Definition: gis/whoami.c:35
double G_distance_point_to_line_segment(double, double, double, double, double, double)
Returns distance between a point and line segment in meters.
Definition: gis/distance.c:117
char * G_find_etc(const char *)
searches for a file from the etc search list in GRASS_ADDON_ETC returns the full path to where the fi...
Definition: find_etc.c:62
void G_remove_error_handler(void(*)(void *), void *)
Remove existing error handler.
Definition: gis/handler.c:85
void G_close_mail(struct Popen *)
Definition: pager.c:65
const char * G_get_units_name(int, int, int)
Get localized units name.
Definition: units.c:204
int G_lz4_expand(unsigned char *src, int src_sz, unsigned char *dst, int dst_sz)
Definition: cmprlz4.c:146
char * G_tempfile_pid(int)
Create tempfile from process id.
Definition: tempfile.c:90
void G_popen_close(struct Popen *)
Definition: popen.c:72
char * G_tempfile(void)
Returns a temporary file name.
Definition: tempfile.c:62
int G_open_update_misc(const char *, const char *, const char *)
open a database misc file for update
Definition: open_misc.c:152
const char * G_getenv_nofatal2(const char *, int)
Get environment variable from specific place.
Definition: env.c:424
void G_option_excludes(void *,...)
Exclude selected options.
int G_make_mapset_element(const char *)
Create element in the current mapset.
Definition: mapset_msc.c:44
double G_distance2_point_to_line(double, double, double, double, double, double)
Definition: gis/line_dist.c:15
int G_is_absolute_path(const char *)
Checks if a specified path looks like an absolute path on the host system.
Definition: paths.c:62
int G_open_old(const char *, const char *, const char *)
Open a database file for reading.
Definition: gis/open.c:170
int G_get_overwrite(void)
Get overwrite value.
Definition: parser.c:957
void G_free_key_value(struct Key_Value *)
Free allocated Key_Value structure.
Definition: key_value1.c:104
int G_projection_units(int)
Get projection units code (for internal use only)
Definition: proj2.c:32
const char * G_getenv2(const char *, int)
Get variable from specific place.
Definition: env.c:386
char * G_compressor_name(int)
Definition: compress.c:118
int G_lstat(const char *, struct stat *)
Get file status.
Definition: paths.c:145
FILE * G_fopen_new_misc(const char *, const char *, const char *)
open a new database misc file
Definition: open_misc.c:178
const char * G_getenv(const char *)
Get environment variable.
Definition: env.c:360
void G__read_gisrc_env(void)
Force to read the GISRC environment file.
Definition: env.c:112
void G_rotate_around_point(double, double, double *, double *, double)
Rotate point (double version)
Definition: rotate.c:33
void G_setenv_nogisrc2(const char *, const char *, int)
Set environment name to value from specific place (doesn't update .gisrc)
Definition: env.c:486
const char * G_mapset(void)
Get current mapset name.
Definition: gis/mapset.c:33
void G_unset_window(void)
Unset current region.
Definition: get_window.c:135
char * G_mktemp(char *)
Opens a temporary file.
Definition: mkstemp.c:105
char * G_file_name_basedir(char *, const char *, const char *, const char *, const char *)
Builds full path names to GIS data files in temporary directory (for internal use only)
Definition: file_name.c:154
char * G_file_name_tmp(char *, const char *, const char *, const char *)
Builds full path names to GIS data files in temporary directory (for internal use only)
Definition: file_name.c:125
const char * G_color_name(int)
Definition: named_colr.c:35
const char * G_ellipsoid_name(int)
Get ellipsoid name.
Definition: get_ellipse.c:132
void G__temp_element_basedir(char *, const char *)
Populates element with a path string (internal use only!)
Definition: tempfile.c:185
size_t G_get_num_decimals(const char *)
Get number of decimals from a string.
Definition: basename.c:54
void G_set_key_value(const char *, const char *, struct Key_Value *)
Set value for given key.
Definition: key_value1.c:39
int G_limit_north(double *, int)
Limit north (y) coordinate.
Definition: wind_limits.c:71
double G_geodesic_distance(double, double, double, double)
Calculates geodesic distance.
Definition: geodist.c:195
void G_get_default_window(struct Cell_head *)
Get the default region.
Definition: get_window.c:95
void G_bresenham_line(int, int, int, int, int(*)(int, int))
Bresenham line algorithm.
Definition: bres_line.c:30
int G_remove_raster_timestamp(const char *)
Remove timestamp from raster map.
Definition: timestamp.c:407
void G_get_timestamps(const struct TimeStamp *, struct DateTime *, struct DateTime *, int *)
Copy TimeStamp into [two] Datetimes structs.
Definition: timestamp.c:260
int G_make_mapset_object_group_tmp(const char *)
Create directory for type of objects in the temporary directory.
Definition: mapset_msc.c:153
void G_option_requires(void *,...)
Define a list of options from which at least one option is required if first option is present.
char * G_color_rules_description_type(void)
Get color rules description for Option->descriptions.
void G_set_timestamp_range(struct TimeStamp *, const struct DateTime *, const struct DateTime *)
struct Flag * G_define_standard_flag(int)
Create standardised Flag structure.
int G_no_compress(unsigned char *src, int src_sz, unsigned char *dst, int dst_sz)
Definition: compress.c:155
double G_planimetric_polygon_area(const double *, const double *, int)
Calculates planimetric polygon area.
Definition: area_poly2.c:25
char ** G_get_available_mapsets(void)
Get list of available mapsets for current location.
Definition: mapset_nme.c:147
int G_read_compressed(int, int, unsigned char *, int, int)
Definition: compress.c:244
int G_has_raster_timestamp(const char *, const char *)
Check if timestamp for raster map exists.
Definition: timestamp.c:356
int G_copy_file(const char *, const char *)
Copies one file to another.
Definition: copy_file.c:33
void G_adjust_window_to_box(const struct Cell_head *, struct Cell_head *, int, int)
Adjusts window to a rectangular box.
Definition: wind_2_box.c:31
FILE * G_fopen_modify(const char *, const char *)
Open a database file for update (r+ mode)
Definition: gis/open.c:306
void G_set_window(struct Cell_head *)
Establishes window as the current working window (region).
off_t G_ftell(FILE *)
Get the current file position of the stream.
Definition: gis/seek.c:29
int G_vsaprintf(char *, const char *, va_list)
vsprintf() version of G_aprintf(). See G_aprintf() for more details.
Definition: aprintf.c:411
void G_llres_format(double, char *)
Definition: ll_format.c:70
int G_lookup_key_value_from_file(const char *, const char *, char[], int)
Look up for key in file.
Definition: key_value4.c:48
int G_set_omp_num_threads(struct Option *)
Set the number of threads for OpenMP The intended usage is at the beginning of a C tool when paramete...
Definition: omp_threads.c:19
char * G_str_concat(const char **, int, const char *, int)
String concatenation.
Definition: strings.c:267
void G_trim_decimal(char *)
Removes trailing zeros from decimal number.
Definition: trim_dec.c:24
void G_set_keywords(const char *)
Set keywords from the string.
Definition: parser.c:882
const char * G_lon_format_string(void)
Definition: ll_format.c:65
double G_geodesic_lat_from_lon(double)
Definition: geodesic.c:78
void G_list_element(const char *, const char *, const char *, int(*)(const char *, const char *, char *))
General purpose list function.
Definition: gis/list.c:51
void G_update_key_value_file(const char *, const char *, const char *)
Update file, set up value for given key.
Definition: key_value4.c:26
void G_ls_format(char **, int, int, FILE *)
Prints a listing of items to a stream, in prettified column format.
Definition: ls.c:165
char * G_strcasestr(const char *, const char *)
Finds the first occurrence of the sub-string in the null-terminated string ignoring case (upper or lo...
Definition: strings.c:477
int G_rle_compress(unsigned char *src, int src_sz, unsigned char *dst, int dst_sz)
Definition: cmprrle.c:73
int G_get_datumparams_from_projinfo(const struct Key_Value *, char *, char *)
Definition: gis/datum.c:107
const char * G_find_vector(char *, const char *)
Finds a vector map.
Definition: find_vect.c:41
const char * G_get_env_name(int)
Get variable name for index n.
Definition: env.c:546
int G_units(const char *)
Get units code by name.
Definition: units.c:320
void G_read_datum_table(void)
Definition: gis/datum.c:141
void G_add_keyword(const char *)
Add keyword to the list.
Definition: parser.c:866
void G_add_mapset_to_search_path(const char *)
Add mapset to the list of mapsets in search path.
Definition: mapset_nme.c:203
struct Key_Value * G_fread_key_value(FILE *)
Read key/values pairs from file.
Definition: key_value2.c:49
void G_format_resolution(double, char *, int)
Resolution to ASCII.
Definition: wind_format.c:69
void G_init_timestamp(struct TimeStamp *)
Initialize timestamp structure.
Definition: timestamp.c:95
int G_verbose(void)
Get current verbosity level.
Definition: verbose.c:60
size_t G_strlcat(char *, const char *, size_t)
Size-bounded string concatenation.
Definition: strlcat.c:57
void G__read_mapset_env(void)
Force to read the mapset environment file VAR.
Definition: env.c:98
double G_distance_between_line_segments(double, double, double, double, double, double, double, double)
Returns distance between two line segments in meters.
Definition: gis/distance.c:91
int G_mapset_permissions2(const char *, const char *, const char *)
Check for user mapset permission.
Definition: mapset_msc.c:320
int G_remove(const char *, const char *)
Remove a database file.
Definition: remove.c:44
int G_put_3dview(const char *, const struct G_3dview *, const struct Cell_head *)
Saves info to a 3d.view file in the current mapset.
Definition: view.c:163
char * G_store_lower(const char *)
Copy string to allocated memory and convert copied string to lower case.
Definition: strings.c:141
const char * G_find_raster(char *, const char *)
Find a raster map.
Definition: find_rast.c:55
const char * G_projection_name(int)
Get projection name.
Definition: proj2.c:55
int G_verbose_min(void)
Get min verbosity level.
Definition: verbose.c:101
void G_free_tokens(char **)
Free memory allocated to tokens.
Definition: gis/token.c:198
int G_remove_raster3d_timestamp(const char *)
Remove timestamp from 3D raster map.
Definition: timestamp.c:627
const char * G_find_file2_misc(const char *, const char *, const char *, const char *)
Searches for a misc file from the mapset search list or in a specified mapset. (look but don't touch)
Definition: find_file.c:257
int G_remove_misc(const char *, const char *, const char *)
Remove a database misc file.
Definition: remove.c:65
double G_window_percentage_overlap(const struct Cell_head *, double, double, double, double)
Determines percentage of box is contained in the window.
Definition: wind_overlap.c:80
int G_compress(unsigned char *, int, unsigned char *, int, int)
Definition: compress.c:218
int G_begin_rhumbline_equation(double, double, double, double)
Start rhumbline calculations.
Definition: rhumbline.c:58
void G_create_alt_search_path(void)
Define alternative mapset search path.
Definition: mapset_nme.c:106
char ** G_ls2(const char *, int *)
Stores a sorted directory listing in an array.
Definition: ls.c:94
void void void G_important_message(const char *,...) __attribute__((format(printf
void G_strip(char *)
Removes all leading and trailing white space from string.
Definition: strings.c:300
int G_is_units_type_spatial(int)
Check if the unit is of spatial type.
Definition: units.c:134
int G_get_datum_by_name(const char *)
Definition: gis/datum.c:43
char * G_get_projwkt(void)
Get WKT information for the current location.
Definition: get_projinfo.c:127
int G_compressor_number(char *)
Definition: compress.c:100
int G_check_compressor(int)
Definition: compress.c:140
int G_rle_expand(unsigned char *src, int src_sz, unsigned char *dst, int dst_sz)
Definition: cmprrle.c:139
int G_is_mapset(const char *)
Test if specified directory is mapset.
Definition: is.c:75
void G_begin_zone_area_on_sphere(double, double)
Initialize calculations for sphere.
Definition: area_sphere.c:35
int G_asprintf(char **, const char *,...) __attribute__((format(printf
int G_scan_timestamp(struct TimeStamp *, const char *)
Fill a TimeStamp structure from a datetime string.
Definition: timestamp.c:217
void G_str_to_lower(char *)
Convert string to lower case.
Definition: strings.c:383
int G_plot_polygon(const double *, const double *, int)
Plot filled polygon with n vertices.
Definition: plot.c:374
double G_meters_to_units_factor(int)
Units conversion from meters to units.
Definition: units.c:38
char * G_myname(void)
Returns location title.
Definition: myname.c:31
double G_darea0_on_ellipsoid(double)
Calculate integral for area between two latitudes.
Definition: area_ellipse.c:63
double G_adjust_easting(double, const struct Cell_head *)
Returns east not smaller than west.
int G_get_gisrc_mode(void)
Get info where variables are stored.
Definition: env.c:73
void G_sleep(unsigned int)
Definition: sleep.c:11
char * G_recreate_command(void)
Creates command to run non-interactive.
Definition: parser.c:838
void G_xdr_put_double(void *, const double *)
Definition: gis/xdr.c:94
int G_make_mapset_object_group_basedir(const char *, const char *)
Create directory for type of objects in the temporary directory.
Definition: mapset_msc.c:175
void G_switch_search_path(void)
Switch mapset search path.
Definition: mapset_nme.c:117
struct Key_Value * G_read_key_value_file(const char *)
Read key/values pairs from file.
Definition: key_value3.c:55
const char * G_find_raster3d(const char *, const char *)
Search for a 3D raster map in current search path or in a specified mapset.
Definition: find_rast3d.c:28
void G_begin_zone_area_on_ellipsoid(double, double, double)
Begin area calculations for ellipsoid.
Definition: area_ellipse.c:47
void G_set_program_name(const char *)
Set program name.
Definition: progrm_nme.c:61
int G_number_of_tokens(char **)
Return number of tokens.
Definition: gis/token.c:179
char * G_location_path(void)
Get current location UNIX-like path.
Definition: location.c:54
char * G_get_basename_separator(void)
Return the environmental basename variable or the default value.
Definition: basename.c:109
int G_stat(const char *, struct stat *)
Get file status.
Definition: paths.c:128
void G_create_alt_env(void)
Set up alternative environment variables.
Definition: env.c:569
int G_write_compressed(int, unsigned char *, int, int)
Definition: compress.c:323
int G_zlib_compress(unsigned char *src, int src_sz, unsigned char *dst, int dst_sz)
Definition: cmprzlib.c:87
char * G_fully_qualified_name(const char *, const char *)
Get fully qualified element name.
Definition: nme_in_mps.c:101
void G__init_window(void)
Initialize window (region).
const char * G_ellipsoid_description(int)
Get description for nth ellipsoid.
Definition: get_ellipse.c:182
void G_unset_error_routine(void)
After this call subsequent error messages will be handled in the default method.
Definition: gis/error.c:274
int G_read_ellipsoid_table(int)
Read ellipsoid table.
Definition: get_ellipse.c:246
int G_intersect_line_segments(double, double, double, double, double, double, double, double, double *, double *, double *, double *)
Definition: gis/intersect.c:84
char * G_strchg(char *, char, char)
Replace all occurrences of character in string bug with new.
Definition: strings.c:160
void G_add_error_handler(void(*)(void *), void *)
Add new error handler.
Definition: gis/handler.c:71
void G_xdr_get_double(double *, const void *)
Definition: gis/xdr.c:89
double G_distance(double, double, double, double)
Returns distance in meters.
Definition: gis/distance.c:75
void G__read_gisrc_path(void)
Read or read again the GISRC (session) environment variable.
Definition: env.c:125
void G_clicker(void)
Definition: clicker.c:17
int G_lat_scan(const char *, double *)
Definition: ll_scan.c:45
const char * G_llres_format_string(void)
Definition: ll_format.c:81
void G_set_ls_filter(int(*)(const char *, void *), void *)
int G_make_mapset_element_tmp(const char *)
Create element in the temporary directory.
Definition: mapset_msc.c:131
int G_zone(void)
Query cartographic zone.
Definition: zone.c:24
int G_scan_resolution(const char *, double *, int)
ASCII resolution to double.
Definition: wind_scan.c:100
int G_point_in_window(double, double, const struct Cell_head *)
Returns TRUE if coordinate is within the given map region.
Definition: wind_in.c:48
void G_disable_interactive(void)
Disables the ability of the parser to operate interactively.
Definition: parser.c:140
double G_adjust_east_longitude(double, double)
Adjust east longitude.
int G_is_initialized(int *)
Definition: counter.c:60
int G_zstd_compress(unsigned char *src, int src_sz, unsigned char *dst, int dst_sz)
Definition: cmprzstd.c:86
int G_plot_area(double *const *, double *const *, int *, int)
Plot multiple polygons.
Definition: plot.c:504
struct Flag * G_define_flag(void)
Initializes a Flag struct.
Definition: parser.c:157
void * G_ls_glob_filter(const char *, int, int)
Definition: ls_filter.c:171
int G_point_in_region(double, double)
Returns TRUE if coordinate is within the current region settings.
Definition: wind_in.c:25
const char * G_database_unit_name(int)
Get units (localized) name for the current location.
Definition: proj3.c:53
double G_drand48(void)
Generate a floating-point value in the range [0,1)
Definition: lrand48.c:166
void G_write_key_value_file(const char *, const struct Key_Value *)
Write key/value pairs to file.
Definition: key_value3.c:28
int G_limit_south(double *, int)
Limit south (y) coordinate.
Definition: wind_limits.c:100
void G_initialize_done(int *)
Definition: counter.c:77
void G_xdr_put_int(void *, const int *)
Definition: gis/xdr.c:74
int G_is_dirsep(char)
Checks if a specified character is a valid directory separator character on the host system.
Definition: paths.c:45
#define G_incr_void_ptr(ptr, size)
Definition: defs/gis.h:81
int G_owner(const char *)
Get owner id of path.
Definition: paths.c:164
void G_setup_fill(int)
Set row_fill routine to row_solid_fill or row_dotted_fill.
Definition: plot.c:133
int int G_strcasecmp(const char *, const char *)
String compare ignoring case (upper or lower)
Definition: strings.c:47
int G_recursive_remove(const char *)
Recursively remove all files in given directory.
Definition: remove.c:113
const char * G_original_program_name(void)
Return original path of the executed program.
Definition: progrm_nme.c:46
void G_get_element_window(struct Cell_head *, const char *, const char *, const char *)
Get region for selected element (raster, vector, window, etc.)
Definition: get_window.c:110
int G_remove_vector_timestamp(const char *, const char *)
Remove timestamp from vector map.
Definition: timestamp.c:553
void G_ilist_add(struct ilist *, int)
Add item to ilist.
Definition: ilist.c:78
int G_strncasecmp(const char *, const char *, int)
String compare ignoring case (upper or lower) - limited number of characters.
Definition: strings.c:69
void G_set_distance_to_line_tolerance(double)
Definition: gis/line_dist.c:8
int G_vsnaprintf(char *, size_t, const char *, va_list)
vsnprintf() version of G_aprintf(). See G_aprintf() for more details.
Definition: aprintf.c:432
void G__no_gisinit(const char *)
Initialize GIS Library.
Definition: gisinit.c:98
int G_counter_next(struct Counter *)
Definition: counter.c:46
double G_ellipsoid_polygon_area(const double *, const double *, int)
Area of lat-long polygon.
Definition: area_poly1.c:134
int G_open_new_misc(const char *, const char *, const char *)
open a new database misc file
Definition: open_misc.c:111
char * G_convert_dirseps_from_host(char *)
Converts directory separator characters in a string from the native host character to the GRASS separ...
Definition: paths.c:105
FILE * G_popen_write(struct Popen *, const char *, const char **)
Definition: popen.c:62
char * G_join_basename_strings(const char **, size_t)
join an array of strings using the basename separator
Definition: basename.c:126
int G_limit_west(double *, int)
int G_read_vector_timestamp(const char *, const char *, const char *, struct TimeStamp *)
Read timestamp from vector map.
Definition: timestamp.c:458
void G_lat_parts(double, int *, int *, double *, char *)
Definition: ll_format.c:116
int G_set_verbose(int)
Set verbosity level.
Definition: verbose.c:125
int G_zstd_expand(unsigned char *src, int src_sz, unsigned char *dst, int dst_sz)
Definition: cmprzstd.c:162
void G_usage(void)
Command line help/usage message.
Definition: parser_help.c:48
int G_database_unit(void)
Get units id for the current location.
Definition: proj3.c:66
int G_is_units_type_temporal(int)
Check if the unit is of temporal type.
Definition: units.c:166
int G_info_format(void)
Get current message format.
Definition: gis/error.c:537
FILE * G_fopen_append(const char *, const char *)
Open a database file for update (append mode)
Definition: gis/open.c:278
const char * G_database_ellipse_name(void)
Get ellipsoid name for the current location.
Definition: proj3.c:212
int G_llres_scan(const char *, double *)
Definition: ll_scan.c:55
const char * G_location(void)
Get current location name.
Definition: location.c:32
struct Key_Value * G_get_projepsg(void)
Gets EPSG information for the current location.
Definition: get_projinfo.c:102
int G_adjust_window_ll(struct Cell_head *cellhd)
Adjust window for lat/lon.
Definition: adj_cellhd.c:552
void G_begin_execute(void(*func)(void *), void *, void **, int)
int G_check_overwrite(int argc, char **argv)
Check for overwrite mode.
Definition: overwrite.c:34
int G_write_unompressed(int, unsigned char *, int)
const char * G_lat_format_string(void)
Definition: ll_format.c:50
void * G__calloc(const char *, int, size_t, size_t)
Memory allocation.
Definition: gis/alloc.c:73
void G_message(const char *,...) __attribute__((format(printf
void G_set_geodesic_distance_lat2(double)
Sets geodesic distance lat2.
Definition: geodist.c:83
int G_check_input_output_name(const char *, const char *, int)
Check input and output file names.
Definition: legal_name.c:71
void void void void __attribute__((noreturn))
int G_getl(char *, int, FILE *)
Gets a line of text from a file.
Definition: getl.c:33
void * G__malloc(const char *, int, size_t)
Memory allocation.
Definition: gis/alloc.c:32
void G_adjust_Cell_head(struct Cell_head *, int, int)
Adjust cell header.
Definition: adj_cellhd.c:51
const char * G_gisbase(void)
Get full path name of the top level module directory.
Definition: gisbase.c:39
const char * G_database_datum_name(void)
Get datum name for the current location.
Definition: proj3.c:186
void G_write_zeros(int, size_t)
Writes n bytes of zero to file descriptor fd
Definition: writ_zeros.c:30
int G_compress_bound(int, int)
Definition: compress.c:202
int G_no_expand(unsigned char *src, int src_sz, unsigned char *dst, int dst_sz)
Definition: compress.c:176
int G_put_element_window(const struct Cell_head *, const char *, const char *)
Write the region.
Definition: put_window.c:74
const char * G_program_name(void)
Return module name.
Definition: progrm_nme.c:28
void G_plot_where_xy(double, double, int *, int *)
Converts east,north to x,y.
Definition: plot.c:160
struct Key_Value * G_create_key_value(void)
Allocate and initialize Key_Value structure.
Definition: key_value1.c:23
int G_is_mapset_in_search_path(const char *)
Check if given mapset is in search path.
Definition: mapset_nme.c:217
char * G_rc_path(const char *, const char *)
Returns path to element and item.
Definition: user_config.c:288
void G_init_counter(struct Counter *, int)
Definition: counter.c:38
void G_list_color_rules(FILE *)
Print color rules.
int G_mkdir(const char *)
Creates a new directory.
Definition: paths.c:27
void G_list_color_rules_description_type(FILE *, char *)
Print color rules with description and type.
void G_init_env(void)
Initialize variables.
Definition: env.c:83
char * G_chop(char *)
Chop leading and trailing white spaces.
Definition: strings.c:332
int G_debug(int, const char *,...) __attribute__((format(printf
const char * G_getenv_nofatal(const char *)
Get environment variable.
Definition: env.c:405
int G_scan_northing(const char *, double *, int)
ASCII northing to double.
Definition: wind_scan.c:38
int G_write_projwkt(const char *, const char *)
Write WKT definition to file.
Definition: make_loc.c:511
void G_setenv_nogisrc(const char *, const char *)
Set environment name to value (doesn't update .gisrc)
Definition: env.c:472
char * G_convert_dirseps_to_host(char *)
Converts directory separator characters in a string to the native host separator character (/ on Unix...
Definition: paths.c:83
int G_has_raster3d_timestamp(const char *, const char *)
Check if timestamp for 3D raster map exists.
Definition: timestamp.c:576
int G_begin_polygon_area_calculations(void)
Begin polygon area calculations.
Definition: gis/area.c:120
int G_make_location(const char *, struct Cell_head *, const struct Key_Value *, const struct Key_Value *)
Create a new location.
Definition: make_loc.c:53
int G_insert_commas(char *)
Inserts commas into a number string.
Definition: commas.c:36
double G_meridional_radius_of_curvature(double, double, double)
Meridional radius of curvature.
Definition: radii.c:80
int G_verbose_std(void)
Get standard verbosity level.
Definition: verbose.c:91
void G_lon_parts(double, int *, int *, double *, char *)
Definition: ll_format.c:132
void G_format_easting(double, char *, int)
Easting to ASCII.
Definition: wind_format.c:49
void G_init_tempfile(void)
Initialize environment for creating tempfiles.
Definition: tempfile.c:29
int G_vasprintf(char **, const char *, va_list)
Safe replacement for asprintf().
Definition: asprintf.c:41
char * G_store(const char *)
Copy string to allocated memory.
Definition: strings.c:87
void G_init_logging(void)
Definition: gis/error.c:355
void G_get_window(struct Cell_head *)
Get the current region.
Definition: get_window.c:47
FILE * G_fopen_new(const char *, const char *)
Open a new database file.
Definition: gis/open.c:219
void G_plot_line(double, double, double, double)
Plot line between latlon coordinates (fastline)
Definition: plot.c:209
const char * G_datum_name(int)
Definition: gis/datum.c:56
int G_write_projsrid(const char *, const char *)
Write srid (spatial reference id) to file.
Definition: make_loc.c:563
void G_init_debug(void)
Initiate debugging.
Definition: debug.c:27
int G_vaprintf(const char *, va_list)
vprintf() version of G_aprintf(). See G_aprintf() for more details.
Definition: aprintf.c:379
double G_radius_of_conformal_tangent_sphere(double, double, double)
Radius of conformal tangent sphere.
Definition: radii.c:133
char ** G_tokenize(const char *, const char *)
Tokenize string.
Definition: gis/token.c:47
void G_srand48(long)
Seed the pseudo-random number generator.
Definition: lrand48.c:53
double G_area_for_zone_on_ellipsoid(double, double)
Calculates area between latitudes.
Definition: area_ellipse.c:89
void G_remove_commas(char *)
Removes commas from number string.
Definition: commas.c:85
void G_option_requires_all(void *,...)
Define additionally required options for an option.
int G_make_mapset(const char *, const char *, const char *)
Create a new mapset.
Definition: make_mapset.c:43
void int G_suppress_warnings(int)
Suppress printing a warning message to stderr.
Definition: gis/error.c:222
int G_projection(void)
Query cartographic projection.
Definition: proj1.c:32
int G_get_3dview_defaults(struct G_3dview *, struct Cell_head *)
Sets default for v based on w.
Definition: view.c:58
void G_format_northing(double, char *, int)
Northing to ASCII.
Definition: wind_format.c:29
char ** G_list(int, const char *, const char *, const char *)
List specified type of elements. Application must release the allocated memory.
Definition: gis/list.c:173
void G_adjust_Cell_head3(struct Cell_head *, int, int, int)
Adjust cell header for 3D values.
Definition: adj_cellhd.c:163
char * G_color_rules_descriptions(void)
Get color rules description for Option->descriptions.
const char * G_find_file(const char *, char *, const char *)
Searches for a file from the mapset search list or in a specified mapset.
Definition: find_file.c:186
int int G_begin_distance_calculations(void)
Begin distance calculations.
Definition: gis/distance.c:42
size_t G_strlcpy(char *, const char *, size_t)
Safe string copy function.
Definition: strlcpy.c:52
int G_rename(const char *, const char *, const char *)
Rename a database file.
Definition: rename.c:69
int G_saprintf(char *, const char *,...)
sprintf() version of G_aprintf(). See G_aprintf() for more details.
Definition: aprintf.c:505
char * dst
Definition: lz4.h:981
const char * src
Definition: lz4.h:989
2D/3D raster map header (used also for region)
Definition: gis.h:440
Definition: gis.h:619
Structure that stores flag info.
Definition: gis.h:588
Structure that stores module info.
Definition: gis.h:605
Definition: gis.h:502
Definition: gis.h:528
Structure that stores option information.
Definition: gis.h:557
Definition: gis.h:623
Definition: gis.h:614
List of integers.
Definition: gis.h:709