-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathparser.h
More file actions
36 lines (28 loc) · 696 Bytes
/
parser.h
File metadata and controls
36 lines (28 loc) · 696 Bytes
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
#ifndef PARSER_H_
#define PARSER_H_
enum command_id {
INVALID_COMMAND, SET, HINT, VALIDATE, RESTART, EXIT
};
/*
* Struct: Command
* Used to represent a given user command.
*
* id: the identification of which command this is.
* params: the paramaters that were given by the user for this command.
*/
typedef struct command_t{
int id;
int params[3];
int param_counter;
} Command;
/*
* Scans input from user for number of wanted fixed cells in the board.
* returns it when the input is legal.
*/
int get_fixed_cells();
/*
* Gets given input from the user.
* Parses it to a specific command, including the paramaters.
*/
Command* parse_command(char userInput[]);
#endif