-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstatem.h
More file actions
51 lines (43 loc) · 1.04 KB
/
statem.h
File metadata and controls
51 lines (43 loc) · 1.04 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
49
50
51
#include <stddef.h>
#include <string.h>
typedef enum answer{
STRANGE_QUERY,
LIST,
GET,
NO_ENTRY,
ALREADY_CREATED,
COUNT_OVERFLOV,
LONG_NAME,
NO_NAME,
WRONG_STATE,
EXIT,
OK
} answer;
typedef enum state{
INITIAL,
RUN,
PAUSE,
CLOSED,
CANARY
} state;
typedef struct machine{
char _name[16];
state _state;
} machine;
typedef struct call_stack{
char* str;
answer(*ptr)(char*,machine*);
} call_stack;
char* new_query(char* buffer, machine* stack);
answer read_query(char* query, machine* stack);
answer _Init(char* name, machine* stack);
answer _Run(char* name, machine* stack);
answer _Pause(char* name, machine* stack);
answer _Stop(char* name, machine* stack);
answer _Enough(char* name, machine* stack);
answer _Exterminantus(char* name, machine* stack);
answer _Get(char* name, machine* stack);
answer _List(char* name, machine* stack);
answer _Exit_server(char* name, machine* stack);
char* _Get_impl(char* buffer, machine* stack);
char* _List_impl(char* buffer, machine* stack);