diff options
Diffstat (limited to 'v4.0/src/CMD/FILESYS/PARSE.H')
| -rw-r--r-- | v4.0/src/CMD/FILESYS/PARSE.H | 155 |
1 files changed, 155 insertions, 0 deletions
diff --git a/v4.0/src/CMD/FILESYS/PARSE.H b/v4.0/src/CMD/FILESYS/PARSE.H new file mode 100644 index 0000000..cbfc3c0 --- /dev/null +++ b/v4.0/src/CMD/FILESYS/PARSE.H | |||
| @@ -0,0 +1,155 @@ | |||
| 1 | /* */ | ||
| 2 | /*----------------------------------------------------------------------+ | ||
| 3 | | | | ||
| 4 | | This file contains the structures and defines that are needed to use | | ||
| 5 | | the parser from a C program. | | ||
| 6 | | | | ||
| 7 | | | | ||
| 8 | | Date: 5-21-87 | | ||
| 9 | | | | ||
| 10 | +----------------------------------------------------------------------*/ | ||
| 11 | |||
| 12 | |||
| 13 | #define p_len_parms 4 /* length of p_parms */ | ||
| 14 | #define p_i_use_default 0 /* no extra stuff specified */ | ||
| 15 | #define p_i_have_delim 1 /* extra delimiter specified */ | ||
| 16 | #define p_i_have_eol 2 /* extra EOL specified */ | ||
| 17 | |||
| 18 | struct p_parms | ||
| 19 | { | ||
| 20 | struct p_parmsx *p_parmsx_address; /* address of p_parmsx */ | ||
| 21 | unsigned char p_num_extra; /* number of extra stuff */ | ||
| 22 | unsigned char p_len_extra_delim; /* length of extra delimiter */ | ||
| 23 | char p_extra_delim[30]; /* extra delimiters */ | ||
| 24 | }; | ||
| 25 | |||
| 26 | struct p_parmsx | ||
| 27 | { | ||
| 28 | unsigned char p_minp; /* Minimum positional number */ | ||
| 29 | unsigned char p_maxp; /* Maximum positional number */ | ||
| 30 | struct p_control_blk *p_control[4]; /* Address of the 1st CONTROL block */ | ||
| 31 | unsigned char p_maxswitch; /* Maximum switches */ | ||
| 32 | struct p_control_blk *p_switch[1]; /* Pointer to switch block */ | ||
| 33 | unsigned char p_maxkeyword; /* Maximum keywords */ | ||
| 34 | }; | ||
| 35 | |||
| 36 | |||
| 37 | struct p_control_blk | ||
| 38 | { | ||
| 39 | unsigned int p_match_flag; /* Controls type matched */ | ||
| 40 | unsigned int p_function_flag; /* Function should be taken */ | ||
| 41 | unsigned int p_result_buf; /* Result buffer address */ | ||
| 42 | unsigned int p_value_list; /* Value list address */ | ||
| 43 | unsigned char p_nid; /* # of keyword/SW synonyms */ | ||
| 44 | unsigned char p_keyorsw[20]; /* keyword or sw */ | ||
| 45 | }; | ||
| 46 | |||
| 47 | /* Match_Flags */ | ||
| 48 | |||
| 49 | #define p_num_val 0x8000 /* Numeric Value */ | ||
| 50 | #define p_snum_val 0x4000 /* Signed numeric value */ | ||
| 51 | #define p_simple_s 0x2000 /* Simple string */ | ||
| 52 | #define p_date_s 0x1000 /* Date string */ | ||
| 53 | #define p_time_s 0x0800 /* Time string */ | ||
| 54 | #define p_cmpx_s 0x0400 /* Complex string */ | ||
| 55 | #define p_file_spc 0x0200 /* File Spec */ | ||
| 56 | #define p_drv_only 0x0100 /* Drive Only */ | ||
| 57 | #define p_qu_string 0x0080 /* Quoted string */ | ||
| 58 | #define p_ig_colon 0x0010 /* Ignore colon at end in match */ | ||
| 59 | #define p_repeat 0x0002 /* Repeat allowed */ | ||
| 60 | #define p_optional 0x0001 /* Optional */ | ||
| 61 | #define p_none 0x0000 | ||
| 62 | |||
| 63 | /*----------------------------------------------------------------------+ | ||
| 64 | | | | ||
| 65 | | Value block structure | | ||
| 66 | | | | ||
| 67 | +----------------------------------------------------------------------*/ | ||
| 68 | |||
| 69 | struct p_value_blk | ||
| 70 | { | ||
| 71 | unsigned char p_val_num; | ||
| 72 | }; | ||
| 73 | |||
| 74 | |||
| 75 | /*----------------------------------------------------------------------+ | ||
| 76 | | | | ||
| 77 | | Function flags | | ||
| 78 | | | | ||
| 79 | +----------------------------------------------------------------------*/ | ||
| 80 | |||
| 81 | #define p_cap_file 0x0001 /* CAP result by file table */ | ||
| 82 | #define p_cap_char 0x0002 /* CAP result by character table */ | ||
| 83 | #define p_rm_colon 0x0010 /* Remove ":" at the end */ | ||
| 84 | |||
| 85 | |||
| 86 | |||
| 87 | #define p_nval_none 0 /* no value list ID */ | ||
| 88 | #define p_nval_range 1 /* range list ID */ | ||
| 89 | #define p_nval_value 2 /* value list ID */ | ||
| 90 | #define p_nval_string 3 /* string list ID */ | ||
| 91 | #define p_len_range 9 /* Length of a range choice(two DD plus one DB) */ | ||
| 92 | #define p_len_value 5 /* Length of a value choice(one DD plus one DB) */ | ||
| 93 | #define p_len_string 3 /* Length of a string choice(one DW plus one DB) */ | ||
| 94 | |||
| 95 | |||
| 96 | /*----------------------------------------------------------------------+ | ||
| 97 | | | | ||
| 98 | | Result block structure | | ||
| 99 | | | | ||
| 100 | +----------------------------------------------------------------------*/ | ||
| 101 | |||
| 102 | struct p_result_blk | ||
| 103 | { | ||
| 104 | unsigned char P_Type; /* Type returned */ | ||
| 105 | unsigned char P_Item_Tag; /* Matched item tag */ | ||
| 106 | unsigned int P_SYNONYM_Ptr; /* pointer to Synonym list returned */ | ||
| 107 | char far *p_result_buff; /* result value */ | ||
| 108 | }; | ||
| 109 | |||
| 110 | |||
| 111 | struct p_result_blk_D | ||
| 112 | { | ||
| 113 | unsigned char D_Type; /* Type returned */ | ||
| 114 | unsigned char D_Item_Tag; /* Matched item tag */ | ||
| 115 | unsigned int D_SYNONYM_Ptr; /* pointer to Synonym list returned */ | ||
| 116 | unsigned int D_Res_Drive; /* drive value */ | ||
| 117 | }; | ||
| 118 | |||
| 119 | /*----------------------------------------------------------------------+ | ||
| 120 | | | | ||
| 121 | | type | | ||
| 122 | | | | ||
| 123 | +----------------------------------------------------------------------*/ | ||
| 124 | |||
| 125 | #define p_eol 0 /* End of line */ | ||
| 126 | #define p_number 1 /* Number */ | ||
| 127 | #define p_list_idx 2 /* List Index */ | ||
| 128 | #define p_string 3 /* String */ | ||
| 129 | #define p_complex 4 /* Complex */ | ||
| 130 | #define p_file_spec 5 /* File Spec */ | ||
| 131 | #define p_drive 6 /* Drive */ | ||
| 132 | #define p_date_f 7 /* Date */ | ||
| 133 | #define p_time_f 8 /* Time */ | ||
| 134 | #define p_quoted_string 9 /* Quoted String */ | ||
| 135 | |||
| 136 | #define p_no_tag 0x0FF /* No ITEM_TAG found */ | ||
| 137 | |||
| 138 | /*----------------------------------------------------------------------+ | ||
| 139 | | | | ||
| 140 | | following return code will be returned in the AX register. | | ||
| 141 | | | | ||
| 142 | +----------------------------------------------------------------------*/ | ||
| 143 | |||
| 144 | #define p_no_error 0 /* No error */ | ||
| 145 | #define p_too_many 1 /* Too many operands */ | ||
| 146 | #define p_op_missing 2 /* Required operand missing */ | ||
| 147 | #define p_not_in_sw 3 /* Not in switch list provided */ | ||
| 148 | #define p_not_in_key 4 /* Not in keyword list provided */ | ||
| 149 | #define p_out_of_range 6 /* Out of range specified */ | ||
| 150 | #define p_not_in_val 7 /* Not in value list provided */ | ||
| 151 | #define p_not_in_str 8 /* Not in string list provided */ | ||
| 152 | #define p_syntax 9 /* Syntax error */ | ||
| 153 | #define p_rc_eol 0x0ffff /* End of command line */ | ||
| 154 | |||
| 155 | |||