diff options
Diffstat (limited to 'v4.0/src/CMD/FDISK/PARSE.H')
| -rw-r--r-- | v4.0/src/CMD/FDISK/PARSE.H | 188 |
1 files changed, 188 insertions, 0 deletions
diff --git a/v4.0/src/CMD/FDISK/PARSE.H b/v4.0/src/CMD/FDISK/PARSE.H new file mode 100644 index 0000000..8d878e6 --- /dev/null +++ b/v4.0/src/CMD/FDISK/PARSE.H | |||
| @@ -0,0 +1,188 @@ | |||
| 1 | |||
| 2 | /* */ | ||
| 3 | /*----------------------------------------------------------------------+ | ||
| 4 | | | | ||
| 5 | | This file contains the structures and defines that are needed to use | | ||
| 6 | | the parser from a C program. | | ||
| 7 | | | | ||
| 8 | | | | ||
| 9 | | Date: 6-15-87 | | ||
| 10 | | | | ||
| 11 | +----------------------------------------------------------------------*/ | ||
| 12 | |||
| 13 | |||
| 14 | #define p_len_parms 4 /* AN000 - length of p_parms */ | ||
| 15 | #define p_i_use_default 0 /* AN000 - no extra stuff specified */ | ||
| 16 | #define p_i_have_delim 1 /* AN000 - extra delimiter specified */ | ||
| 17 | #define p_i_have_eol 2 /* AN000 - extra EOL specified */ | ||
| 18 | #define PRI "/PRI" /* AN000 */ | ||
| 19 | #define EXT "/EXT" /* AN000 */ | ||
| 20 | #define LOG "/LOG" /* AN000 */ | ||
| 21 | #define QUIET "/Q" /* AN000 */ | ||
| 22 | |||
| 23 | struct p_parms /* AN000 */ | ||
| 24 | BEGIN /* AN000 */ | ||
| 25 | unsigned p_parmsx_ptr; /* AN000 - address of p_parmsx */ | ||
| 26 | unsigned char p_num_extra; /* AN000 - number of extra stuff */ | ||
| 27 | unsigned char p_len_extra_delim; /* AN000 - length of extra delimiter */ | ||
| 28 | char p_extra_delim; /* AN000 - extra delimiters */ | ||
| 29 | END; /* AN000 */ | ||
| 30 | |||
| 31 | struct p_parmsx /* AN000 */ | ||
| 32 | BEGIN /* AN000 */ | ||
| 33 | unsigned char p_minp; /* AN000 - Minimum positional number */ | ||
| 34 | unsigned char p_maxp; /* AN000 - Maximum positional number */ | ||
| 35 | unsigned p_con1_ptr; /* AN000 - Address of the 1st CONTROL block */ | ||
| 36 | unsigned char p_maxs; /* AN000 - Maximum number of switches */ | ||
| 37 | unsigned p_swi1_ptr; /* AN000 - Address of the 1st CONTROL block */ | ||
| 38 | unsigned p_swi2_ptr; /* AN000 - Address of the 2nd CONTROL block */ | ||
| 39 | unsigned char p_maxk; /* AN000 - Any keyworks?? */ | ||
| 40 | END; /* AN000 */ | ||
| 41 | |||
| 42 | |||
| 43 | struct p_control_blk /* AN000 */ | ||
| 44 | BEGIN /* AN000 */ | ||
| 45 | unsigned p_match_flag; /* AN000 - Controls type matched */ | ||
| 46 | unsigned p_function_flag; /* AN000 - Function should be taken */ | ||
| 47 | unsigned p_buff1_ptr; /* AN000 - Result buffer address */ | ||
| 48 | unsigned p_val1_ptr; /* AN000 - Value list address */ | ||
| 49 | unsigned char p_nid; /* AN000 - # of keyword/SW synonyms */ | ||
| 50 | END; /* AN000 */ | ||
| 51 | |||
| 52 | struct p_switch_blk /* AN000 */ | ||
| 53 | BEGIN /* AN000 */ | ||
| 54 | unsigned sp_match_flag; /* AN000 - Controls type matched */ | ||
| 55 | unsigned sp_function_flag; /* AN000 - Function should be taken */ | ||
| 56 | unsigned sp_buff1_ptr; /* AN000 - Result buffer address */ | ||
| 57 | unsigned sp_val1_ptr; /* AN000 - Value list address */ | ||
| 58 | unsigned char sp_nid; /* AN000 - # of keyword/SW synonyms */ | ||
| 59 | unsigned char sp_switch1[5]; /* AN000 - keyword or sw */ | ||
| 60 | unsigned char sp_switch2[5]; /* AN000 - keyword or sw */ | ||
| 61 | unsigned char sp_switch3[5]; /* AN000 - keyword or sw */ | ||
| 62 | END; /* AN000 */ | ||
| 63 | |||
| 64 | struct p_switch1_blk /* AN000 */ | ||
| 65 | BEGIN /* AN000 */ | ||
| 66 | unsigned sp_match_flag; /* AN000 - Controls type matched */ | ||
| 67 | unsigned sp_function_flag; /* AN000 - Function should be taken */ | ||
| 68 | unsigned sp_buff1_ptr; /* AN000 - Result buffer address */ | ||
| 69 | unsigned sp_val1_ptr; /* AN000 - Value list address */ | ||
| 70 | unsigned char sp_nid; /* AN000 - # of keyword/SW synonyms */ | ||
| 71 | unsigned char sp_switch4[3]; /* AN000 - keyword or sw */ | ||
| 72 | END; /* AN000 */ | ||
| 73 | |||
| 74 | struct p_result_buff /* AN000 */ | ||
| 75 | BEGIN /* AN000 */ | ||
| 76 | unsigned char p_type; /* AN000 - type returned */ | ||
| 77 | unsigned char p_item_tag; /* AN000 - Matched item tag */ | ||
| 78 | unsigned p_synonym; /* AN000 - Synonym list */ | ||
| 79 | unsigned long p_value; /* AN000 - result value */ | ||
| 80 | END; /* AN000 */ | ||
| 81 | |||
| 82 | struct p_value_list /* AN000 */ | ||
| 83 | BEGIN /* AN000 */ | ||
| 84 | unsigned char p_values; /* AN000 - number of values */ | ||
| 85 | unsigned char p_range; /* AN000 - number of ranges */ | ||
| 86 | unsigned char p_range_one; /* AN000 - range one */ | ||
| 87 | unsigned long p_low_range; /* AN000 - low value of range */ | ||
| 88 | unsigned long p_high_range; /* AN000 - high value of range */ | ||
| 89 | END; /* AN000 */ | ||
| 90 | |||
| 91 | /* Match_Flags */ | ||
| 92 | |||
| 93 | #define p_num_val 0x8000 /* AN000 - Numeric Value */ | ||
| 94 | #define p_snum_val 0x4000 /* AN000 - Signed numeric value */ | ||
| 95 | #define p_simple_s 0x2000 /* AN000 - Simple string */ | ||
| 96 | #define p_date_s 0x1000 /* AN000 - Date string */ | ||
| 97 | #define p_time_s 0x0800 /* AN000 - Time string */ | ||
| 98 | #define p_cmpx_s 0x0400 /* AN000 - Complex string */ | ||
| 99 | #define p_file_spc 0x0200 /* AN000 - File Spec */ | ||
| 100 | #define p_drv_only 0x0100 /* AN000 - Drive Only */ | ||
| 101 | #define p_qu_string 0x0080 /* AN000 - Quoted string */ | ||
| 102 | #define p_ig_colon 0x0010 /* AN000 - Ignore colon at end in match */ | ||
| 103 | #define p_repeat 0x0002 /* AN000 - Repeat allowed */ | ||
| 104 | #define p_optional 0x0001 /* AN000 - Optional */ | ||
| 105 | |||
| 106 | /*----------------------------------------------------------------------+ | ||
| 107 | | | | ||
| 108 | | Function flags | | ||
| 109 | | | | ||
| 110 | +----------------------------------------------------------------------*/ | ||
| 111 | |||
| 112 | #define p_cap_file 0x0001 /* AN000 - CAP result by file table */ | ||
| 113 | #define p_cap_char 0x0002 /* AN000 - CAP result by character table */ | ||
| 114 | #define p_rm_colon 0x0010 /* AN000 - Remove ":" at the end */ | ||
| 115 | #define STDERR 0x0002 /* AN010 */ | ||
| 116 | #define Parse_err_class 0x0002 /* AN010 */ | ||
| 117 | #define Sublist_Length 0x000b /* AN010 */ | ||
| 118 | #define Reserved 0x0000 /* AN010 */ | ||
| 119 | #define Char_Field_ASCIIZ 0x0010 /* AN010 */ | ||
| 120 | #define Left_Align 0x0000 /* AN010 */ | ||
| 121 | #define Blank 0x0020 /* AN010 */ | ||
| 122 | #define SubCnt1 0x0001 /* AN010 */ | ||
| 123 | #define No_Input 0x0000 /* AN010 */ | ||
| 124 | |||
| 125 | |||
| 126 | |||
| 127 | #define p_nval_none 0 /* AN000 - no value list ID */ | ||
| 128 | #define p_nval_range 1 /* AN000 - range list ID */ | ||
| 129 | #define p_nval_value 2 /* AN000 - value list ID */ | ||
| 130 | #define p_nval_string 3 /* AN000 - string list ID */ | ||
| 131 | #define p_len_range 9 /* AN000 - Length of a range choice(two DD plus one DB) */ | ||
| 132 | #define p_len_value 5 /* AN000 - Length of a value choice(one DD plus one DB) */ | ||
| 133 | #define p_len_string 3 /* AN000 - Length of a string choice(one DW plus one DB) */ | ||
| 134 | |||
| 135 | |||
| 136 | /*----------------------------------------------------------------------+ | ||
| 137 | | | | ||
| 138 | | type | | ||
| 139 | | | | ||
| 140 | +----------------------------------------------------------------------*/ | ||
| 141 | |||
| 142 | #define p_eol 0 /* AN000 - End of line */ | ||
| 143 | #define p_number 1 /* AN000 - Number */ | ||
| 144 | #define p_list_idx 2 /* AN000 - List Index */ | ||
| 145 | #define p_string 3 /* AN000 - String */ | ||
| 146 | #define p_complex 4 /* AN000 - Complex */ | ||
| 147 | #define p_file_spec 5 /* AN000 - File Spec */ | ||
| 148 | #define p_drive 6 /* AN000 - Drive */ | ||
| 149 | #define p_date_f 7 /* AN000 - Date */ | ||
| 150 | #define p_time_f 8 /* AN000 - Time */ | ||
| 151 | #define p_quoted_string 9 /* AN000 - Quoted String */ | ||
| 152 | |||
| 153 | #define p_no_tag 0x0FF /* AN000 - No ITEM_TAG found */ | ||
| 154 | |||
| 155 | /*----------------------------------------------------------------------+ | ||
| 156 | | | | ||
| 157 | | following return code will be returned in the AX register. | | ||
| 158 | | | | ||
| 159 | +----------------------------------------------------------------------*/ | ||
| 160 | |||
| 161 | #define p_no_error 0 /* AN000 - No error */ | ||
| 162 | #define p_too_many 1 /* AN000 - Too many operands */ | ||
| 163 | #define p_op_missing 2 /* AN000 - Required operand missing */ | ||
| 164 | #define p_not_in_sw 3 /* AN000 - Not in switch list provided */ | ||
| 165 | #define p_not_in_key 4 /* AN000 - Not in keyword list provided */ | ||
| 166 | #define p_out_of_range 6 /* AN000 - Out of range specified */ | ||
| 167 | #define p_not_in_val 7 /* AN000 - Not in value list provided */ | ||
| 168 | #define p_not_in_str 8 /* AN000 - Not in string list provided */ | ||
| 169 | #define p_syntax 9 /* AN000 - Syntax error */ | ||
| 170 | #define p_rc_eol 0x0ffff /* AN000 - End of command line */ | ||
| 171 | |||
| 172 | |||
| 173 | /*----------------------------------------------------------------------+ | ||
| 174 | | | | ||
| 175 | | following are the structure intializations | | ||
| 176 | | | | ||
| 177 | +----------------------------------------------------------------------*/ | ||
| 178 | |||
| 179 | struct p_parms p_p; /* AN000 */ | ||
| 180 | struct p_parmsx p_px; /* AN000 */ | ||
| 181 | struct p_control_blk p_con; /* AN000 */ | ||
| 182 | struct p_switch_blk p_swi1; /* AN000 */ | ||
| 183 | struct p_switch1_blk p_swi2; /* AN000 */ | ||
| 184 | struct p_result_buff p_buff; /* AN000 */ | ||
| 185 | struct p_value_list p_val; /* AN000 */ | ||
| 186 | struct p_result_buff sp_buff; /* AN000 */ | ||
| 187 | struct p_value_list sp_val; /* AN000 */ | ||
| 188 | |||