-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcommandStruct.h
More file actions
48 lines (40 loc) · 1 KB
/
Copy pathcommandStruct.h
File metadata and controls
48 lines (40 loc) · 1 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
44
45
46
47
48
#ifndef FINAL_COMMANDSTRUCT_H
#define FINAL_COMMANDSTRUCT_H
#include <stdlib.h>
#include "errorMessages.h"
#define TRUE 1
#define FALSE 0
typedef enum commandType {
INVALID_COMMAND = 0,
SET = 1,
HINT = 2,
VALIDATE = 3,
RESET = 4,
EXIT = 5,
SOLVE = 6,
EDIT = 7,
MARK_ERRORS = 8,
PRINT_BOARD = 9,
GENERATE = 10,
UNDO = 11,
REDO = 12,
SAVE = 13,
NUM_SOLS = 14,
AUTO_FILL = 15
} commandType;
/* definition of a struct used to represent a command
* it holds type of command, arguments and indication of validity */
typedef struct commandStruct {
int isValid;
enum commandType type;
int x;
int y;
int z;
char *fileName; /* used by solve and edit commands */
int markErrors; /* used by mark_errors command */
} commandStruct;
/* allocated memory for s commandStruct and returns pointer to it
* struct fields are initialized to default values */
commandStruct *initializeCommand();
void freeCommand(commandStruct *command);
#endif