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