1 | |
---|
2 | /* file UIUSRDEF.H |
---|
3 | * ========== |
---|
4 | * |
---|
5 | * version 5, 4-Jul-2006 |
---|
6 | * |
---|
7 | * constants and prototypes of module USRINPW.C |
---|
8 | * K. Stammler, 22-MAY-91 |
---|
9 | */ |
---|
10 | |
---|
11 | |
---|
12 | /* |
---|
13 | * |
---|
14 | * SeismicHandler, seismic analysis software |
---|
15 | * Copyright (C) 1996, Klaus Stammler, Federal Institute for Geosciences |
---|
16 | * and Natural Resources (BGR), Germany |
---|
17 | * |
---|
18 | * This program is free software; you can redistribute it and/or modify |
---|
19 | * it under the terms of the GNU General Public License as published by |
---|
20 | * the Free Software Foundation; either version 2 of the License, or |
---|
21 | * (at your option) any later version. |
---|
22 | * |
---|
23 | * This program is distributed in the hope that it will be useful, |
---|
24 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
25 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
26 | * GNU General Public License for more details. |
---|
27 | * |
---|
28 | * You should have received a copy of the GNU General Public License |
---|
29 | * along with this program; if not, write to the Free Software |
---|
30 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
---|
31 | * |
---|
32 | */ |
---|
33 | |
---|
34 | |
---|
35 | #ifndef __UIUSRDEF |
---|
36 | #define __UIUSRDEF |
---|
37 | |
---|
38 | #include BC_GCUSRDEF |
---|
39 | |
---|
40 | #define UIF_DOPROT 0x1 |
---|
41 | #define UIF_ECHO 0x2 |
---|
42 | #define UIF_CAPCNV 0x4 |
---|
43 | #define UIF_STEP 0x8 |
---|
44 | |
---|
45 | |
---|
46 | /*------------------------------------------------------------------------*/ |
---|
47 | |
---|
48 | |
---|
49 | void ui_initialize( char prot_file[], STATUS *status ); |
---|
50 | |
---|
51 | /* initializes ui-routines. Call once at the beginning of your program |
---|
52 | * |
---|
53 | * parameters of routine |
---|
54 | * char prot_file[]; input; name of protocol file without extension |
---|
55 | * STATUS *status; output; return status |
---|
56 | */ |
---|
57 | |
---|
58 | |
---|
59 | /*------------------------------------------------------------------------*/ |
---|
60 | |
---|
61 | |
---|
62 | void ui_exit( char cmdfile[] ); |
---|
63 | |
---|
64 | /* exits from UI routines. Call once before program exit |
---|
65 | * |
---|
66 | * parameter of routine |
---|
67 | * char cmdfile[]; input; name of command file to create |
---|
68 | */ |
---|
69 | |
---|
70 | |
---|
71 | /*------------------------------------------------------------------------*/ |
---|
72 | |
---|
73 | |
---|
74 | void ui_switch( char cmdfile[], STATUS *status ); |
---|
75 | |
---|
76 | /* switches input to file "cmdfile" |
---|
77 | * |
---|
78 | * parameters of routine |
---|
79 | * char cmdfile[]; input; name of command file to process |
---|
80 | * STATUS *status; output; return status |
---|
81 | */ |
---|
82 | |
---|
83 | |
---|
84 | /*------------------------------------------------------------------------*/ |
---|
85 | |
---|
86 | |
---|
87 | int ui_level( void ); |
---|
88 | |
---|
89 | /* returns current command level */ |
---|
90 | |
---|
91 | |
---|
92 | /*------------------------------------------------------------------------*/ |
---|
93 | |
---|
94 | |
---|
95 | void ui_setflag( int flag, BOOLEAN val ); |
---|
96 | |
---|
97 | /* sets or clears bits set in flag in flags_uiv |
---|
98 | * |
---|
99 | * parameters of routine |
---|
100 | * int flag; flags to be set or cleared |
---|
101 | * BOOLEAN val; TRUE=set flag FALSE=clear flag |
---|
102 | */ |
---|
103 | |
---|
104 | |
---|
105 | /*------------------------------------------------------------------------*/ |
---|
106 | |
---|
107 | |
---|
108 | void ui_absflag( int flags ); |
---|
109 | |
---|
110 | /* sets flags directly |
---|
111 | * |
---|
112 | * parameter of routine |
---|
113 | * int flags; input; new flag values |
---|
114 | */ |
---|
115 | |
---|
116 | |
---|
117 | /*------------------------------------------------------------------------*/ |
---|
118 | |
---|
119 | |
---|
120 | void ui_setconsole( CHMAP con ); |
---|
121 | |
---|
122 | /* sets console channel. Needed at step prompts |
---|
123 | * |
---|
124 | * parameters of routine |
---|
125 | * CHMAP con; input; console channel |
---|
126 | */ |
---|
127 | |
---|
128 | |
---|
129 | /*------------------------------------------------------------------------*/ |
---|
130 | |
---|
131 | |
---|
132 | void ui_read( int wdw, char str[], int maxlth, STATUS *status ); |
---|
133 | |
---|
134 | /* reads "str" from current input stream |
---|
135 | * |
---|
136 | * parameter of routine |
---|
137 | * int wdw; input; window number |
---|
138 | * char str[]; output; string read from input stream |
---|
139 | * int maxlth; input; maximum length of input string |
---|
140 | * STATUS *status; output; return status |
---|
141 | */ |
---|
142 | |
---|
143 | |
---|
144 | /*------------------------------------------------------------------------*/ |
---|
145 | |
---|
146 | |
---|
147 | char ui_readchar( int wdw, STATUS *status ); |
---|
148 | |
---|
149 | /* reads "str" from current input stream |
---|
150 | * |
---|
151 | * parameter of routine |
---|
152 | * int wdw; input; window number |
---|
153 | * STATUS *status; output; return status |
---|
154 | */ |
---|
155 | |
---|
156 | |
---|
157 | /*------------------------------------------------------------------------*/ |
---|
158 | |
---|
159 | |
---|
160 | void ui_getloc( int wdw, float *x, float *y, char *key, STATUS *status ); |
---|
161 | |
---|
162 | /* gets location from current input stream |
---|
163 | * |
---|
164 | * parameters of routine |
---|
165 | * int wdw; input; window number (if interactive) |
---|
166 | * float *x, *y; output; location returned |
---|
167 | * char *key; output; ASCII code of key pressed |
---|
168 | * STATUS *status; output; return status |
---|
169 | */ |
---|
170 | |
---|
171 | /*------------------------------------------------------------------------*/ |
---|
172 | |
---|
173 | |
---|
174 | void ui_goto( char label[], BOOLEAN dorewind, STATUS *status ); |
---|
175 | |
---|
176 | /* jumps to a label in a command file |
---|
177 | * |
---|
178 | * parameters of routine |
---|
179 | * char label[]; input; label name |
---|
180 | * BOOLEAN dorewind; input; rewind file before searching |
---|
181 | * STATUS *status; output; return status |
---|
182 | */ |
---|
183 | |
---|
184 | |
---|
185 | /*------------------------------------------------------------------------*/ |
---|
186 | |
---|
187 | |
---|
188 | int *ui_lines( void ); |
---|
189 | |
---|
190 | /* returns array of line counters (only for reading) */ |
---|
191 | |
---|
192 | |
---|
193 | /*------------------------------------------------------------------------*/ |
---|
194 | |
---|
195 | |
---|
196 | char *ui_levelname( int level ); |
---|
197 | |
---|
198 | /* returns name of level "level" (only for reading) |
---|
199 | * |
---|
200 | * parameters of routine |
---|
201 | * int level; input; level |
---|
202 | * returns pointer to level name |
---|
203 | */ |
---|
204 | |
---|
205 | |
---|
206 | /*------------------------------------------------------------------------*/ |
---|
207 | |
---|
208 | |
---|
209 | |
---|
210 | void ui_shift( int level ); |
---|
211 | |
---|
212 | /* decreases input level to "level" or if negative by "level" |
---|
213 | * |
---|
214 | * parameters of routine |
---|
215 | * int level; input; input level for following input |
---|
216 | */ |
---|
217 | |
---|
218 | |
---|
219 | /*------------------------------------------------------------------------*/ |
---|
220 | |
---|
221 | |
---|
222 | void ui_unshift( void ); |
---|
223 | |
---|
224 | /* resets ui_shift call */ |
---|
225 | |
---|
226 | |
---|
227 | /*------------------------------------------------------------------------*/ |
---|
228 | |
---|
229 | |
---|
230 | char ui_stepflag( void ); |
---|
231 | |
---|
232 | /* returns character entered at STEP |
---|
233 | * |
---|
234 | * no input parameters |
---|
235 | */ |
---|
236 | |
---|
237 | |
---|
238 | /*------------------------------------------------------------------------*/ |
---|
239 | |
---|
240 | |
---|
241 | int ui_lastsocket( void ); |
---|
242 | |
---|
243 | /* returns socket ID of last connection |
---|
244 | * |
---|
245 | * no input parameters |
---|
246 | */ |
---|
247 | |
---|
248 | /*------------------------------------------------------------------------*/ |
---|
249 | |
---|
250 | #endif /* __UIUSRDEF */ |
---|