1 | /* commands.h |
---|
2 | * Header file for code for directives |
---|
3 | * Copyright (C) 1994-2024 Olly Betts |
---|
4 | * |
---|
5 | * This program is free software; you can redistribute it and/or modify |
---|
6 | * it under the terms of the GNU General Public License as published by |
---|
7 | * the Free Software Foundation; either version 2 of the License, or |
---|
8 | * (at your option) any later version. |
---|
9 | * |
---|
10 | * This program is distributed in the hope that it will be useful, |
---|
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
13 | * GNU General Public License for more details. |
---|
14 | * |
---|
15 | * You should have received a copy of the GNU General Public License |
---|
16 | * along with this program; if not, write to the Free Software |
---|
17 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
---|
18 | */ |
---|
19 | |
---|
20 | #include "str.h" |
---|
21 | |
---|
22 | /* Fix station if not already fixed. |
---|
23 | * |
---|
24 | * Returns: |
---|
25 | * 0 if not already fixed |
---|
26 | * 1 if already fixed at the same coordinates |
---|
27 | * -1 if already fixed but at different coordinates |
---|
28 | */ |
---|
29 | int fix_station(prefix *fix_name, double* coords); |
---|
30 | |
---|
31 | /* Fix station with variance. |
---|
32 | * |
---|
33 | * Multiple fixes for the same station are OK. |
---|
34 | */ |
---|
35 | void fix_station_with_variance(prefix *fix_name, double* coords, |
---|
36 | real var_x, real var_y, real var_z, |
---|
37 | #ifndef NO_COVARIANCES |
---|
38 | real cxy, real cyz, real cza |
---|
39 | #endif |
---|
40 | ); |
---|
41 | |
---|
42 | int get_length_units(int quantity); |
---|
43 | int get_angle_units(int quantity); |
---|
44 | |
---|
45 | extern const real factor_tab[]; |
---|
46 | extern const int units_to_msgno[]; |
---|
47 | |
---|
48 | #define get_units_factor(U) (factor_tab[(U)]) |
---|
49 | #define get_units_string(U) (msg(units_to_msgno[(U)])) |
---|
50 | |
---|
51 | void handle_command(void); |
---|
52 | void default_all(settings *s); |
---|
53 | |
---|
54 | void default_units(settings *s); |
---|
55 | void default_calib(settings *s); |
---|
56 | |
---|
57 | void pop_settings(void); |
---|
58 | void invalidate_pj_cached(void); |
---|
59 | void report_declination(settings *p); |
---|
60 | void set_declination_location(real x, real y, real z, const char *proj_str); |
---|
61 | |
---|
62 | void copy_on_write_meta(settings *s); |
---|
63 | |
---|
64 | extern string token; |
---|
65 | extern string uctoken; |
---|
66 | |
---|
67 | /* Read legacy token (letters only). This only exists so we can keep reading |
---|
68 | * old data files which (presumably accidentally) are missing blanks between |
---|
69 | * a token and a number which follows. Use get_token() in new code. |
---|
70 | */ |
---|
71 | void get_token_legacy(void); |
---|
72 | void get_token_legacy_no_blanks(void); |
---|
73 | |
---|
74 | /* Issue warning if isdigit(ch). */ |
---|
75 | void do_legacy_token_warning(void); |
---|
76 | |
---|
77 | // Read a token, comprised of a letter followed by contiguous alphanumerics. |
---|
78 | void get_token(void); |
---|
79 | void get_token_no_blanks(void); |
---|
80 | |
---|
81 | // Read up to the next BLANK, COMM or end of line. |
---|
82 | void get_word(void); |
---|
83 | |
---|
84 | typedef struct { const char *sz; int tok; } sztok; |
---|
85 | int match_tok(const sztok *tab, int tab_size); |
---|
86 | |
---|
87 | #define TABSIZE(T) ((sizeof(T) / sizeof(sztok)) - 1) |
---|
88 | |
---|
89 | void scan_compass_station_name(prefix *stn); |
---|
90 | void update_output_separator(void); |
---|