… | |
… | |
19 | */ |
19 | */ |
20 | |
20 | |
21 | /* D o n o t c h a n g e b e l o w |
21 | /* D o n o t c h a n g e b e l o w |
22 | */ |
22 | */ |
23 | |
23 | |
24 | #ifdef uchar |
|
|
25 | # undef uchar |
|
|
26 | #endif |
|
|
27 | #ifdef Boolean |
|
|
28 | # undef Boolean |
|
|
29 | #endif |
|
|
30 | #ifdef True |
|
|
31 | # undef True |
|
|
32 | #endif |
|
|
33 | #ifdef False |
|
|
34 | # undef False |
|
|
35 | #endif |
|
|
36 | |
|
|
37 | #define uchar unsigned char |
|
|
38 | #define Boolean uchar |
|
|
39 | #define True 1 /* Changing this value will break the code */ |
|
|
40 | #define False 0 |
|
|
41 | |
|
|
42 | typedef enum { |
24 | typedef enum { |
43 | sel_any, /* corresponds to e.g. . */ |
25 | sel_any, /* corresponds to e.g. . */ |
44 | sel_end, /* " $ */ |
26 | sel_end, /* " $ */ |
45 | sel_single, /* " q */ |
27 | sel_single, /* " q */ |
46 | sel_range, /* " [A-F] */ |
28 | sel_range, /* " [A-F] */ |
… | |
… | |
57 | } repetetion_type; |
39 | } repetetion_type; |
58 | |
40 | |
59 | typedef struct { |
41 | typedef struct { |
60 | selection_type type; |
42 | selection_type type; |
61 | union { |
43 | union { |
62 | uchar single; |
44 | unsigned char single; |
63 | struct { |
45 | struct { |
64 | uchar low, high; |
46 | unsigned char low, high; |
65 | } range; |
47 | } range; |
66 | Boolean array[UCHAR_MAX]; |
48 | bool array[UCHAR_MAX]; |
67 | } u; |
49 | } u; |
68 | repetetion_type repeat; |
50 | repetetion_type repeat; |
69 | } selection; |
51 | } selection; |