1 | #ifndef MAD_CMDIN_H |
---|
2 | #define MAD_CMDIN_H |
---|
3 | |
---|
4 | // types |
---|
5 | |
---|
6 | struct command; |
---|
7 | struct name_list; |
---|
8 | struct char_p_array; |
---|
9 | |
---|
10 | struct in_cmd /* contains information about classified command */ |
---|
11 | { |
---|
12 | char name[NAME_L]; |
---|
13 | char* label; /* pointer to label: if != NULL then buffer this */ |
---|
14 | int type; /* 0 command from list; |
---|
15 | 1 element definiton outside sequence; |
---|
16 | 2 variable definition; |
---|
17 | 3 start or end of sequence; |
---|
18 | 4 element definition; */ |
---|
19 | int sub_type; /* position in cmd_match_base */ |
---|
20 | int stamp; |
---|
21 | int decl_start; /* start of declarative part in tok_list */ |
---|
22 | int clone_flag; /* if zero, clone can be dropped after decoding */ |
---|
23 | struct char_p_array* tok_list; /* contains pointers to tokens */ |
---|
24 | struct command* cmd_def; /* points to command definition */ |
---|
25 | struct command* clone; /* points to clone of command definition */ |
---|
26 | }; |
---|
27 | |
---|
28 | struct in_cmd_list /* contains list of in_cmd pointers sorted by label */ |
---|
29 | { |
---|
30 | int stamp; |
---|
31 | char name[NAME_L]; |
---|
32 | int max, /* max. pointer array size */ |
---|
33 | curr; /* current occupation */ |
---|
34 | struct name_list* labels; /* index list of labels */ |
---|
35 | struct in_cmd** in_cmds; /* in_cmd pointer list */ |
---|
36 | }; |
---|
37 | |
---|
38 | // interface |
---|
39 | |
---|
40 | struct in_cmd* new_in_cmd(int length); // many uses |
---|
41 | struct in_cmd* delete_in_cmd(struct in_cmd*); // many uses |
---|
42 | struct in_cmd* buffered_cmd (struct in_cmd*); // used by mad_cmd.c |
---|
43 | |
---|
44 | struct in_cmd_list* new_in_cmd_list(int length); // used by mad_core.c |
---|
45 | void grow_in_cmd_list(struct in_cmd_list*); |
---|
46 | // missing delete? |
---|
47 | |
---|
48 | void buffer_in_cmd (struct in_cmd*); |
---|
49 | void scan_in_cmd (struct in_cmd*); |
---|
50 | void dump_in_cmd (struct in_cmd*); // for debugging |
---|
51 | |
---|
52 | #endif // MAD_CMDIN_H |
---|