1 //======================================================================
2 //	script_parsing.h  (FLAMP)
3 //
4 //  Author(s):
5 //
6 //	Robert Stiles, KK5VD, Copyright (C) 2014
7 //
8 // This is free software; you can redistribute it and/or modify
9 // it under the terms of the GNU General Public License as published by
10 // the Free Software Foundation; either version 3 of the License, or
11 // (at your option) any later version.
12 //
13 // This software is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 // GNU General Public License for more details.
17 //
18 // You should have received a copy of the GNU General Public License
19 // along with this program.  If not, see <http://www.gnu.org/licenses/>.
20 // =====================================================================
21 
22 #ifndef __script_parsing__
23 #define __script_parsing__
24 
25 #include <string>
26 #include <stdio.h>
27 
28 #define MAX_CMD_PARAMETERS 5
29 #define MAX_COMMAND_LENGTH 128
30 #define MAX_PARAMETER_LENGTH FILENAME_MAX
31 #define MAX_READLINE_LENGTH (FILENAME_MAX+FILENAME_MAX)
32 #define MAX_SUB_SCRIPTS 5
33 
34 #define SCRIPT_FILE_TAG ((char *)"FLAMP_CONFIG")
35 #define CALL_MEMBER_FN(object,ptrToMember)  ((object).*(ptrToMember))
36 
37 #define RESET_ALL 0x01
38 #define RESET_PARTIAL 0X02
39 
40 #define CMD_AUTO_LOAD_QUEUE "AUTO LOAD QUEUE"
41 #define CMD_BASE            "BASE"
42 #define CMD_BLOCKS          "BLOCKS"
43 #define CMD_CALLFROM        "CALLFROM"
44 #define CMD_CALLTO          "CALLTO"
45 #define CMD_CLEAR_MISSING   "CLEAR MISSING"
46 #define CMD_CLEAR_RXQ       "CLEAR RXQ"
47 #define CMD_CLEAR_TXQ       "CLEAR TXQ"
48 #define CMD_COMP            "COMP"
49 #define CMD_EVENT           "EVENT"
50 #define CMD_EVENT_FOREVER   "EVENT FOREVER"
51 #define CMD_EVENT_TIMES     "EVENT TIMES"
52 #define CMD_EVENT_TIMED     "EVENT TIMED"
53 #define CMD_EVENT_TYPE      "EVENT TYPE"
54 #define CMD_FILE            "FILE"
55 #define CMD_HAMCAST         "HAMCAST"
56 #define CMD_HAMCAST_MODEM   "HAMCAST MODEM"
57 #define CMD_HDR_REPEAT      "HDR REPEAT"
58 #define CMD_HEADER          "HEADER"
59 #define CMD_HEADER_MODEM    "HEADER MODEM"
60 #define CMD_INFO            "INFO"
61 #define CMD_INHIBIT_HEADER  "INHIBIT HEADER"
62 #define CMD_INTERVAL        "INTERVAL"
63 #define CMD_LOAD_QUEUE      "LOAD QUEUE"
64 #define CMD_LOAD_TXDIR      "LOAD TXDIR"
65 #define CMD_MODEM           "MODEM"
66 #define CMD_PATH            "PATH"
67 #define CMD_PROTO           "PROTO"
68 #define CMD_QUEUE_FILEPATH  "QUEUE FILEPATH"
69 #define CMD_RESET           "RESET"
70 #define CMD_RX_INTERVAL     "RX INTERVAL"
71 #define CMD_SYNC_WITH       "SYNC WITH"
72 #define CMD_TX_INTERVAL     "TX INTERVAL"
73 #define CMD_TX_REPORT       "TX REPORT"
74 #define CMD_UNPROTO_MARKERS "UNPROTO MARKERS"
75 #define CMD_WARN_USER       "WARN USER"
76 #define CMD_XMIT_REPEAT     "XMIT REPEAT"
77 
78 //! @enum _event_types
79 //! Event types.
80 
81 //! @typedef EVENT_TYPES
82 //! @see _event_types
83 
84 typedef enum _event_types {
85 	et_5_min = 0,
86 	et_15_min,
87 	et_30_min,
88 	et_hourly,
89 	et_even_hours,
90 	et_odd_hours,
91 	et_repeat_at,
92 	et_one_time_at,
93 	et_continious_at,
94 } EVENT_TYPES;
95 
96 //! @enum script_codes
97 //! Error codes.
98 
99 //! @typedef SCRIPT_CODES
100 //! @see script_codes
101 
102 typedef enum script_codes {
103 	script_command_not_found = -100,     //!< Script command not found.
104 	script_file_not_found,               //!< Script file not found.
105 	script_path_not_found,               //!< Script directory path not found.
106 	script_non_script_file,              //!< Opened file not a Script file.
107 	script_max_sub_script_reached,       //!< Maximum open subscripts reached.
108 	script_subscript_exec_fail,          //!< Subscript execution fail (internal).
109 	script_incorrectly_assigned_value,   //!< Incorrect parameter type.
110 	script_invalid_parameter,            //!< Parameter is not valid.
111 	script_parameter_error,              //!< Script parameter invalid.
112 	script_function_parameter_error,     //!< Function parameter error (internal, non script error).
113 	script_mismatched_quotes,            //!< Opening or closing quotes missing prior to reaching end if line.
114 	script_command_seperator_missing,    //!< Command missing ':'
115 	script_args_eol,                     //!< Reached end of args list sooner then expected
116 	script_param_check_eol,              //!< Reached end of parameter check list sooner then expected
117 	script_paramter_exceeds_length,      //!< Data length exceeds expectations
118 	script_memory_allocation_error,      //!< Memory Allocation Error (Non-Script internal Error).
119 	script_general_error = -1,           //!< General purpose error (undefined erros).
120 	script_no_errors,                    //!< No Errors
121 	script_char_match_not_found,         //!< Search char not found (Warning)
122 	script_end_of_line_reached           //!< End of line reached (Warning)
123 } SCRIPT_CODES;
124 
125 class ScriptParsing;
126 typedef  SCRIPT_CODES (ScriptParsing::*calling_func)(struct script_cmds *);
127 
128 //! @enum paramter_types
129 //! Parameter type flags. Used to validate the informarion.
130 
131 //! @typedef PARAM_TYPES
132 //! @see paramter_types
133 
134 typedef enum paramter_types {
135 	p_null = 0,
136 	p_char,
137 	p_int,
138 	p_unsigned_int,
139 	p_long,
140 	p_unsigned_long,
141 	p_float,
142 	p_double,
143 	p_string,
144 	p_path,
145 	p_filename,
146 } PARAM_TYPES;
147 
148 #define QUEUE_COMMAND  0x0001
149 #define SCRIPT_COMMAND 0x0002
150 
151 //! @struct script_cmds
152 //! Vector table of script command string and executing function member.
153 
154 //! @typedef SCRIPT_COMMANDS
155 //! @see script_cmds
156 typedef struct script_cmds {
157 	char command[MAX_COMMAND_LENGTH];                      //!< Command matching string.
158 	int  flags;                                            //!< General purpose flags
159 	size_t command_length;                                 //!< Number of chacters in the command string.
160 	int  argc;                                             //!< Number of required prarmeters for the command
161 	char *args[MAX_CMD_PARAMETERS+1];                      //!< String vector table of parameters
162 	enum paramter_types param_check[MAX_CMD_PARAMETERS+1]; //!< Flags to determine type of parameter.
163 	const char **valid_values;                                   //!< A list of valid paramters.
164 	int valid_value_count;                                 //!< The number of valid paramters.
165 	calling_func func;                                     //!< The function (member) to execute on positive match.
166 	int (*cb)(ScriptParsing *sp, struct script_cmds *sd);  //!< Call back function for script command
167 
168 } SCRIPT_COMMANDS;
169 
170 //! @class script_parsing_class
171 class ScriptParsing {
172 
173 public:
174 
175 private:
176 	pthread_mutex_t ac;            //<! Thread safe data access
177 
178 	bool _auto_load_queue;          //!< Auto load the queue on event flag.
179 	bool _clear_missing;            //!< Clear missing block after transmit fills flag
180 	bool _clear_rxq;                //!< Clear receive queue flag.
181 	bool _clear_txq;                //!< Clear transmit queue flag.
182 	bool _comp;                     //!< Use compression on transmitted file flag.
183 	bool _event;                    //!< Enable/Disable event flag.
184 	bool _event_forever;            //!< Enable/Disable forever events.
185 	bool _event_timed;              //!< Enable/Event based on time.
186 	bool _hamcast;                  //!< Enable/Disable Hamcast flag.
187 	bool _hamcast_modem_1_enable;   //!< Enable/Disable flag for Hamcast modem position 1
188 	bool _hamcast_modem_2_enable;   //!< Enable/Disable flag for Hamcast modem position 2
189 	bool _hamcast_modem_3_enable;   //!< Enable/Disable flag for Hamcast modem position 3
190 	bool _hamcast_modem_4_enable;   //!< Enable/Disable flag for Hamcast modem position 4
191 	bool _header_modem_enable;      //!< Enable/Disable flag for Header Modem
192 	bool _inhibit_header;           //!< Inhibit header modem on fills.
193 	bool _interval;                 //!< Enable/Disable interval timer.
194 	bool _load_txdir;               //!< Enable/Disable loading of the queue from the tx directory.
195 	bool _proto;                    //!< Enable/Disable AMP protocol
196 	bool _sync_with_flamp;          //!< Enable/Disable Sync fldigi with flamp
197 	bool _sync_with_fldigi;         //!< Enable/Disable Sync flamp with fldigi
198 	bool _sync_with_prior;          //!< Enable/Disable Modem set prior to transmit.
199 	bool _tx_report;                //!< Enable/Disable tramsmit reports from FLAMP.
200 	bool _unproto_markers;          //!< Enable/Disable unproto makers during transmition of unproto data.
201 	bool _warn_user;                //!< Enable/Disable Warning message when removing files from the transmit queue.
202 
203 	int _base;                      //!< Storage for the base encoding type
204 	int _blocks;                    //!< Storage for the transmit block count.
205 	int _event_type;                //!< Storage for type of event
206 	int _file_type;                 //!< File type true=script false=queue
207 	int _hdr_repeat;                //!< Number of time to repeat headr transmistion.
208 	int _reset;                     //!< Reset type flag.
209 	int _rx_interval;               //!< Rx interval duration (in seconds)
210 	int _sub_script_count;          //!< Number of sub class created and called from upper level class
211 	float _tx_interval;             //!< Interval transmit time (in minutes)
212 	int _xmit_repeat;               //!< Number of times non-header data repeats.
213 
214 	std::string _call_from;         //!< Storage for the Call From (callsign)
215 	std::string _call_to;           //!< Storage for the Call To (callsign)
216 	std::string _envent_times;      //!< Storage fir the assigne vent times.
217 	std::string _desc;              //!< Storage for description of queued file.
218 	std::string _file;              //!< Secondary script file to process.
219 	std::string _header_modem;      //!< Header modem
220 	std::string _hamcast_modem_1;   //!< Hamcast modem name for position 1 in the rotation
221 	std::string _hamcast_modem_2;   //!< Hamcast modem name for position 2 in the rotation
222 	std::string _hamcast_modem_3;   //!< Hamcast modem name for position 3 in the rotation
223 	std::string _hamcast_modem_4;   //!< Hamcast modem name for position 4 in the rotation
224 	std::string _info;              //!< Information field in the config panel
225 	std::string _modem;             //!< Tramit modem.
226 	std::string _path;              //!< Storage for path when running script files.
227 	std::string _queue_filename;    //!< Storage for queue filename.
228 	std::string _queue_path;        //!< Storage for queue path.
229 	std::string _queue_filepath;    //!< Storage for queue script file name and path
230 
231 	SCRIPT_COMMANDS *_script_command_table;    //!< Table of commands and vector functions @sees cript_cmds
232 	size_t _script_command_table_count;        //!< Number of assigned positions in the table.
233 	size_t _script_command_table_total_count;  //!< Number of positions in the table
234 
235 	ScriptParsing *_parent;       //!< Calling ScriptParsing pointer. Primarly used for the reset command on the local 'this' pointer.
236 
237 	char line_buffer[MAX_READLINE_LENGTH + 1]; //!< Line buffer for script read operations.
238 	char error_cmd_buffer[MAX_COMMAND_LENGTH];
239 	char error_string[MAX_COMMAND_LENGTH];
240 	char error_buffer[MAX_COMMAND_LENGTH + MAX_COMMAND_LENGTH + 1];
241 
242 public:
243 
244 	SCRIPT_CODES parse_commands(char *file_name_path); //!< The calling function to parse a script file.
245 
auto_load_queue(void)246 	bool auto_load_queue(void) { return _auto_load_queue; }
auto_load_queue(bool value)247 	void auto_load_queue(bool value) { _auto_load_queue = value; }
248 
base(void)249 	int base(void) { return _base; }
base(int value)250 	void base(int value) { _base = value; }
251 
blocks(void)252 	int blocks(void) { return _blocks; }
blocks(int value)253 	void blocks(int value) { _blocks = value; }
254 
call_from(void)255 	std::string call_from(void) { return _call_from; }
call_from(std::string value)256 	void call_from(std::string value) { _call_from = value; }
257 
call_to(void)258 	std::string call_to(void) { return _call_to; }
call_to(std::string value)259 	void call_to(std::string value) { _call_to = value; }
260 
clear_missing(void)261 	bool clear_missing(void) { return _clear_missing; }
clear_missing(bool value)262 	void clear_missing(bool value) { _clear_missing = value; }
263 
clear_rxq(void)264 	bool clear_rxq(void) { return _clear_rxq; }
clear_rxq(bool value)265 	void clear_rxq(bool value) { _clear_rxq = value; }
266 
clear_txq(void)267 	bool clear_txq(void) { return _clear_txq; }
clear_txq(bool value)268 	void clear_txq(bool value) { _clear_txq = value; }
269 
comp(void)270 	bool comp(void) { return _comp; }
comp(bool value)271 	void comp(bool value) { _comp = value; }
272 
event_type(void)273 	int event_type(void) { return _event_type; }
event_type(int value)274 	void event_type(int value) { _event_type = value; }
275 
event_times(void)276 	std::string event_times(void) { return _envent_times; }
event_times(std::string value)277 	void event_times(std::string value) { _envent_times = value; }
278 
event_timed(void)279 	bool event_timed(void) { return _event_timed; }
event_timed(bool value)280 	void event_timed(bool value) { _event_timed = value; }
281 
event(void)282 	bool event(void) { return _event; }
event(bool value)283 	void event(bool value) { _event = value; }
284 
event_forever(void)285 	bool event_forever(void) { return _event_forever; }
event_forever(bool value)286 	void event_forever(bool value) { _event_forever = value; }
287 
desc(void)288 	std::string desc(void) { return _desc; }
desc(std::string value)289 	void desc(std::string value) { _desc = value; }
290 
file(void)291 	std::string file(void) { return _file; }
file(std::string value)292 	void file(std::string value) { _file = value; }
293 
file_type(void)294 	int file_type(void) { return _file_type; }
file_type(int value)295 	void file_type(int value) { _file_type = value; }
296 
hamcast_modem_1(void)297 	std::string hamcast_modem_1(void) { return _hamcast_modem_1; }
hamcast_modem_1(std::string value)298 	void hamcast_modem_1(std::string value) { _hamcast_modem_1 = value; }
299 
hamcast_modem_2(void)300 	std::string hamcast_modem_2(void) { return _hamcast_modem_2; }
hamcast_modem_2(std::string value)301 	void hamcast_modem_2(std::string value) { _hamcast_modem_2 = value; }
302 
hamcast_modem_3(void)303 	std::string hamcast_modem_3(void) { return _hamcast_modem_3; }
hamcast_modem_3(std::string value)304 	void hamcast_modem_3(std::string value) { _hamcast_modem_3 = value; }
305 
hamcast_modem_4(void)306 	std::string hamcast_modem_4(void) { return _hamcast_modem_4; }
hamcast_modem_4(std::string value)307 	void hamcast_modem_4(std::string value) { _hamcast_modem_4 = value; }
308 
hamcast_modem_1_enable(void)309 	bool hamcast_modem_1_enable(void) { return _hamcast_modem_1_enable; }
hamcast_modem_1_enable(bool value)310 	void hamcast_modem_1_enable(bool value) { _hamcast_modem_1_enable = value; }
311 
hamcast_modem_2_enable(void)312 	bool hamcast_modem_2_enable(void) { return _hamcast_modem_2_enable; }
hamcast_modem_2_enable(bool value)313 	void hamcast_modem_2_enable(bool value) { _hamcast_modem_2_enable = value; }
314 
hamcast_modem_3_enable(void)315 	bool hamcast_modem_3_enable(void) { return _hamcast_modem_3_enable; }
hamcast_modem_3_enable(bool value)316 	void hamcast_modem_3_enable(bool value) { _hamcast_modem_3_enable = value; }
317 
hamcast_modem_4_enable(void)318 	bool hamcast_modem_4_enable(void) { return _hamcast_modem_4_enable; }
hamcast_modem_4_enable(bool value)319 	void hamcast_modem_4_enable(bool value) { _hamcast_modem_4_enable = value; }
320 
hamcast(void)321 	bool hamcast(void) { return _event; }
hamcast(bool value)322 	void hamcast(bool value) { _event = value; }
323 
header_modem(void)324 	std::string header_modem(void) { return _header_modem; }
header_modem(std::string value)325 	void header_modem(std::string value) { _header_modem = value; }
326 
header_modem_enable(void)327 	bool header_modem_enable(void) { return _header_modem_enable; }
header_modem_enable(bool value)328 	void header_modem_enable(bool value) { _header_modem_enable = value; }
329 
hdr_repeat(void)330 	int hdr_repeat(void) { return _hdr_repeat; }
hdr_repeat(int value)331 	void hdr_repeat(int value) { _hdr_repeat = value; }
332 
info(void)333 	std::string info(void) { return _info; }
info(std::string value)334 	void info(std::string value) { _info = value; }
335 
inhibit_header(void)336 	bool inhibit_header(void) { return _inhibit_header; }
inhibit_header(bool value)337 	void inhibit_header(bool value) { _inhibit_header = value; }
338 
interval(void)339 	bool interval(void) { return _interval; }
interval(bool value)340 	void interval(bool value) { _interval = value; }
341 
load_txdir(void)342 	bool load_txdir(void) { return _load_txdir; }
load_txdir(bool value)343 	void load_txdir(bool value) { _load_txdir = value; }
344 
modem(void)345 	std::string modem(void) { return _modem; }
modem(std::string value)346 	void modem(std::string value) { _modem = value; }
347 
path(void)348 	std::string path(void) { return _path; }
path(std::string value)349 	void path(std::string value) { _path = value; }
350 
proto(void)351 	bool proto(void) { return _proto; }
proto(bool value)352 	void proto(bool value) { _proto = value; }
353 
queue_filename(void)354 	std::string queue_filename(void) { return _queue_path; }
queue_filename(std::string value)355 	void queue_filename(std::string value) { _queue_path = value; }
356 
queue_path(void)357 	std::string queue_path(void) { return _queue_filename; }
queue_path(std::string value)358 	void queue_path(std::string value) { _queue_filename = value; }
359 
queue_filepath(void)360 	std::string queue_filepath(void) { return _queue_filepath; }
queue_filepath(std::string value)361 	void queue_filepath(std::string value) { _queue_filepath = value; }
362 
reset(void)363 	int reset(void) { return _reset; }
reset(int value)364 	void reset(int value) { _reset = value; }
365 
rx_interval(void)366 	int rx_interval(void) { return _rx_interval; }
rx_interval(int value)367 	void rx_interval(int value) { _rx_interval = value; }
368 
sync_with_flamp(void)369 	bool sync_with_flamp(void) { return _sync_with_flamp; }
sync_with_flamp(bool value)370 	void sync_with_flamp(bool value) { _sync_with_flamp = value; }
371 
sync_with_fldigi(void)372 	bool sync_with_fldigi(void) { return _sync_with_fldigi; }
sync_with_fldigi(bool value)373 	void sync_with_fldigi(bool value) { _sync_with_fldigi = value; }
374 
sync_with_prior(void)375 	bool sync_with_prior(void) { return _sync_with_prior; }
sync_with_prior(bool value)376 	void sync_with_prior(bool value) { _sync_with_prior = value; }
377 
tx_interval(void)378 	float tx_interval(void) { return _tx_interval; }
tx_interval(float value)379 	void tx_interval(float value) { _tx_interval = value; }
380 
tx_report(void)381 	bool tx_report(void) { return _tx_report; }
tx_report(bool value)382 	void tx_report(bool value) { _tx_report = value; }
383 
unproto_markers(void)384 	bool unproto_markers(void) { return _unproto_markers; }
unproto_markers(bool value)385 	void unproto_markers(bool value) { _unproto_markers = value; }
386 
warn_user(void)387 	bool warn_user(void) { return _warn_user; }
warn_user(bool value)388 	void warn_user(bool value) { _warn_user = value; }
389 
xmit_repeat(void)390 	int xmit_repeat(void) { return _xmit_repeat; }
xmit_repeat(int value)391 	void xmit_repeat(int value) { _xmit_repeat = value; }
392 
parent(void)393 	ScriptParsing *parent(void) { return _parent; }
parent(ScriptParsing * value)394 	void parent(ScriptParsing *value) { _parent = value; }
395 
sub_script_count(void)396 	int sub_script_count(void) { return _sub_script_count; }
sub_script_count(int value)397 	void sub_script_count(int value) { _sub_script_count = value; }
398 
script_command_table_total_count(void)399 	size_t script_command_table_total_count(void) { return _script_command_table_total_count; }
script_command_table_total_count(size_t value)400 	void script_command_table_total_count(size_t value) { _script_command_table_total_count = value; }
401 
script_command_table_count(void)402 	size_t script_command_table_count(void) { return _script_command_table_count; }
script_command_table_count(size_t value)403 	void script_command_table_count(size_t value) { _script_command_table_count = value; }
404 
script_command_table(void)405 	SCRIPT_COMMANDS * script_command_table(void) { return _script_command_table; }
script_command_table(SCRIPT_COMMANDS * value)406 	void script_command_table(SCRIPT_COMMANDS * value) { _script_command_table = value; }
407 
408 	int assign_callback(const char *scriptCommand, int (*cb)(ScriptParsing *sp, SCRIPT_COMMANDS *sc));
409 	int assign_valid_parameters(const char *command, const char **array, const int array_count);
410 
411 	void defaults(bool all);
412 	ScriptParsing();
413 	~ScriptParsing();
414 
415 private:
416 
417 	char * script_error_string(SCRIPT_CODES error_no, int line_number, char *cmd);
418 	char * skip_alpha_numbers(char * data, char *limit, SCRIPT_CODES &error);
419 	char * skip_characters(char * data, char *limit, SCRIPT_CODES &error);
420 	char * skip_numbers(char * data, char *limit, SCRIPT_CODES &error);
421 	char * skip_spaces(char * data, char *limit, SCRIPT_CODES &error);
422 	char * skip_to_character(char c, char * data, char *limit, SCRIPT_CODES &error);
423 	char * skip_white_spaces(char * data, char *limit, SCRIPT_CODES &error);
424 
425 	inline SCRIPT_CODES test_on_off_state(bool &state, char *string, char *true_state);
426 
427 	int call_callback(SCRIPT_COMMANDS *cb_data);
428 	int check_parameters_from_list(SCRIPT_COMMANDS *sc);
429 	int CopyScriptParsingEnv(ScriptParsing *src);
430 
431 	SCRIPT_CODES copy_command(char *buffer, char *cPtr, char *ePtr, size_t limit);
432 	SCRIPT_CODES parse_parameters(char *s, char *d, SCRIPT_COMMANDS *matching_command);
433 	SCRIPT_CODES parse_single_command(char *data, size_t buffer_count);
434 	SCRIPT_CODES remove_crlf_comments(char *data, char *limit, size_t &count);
435 	SCRIPT_CODES sc_auto_load_queue(struct script_cmds *);
436 	SCRIPT_CODES sc_base_encode(struct script_cmds *);
437 	SCRIPT_CODES sc_block_count(struct script_cmds *);
438 	SCRIPT_CODES sc_call_from(struct script_cmds *);
439 	SCRIPT_CODES sc_call_to(struct script_cmds *);
440 	SCRIPT_CODES sc_clear_missing(struct script_cmds *);
441 	SCRIPT_CODES sc_clear_rxq(struct script_cmds *);
442 	SCRIPT_CODES sc_clear_txq(struct script_cmds *);
443 	SCRIPT_CODES sc_compression(struct script_cmds *);
444 	SCRIPT_CODES sc_dummy(struct script_cmds *);
445 	SCRIPT_CODES sc_event_forever(struct script_cmds *);
446 	SCRIPT_CODES sc_event_times(struct script_cmds *);
447 	SCRIPT_CODES sc_event_timed(struct script_cmds *);
448 	SCRIPT_CODES sc_event_type(struct script_cmds *);
449 	SCRIPT_CODES sc_event(struct script_cmds *);
450 	SCRIPT_CODES sc_file(struct script_cmds *);
451 	SCRIPT_CODES sc_hamcast_modem(struct script_cmds *);
452 	SCRIPT_CODES sc_hamcast(struct script_cmds *);
453 	SCRIPT_CODES sc_hdr_repeat(struct script_cmds *);
454 	SCRIPT_CODES sc_header_modem(struct script_cmds *cmd);
455 	SCRIPT_CODES sc_header(struct script_cmds *cmd);
456 	SCRIPT_CODES sc_info(struct script_cmds *);
457 	SCRIPT_CODES sc_inhibit_header(struct script_cmds *);
458 	SCRIPT_CODES sc_interval(struct script_cmds *);
459 	SCRIPT_CODES sc_load_queue(struct script_cmds *);
460 	SCRIPT_CODES sc_load_txdir(struct script_cmds *);
461 	SCRIPT_CODES sc_modem(struct script_cmds *);
462 	SCRIPT_CODES sc_path(struct script_cmds *);
463 	SCRIPT_CODES sc_proto(struct script_cmds *);
464 	SCRIPT_CODES sc_queue_filepath(struct script_cmds *);
465 	SCRIPT_CODES sc_reset(struct script_cmds *);
466 	SCRIPT_CODES sc_rx_interval(struct script_cmds *);
467 	SCRIPT_CODES sc_sync_with(struct script_cmds *);
468 	SCRIPT_CODES sc_tx_interval(struct script_cmds *);
469 	SCRIPT_CODES sc_tx_report(struct script_cmds *);
470 	SCRIPT_CODES sc_unproto_makers(struct script_cmds *);
471 	SCRIPT_CODES sc_warn_user(struct script_cmds *);
472 	SCRIPT_CODES sc_xmit_repeat(struct script_cmds *);
473 	SCRIPT_CODES sc_xmit_times(struct script_cmds *);
474 
475 	SCRIPT_CODES check_parameters(struct script_cmds *);
476 	SCRIPT_CODES check_filename(char *filename, char *full_name_path, size_t limit, int path_flag);
477 	SCRIPT_CODES check_path(const char *);
478 	SCRIPT_CODES check_numbers(char *, paramter_types p);
479 
480 	SCRIPT_COMMANDS * search_command(const char *command);
481 
482 	void assign_func(size_t pos, calling_func func, size_t limit);
483 	void to_uppercase(char *str, int limit);
484 	void to_uppercase(std::string &str);
485 	void trim(char *buffer, size_t size);
486 	void initialize_function_members(void);
487 	int str_cnt(char * str, int count_limit);
488 };
489 
490 int callback_dummy(ScriptParsing *sp, struct script_cmds *sc);
491 
492 #endif /* defined(__script_parsing__) */
493