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