-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcommands.h
More file actions
43 lines (29 loc) · 1.26 KB
/
commands.h
File metadata and controls
43 lines (29 loc) · 1.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/* Sergeev Artemiy, 33601/2 (3057/2), 07.10.2013 */
#ifndef _COMMANDS_H_
#define _COMMANDS_H_
#include "fano.h"
#include "errors.h"
#define DEFAULT_CODES_FILE "defcodes.txt"
/* Command representation type */
typedef struct tag_command
{
char *name; // Command name
// Pointer to command's execution function
error_code_t (*commandFunc)( alg_parameters_t parameters );
char *help; // Comment to command
} command_t;
/* Option representation type */
typedef struct tag_option
{
char *name; // Command name
// Pointer to command's execution function
int (*optionFunc)( int argc, char *argv[], alg_parameters_t *parameters );
char *help; // Comment to command
} option_t;
error_code_t commandHelp( alg_parameters_t parameters );
error_code_t commandExit( alg_parameters_t parameters );
error_code_t commandEncode( alg_parameters_t parameters );
error_code_t commandDecode( alg_parameters_t parameters );
int optionT( int argc, char *argv[], alg_parameters_t *parameters );
error_code_t parseArguments( int argc, char *argv[] );
#endif /* _COMMANDS_H_ */