| 2102 | // |
| 2103 | |
| 2104 | static void gen_event_init(const act* action) |
| 2105 | { |
| 2106 | #if (!defined AIX && !defined AIX_PPC) |
| 2107 | const TEXT* pattern1 = |
| 2108 | "ISC_%N1L = ISC_EVENT_BLOCK_A (%RFISC_%N1A%RE, %RFISC_%N1B%RE, %VF%S3%N2%S4%VE, %RFISC_EVENT_NAMES%RE)"; |
| 2109 | #else |
| 2110 | const TEXT* pattern1 = |
| 2111 | "CALL ISC_EVENT_BLOCK_S (%RFISC_%N1A%RE, %RFISC_%N1B%RE, %VF%S3%N2%S4%VE, %RFISC_EVENT_NAMES%RE, %RFISC_%N1L%RE)"; |
| 2112 | #endif |
| 2113 | const TEXT* pattern2 = |
| 2114 | "CALL %S1 (%V1, %RF%DH%RE, %VFISC_%N1L%VE, %VFISC_%N1A%VE, %VFISC_%N1B%VE)"; |
| 2115 | const TEXT* pattern3 = |
| 2116 | "CALL %S2 (ISC_EVENTS, %VFISC_%N1L%VE, %VFISC_%N1A%VE, %VFISC_%N1B%VE)"; |
| 2117 | |
| 2118 | gpre_nod* init = (gpre_nod*) action->act_object; |
| 2119 | gpre_nod* event_list = init->nod_arg[1]; |
| 2120 | |
| 2121 | PAT args; |
| 2122 | args.pat_database = (gpre_dbb*) init->nod_arg[3]; |
| 2123 | args.pat_vector1 = status_vector(); |
| 2124 | args.pat_value1 = (int)(IPTR) init->nod_arg[2]; |
| 2125 | args.pat_value2 = (int) event_list->nod_count; |
| 2126 | args.pat_string1 = ISC_EVENT_WAIT; |
| 2127 | args.pat_string2 = ISC_EVENT_COUNTS; |
| 2128 | args.pat_string3 = I2_1; |
| 2129 | args.pat_string4 = I2_2; |
| 2130 | |
| 2131 | // generate call to dynamically generate event blocks |
| 2132 | |
| 2133 | TEXT variable[MAX_REF_SIZE]; |
| 2134 | SSHORT count = 0; |
| 2135 | gpre_nod** ptr = event_list->nod_arg; |
| 2136 | for (gpre_nod** const end = ptr + event_list->nod_count; ptr < end; ptr++) |
| 2137 | { |
| 2138 | count++; |
| 2139 | gpre_nod* node = *ptr; |
| 2140 | if (node->nod_type == nod_field) |
| 2141 | { |
| 2142 | const ref* reference = (const ref*) node->nod_arg[0]; |
| 2143 | gen_name(variable, reference, true); |
| 2144 | printa(COLUMN, "ISC_EVENT_NAMES2(%d) = %s", count, variable); |
| 2145 | } |
| 2146 | else |
| 2147 | printa(COLUMN, "ISC_EVENT_NAMES2(%d) = %s", count, node->nod_arg[0]); |
| 2148 | |
| 2149 | #if (!defined AIX && !defined AIX_PPC) |
| 2150 | printa(COLUMN, "ISC_EVENT_NAMES(%d) = ISC_BADDRESS (%sISC_EVENT_NAMES2(%d)%s)", |
| 2151 | count, REF_1, count, REF_2); |
| 2152 | #else |
| 2153 | printa(COLUMN, "CALL ISC_BADDRESS (%sISC_EVENT_NAMES2(%d)%s, ISC_EVENT_NAMES(%d))", |
| 2154 | REF_1, count, REF_2, count); |
| 2155 | #endif |
| 2156 | } |
| 2157 | |
| 2158 | const SSHORT column = 6; |
| 2159 | |
| 2160 | PATTERN_expand(column, pattern1, &args); |
| 2161 |
no test coverage detected