diff options
Diffstat (limited to 'v4.0/src/CMD/SUBST/SUBSTPAR.H')
| -rw-r--r-- | v4.0/src/CMD/SUBST/SUBSTPAR.H | 155 |
1 files changed, 155 insertions, 0 deletions
diff --git a/v4.0/src/CMD/SUBST/SUBSTPAR.H b/v4.0/src/CMD/SUBST/SUBSTPAR.H new file mode 100644 index 0000000..2f985d5 --- /dev/null +++ b/v4.0/src/CMD/SUBST/SUBSTPAR.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 | | ** customized for the JOIN and SUBST utilities ** | | ||
| 7 | | | | ||
| 8 | | Date: 5-21-87 | | ||
| 9 | | | | ||
| 10 | +----------------------------------------------------------------------*/ | ||
| 11 | |||
| 12 | |||
| 13 | struct p_parms | ||
| 14 | { | ||
| 15 | struct p_parmsx *p_parmsx_address; /* address of p_parmsx */ | ||
| 16 | unsigned char p_num_extra; /* number of extra stuff */ | ||
| 17 | }; | ||
| 18 | |||
| 19 | struct p_parmsx | ||
| 20 | { | ||
| 21 | unsigned char p_minp; /* Minimum positional number */ | ||
| 22 | unsigned char p_maxp; /* Maximum positional number */ | ||
| 23 | struct p_control_blk *p_control1; /* Address of the 1st CONTROL block */ | ||
| 24 | struct p_control_blk *p_control2; /* Address of the 2nd CONTROL block */ | ||
| 25 | unsigned char p_maxs; /* Maximun switches */ | ||
| 26 | struct p_switch_blk *p_switch; /* Address of the SWITCH block */ | ||
| 27 | unsigned char p_maxk; /* Maximum keywords */ | ||
| 28 | }; | ||
| 29 | |||
| 30 | |||
| 31 | struct p_control_blk | ||
| 32 | { | ||
| 33 | unsigned int p_match_flag; /* Controls type matched */ | ||
| 34 | unsigned int p_function_flag; /* Function should be taken */ | ||
| 35 | unsigned int p_result_buf; /* Result buffer address */ | ||
| 36 | unsigned int p_value_list; /* Value list address */ | ||
| 37 | unsigned char p_nid; /* # of keyword/SW synonyms */ | ||
| 38 | }; | ||
| 39 | |||
| 40 | struct p_switch_blk | ||
| 41 | { | ||
| 42 | unsigned int sp_match_flag; /* Controls type matched */ | ||
| 43 | unsigned int sp_function_flag; /* Function should be taken */ | ||
| 44 | unsigned int sp_result_buf; /* Result buffer address */ | ||
| 45 | unsigned int sp_value_list; /* Value list address */ | ||
| 46 | unsigned char sp_nid; /* # of keyword/SW synonyms */ | ||
| 47 | unsigned char sp_keyorsw[3]; /* keyword or sw */ | ||
| 48 | }; | ||
| 49 | |||
| 50 | /* Match_Flags */ | ||
| 51 | |||
| 52 | #define P_Num_Val 0x8000 /* Numeric Value */ | ||
| 53 | #define P_SNum_Val 0x4000 /* Signed numeric value */ | ||
| 54 | #define P_Simple_S 0x2000 /* Simple string */ | ||
| 55 | #define P_Date_S 0x1000 /* Date string */ | ||
| 56 | #define P_Time_S 0x0800 /* Time string */ | ||
| 57 | #define P_Cmpx_S 0x0400 /* Complex string */ | ||
| 58 | #define P_File_Spc 0x0200 /* File Spec */ | ||
| 59 | #define P_Drv_Only 0x0100 /* Drive Only */ | ||
| 60 | #define P_Qu_String 0x0080 /* Quoted string */ | ||
| 61 | #define P_Ig_Colon 0x0010 /* Ignore colon at end in match */ | ||
| 62 | #define P_Repeat 0x0002 /* Repeat allowed */ | ||
| 63 | #define P_Optional 0x0001 /* Optional */ | ||
| 64 | |||
| 65 | /*----------------------------------------------------------------------+ | ||
| 66 | | | | ||
| 67 | | Function flags | | ||
| 68 | | | | ||
| 69 | +----------------------------------------------------------------------*/ | ||
| 70 | |||
| 71 | #define P_CAP_File 0x0001 /* CAP result by file table */ | ||
| 72 | #define P_CAP_Char 0x0002 /* CAP result by character table */ | ||
| 73 | #define P_Rm_Colon 0x0010 /* Remove ":" at the end */ | ||
| 74 | |||
| 75 | |||
| 76 | |||
| 77 | #define P_nval_None 0 /* no value list ID */ | ||
| 78 | #define P_nval_Range 1 /* range list ID */ | ||
| 79 | #define P_nval_Value 2 /* value list ID */ | ||
| 80 | #define P_nval_String 3 /* string list ID */ | ||
| 81 | #define P_Len_Range 9 /* Length of a range choice(two DD plus one DB) */ | ||
| 82 | #define P_Len_Value 5 /* Length of a value choice(one DD plus one DB) */ | ||
| 83 | #define P_Len_String 3 /* Length of a string choice(one DW plus one DB) */ | ||
| 84 | |||
| 85 | |||
| 86 | /*----------------------------------------------------------------------+ | ||
| 87 | | | | ||
| 88 | | Result block structure | | ||
| 89 | | | | ||
| 90 | +----------------------------------------------------------------------*/ | ||
| 91 | |||
| 92 | struct p_result_blk | ||
| 93 | { | ||
| 94 | unsigned char P_Type; /* Type returned */ | ||
| 95 | unsigned char P_Item_Tag; /* Matched item tag */ | ||
| 96 | unsigned int P_SYNONYM_Ptr; /* pointer to Synonym list returned */ | ||
| 97 | unsigned int p_result_buff[2]; /* result value */ | ||
| 98 | }; | ||
| 99 | |||
| 100 | struct p_fresult_blk | ||
| 101 | { | ||
| 102 | unsigned char fP_Type; /* Type returned */ | ||
| 103 | unsigned char fP_Item_Tag; /* Matched item tag */ | ||
| 104 | unsigned int fP_SYNONYM_Ptr; /* pointer to Synonym list returned */ | ||
| 105 | char far * fp_result_buff; /* result value */ | ||
| 106 | }; | ||
| 107 | |||
| 108 | /*----------------------------------------------------------------------+ | ||
| 109 | | | | ||
| 110 | | type | | ||
| 111 | | | | ||
| 112 | +----------------------------------------------------------------------*/ | ||
| 113 | |||
| 114 | #define P_EOL 0 /* End of line */ | ||
| 115 | #define P_Number 1 /* Number */ | ||
| 116 | #define P_List_Idx 2 /* List Index */ | ||
| 117 | #define P_String 3 /* String */ | ||
| 118 | #define P_Complex 4 /* Complex */ | ||
| 119 | #define P_File_Spec 5 /* File Spec */ | ||
| 120 | #define P_Drive 6 /* Drive */ | ||
| 121 | #define P_Date_F 7 /* Date */ | ||
| 122 | #define P_Time_F 8 /* Time */ | ||
| 123 | #define P_Quoted_String 9 /* Quoted String */ | ||
| 124 | |||
| 125 | #define P_No_Tag 0x0FF /* No ITEM_TAG found */ | ||
| 126 | |||
| 127 | /*----------------------------------------------------------------------+ | ||
| 128 | | | | ||
| 129 | | Value list structure | | ||
| 130 | | | | ||
| 131 | +----------------------------------------------------------------------*/ | ||
| 132 | |||
| 133 | struct noval | ||
| 134 | { | ||
| 135 | unsigned char null; | ||
| 136 | }; | ||
| 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 | |||