MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / gen_event_wait

Function gen_event_wait

src/gpre/obj_cxx.cpp:2131–2181  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2129//
2130
2131static void gen_event_wait( const act* action, int column)
2132{
2133 ObjectNotImplemented();
2134 TEXT s[64];
2135 const TEXT* pattern1 = "isc_wait_for_event (%V1, &%DH, fb_%L1l, fb_%L1a, fb_%L1b);";
2136 const TEXT* pattern2 = "isc_event_counts (isc_events, fb_%L1l, fb_%L1a, fb_%L1b);";
2137
2138 if (action->act_error)
2139 begin(column);
2140 begin(column);
2141
2142 const gpre_sym* event_name = (gpre_sym*) action->act_object;
2143
2144 // go through the stack of gpreGlob.events, checking to see if the
2145 // event has been initialized and getting the event identifier
2146
2147 const gpre_dbb* database = NULL;
2148 int ident = -1;
2149 for (const gpre_lls* stack_ptr = gpreGlob.events; stack_ptr; stack_ptr = stack_ptr->lls_next)
2150 {
2151 const act* event_action = (const act*) stack_ptr->lls_object;
2152 const gpre_nod* event_init = (gpre_nod*) event_action->act_object;
2153 const gpre_sym* stack_name = (gpre_sym*) event_init->nod_arg[0];
2154 if (!strcmp(event_name->sym_string, stack_name->sym_string))
2155 {
2156 ident = (IPTR) event_init->nod_arg[2];
2157 database = (gpre_dbb*) event_init->nod_arg[3];
2158 }
2159 }
2160
2161 if (ident < 0)
2162 {
2163 sprintf(s, "event handle \"%s\" not found", event_name->sym_string);
2164 CPR_error(s);
2165 return;
2166 }
2167
2168 PAT args;
2169 args.pat_database = database;
2170 args.pat_vector1 = status_vector(action);
2171 args.pat_long1 = ident;
2172
2173 // generate calls to wait on the event and to fill out the gpreGlob.events array
2174
2175 PATTERN_expand((USHORT) column, pattern1, &args);
2176 PATTERN_expand((USHORT) column, pattern2, &args);
2177
2178 if (action->act_error)
2179 endp(column);
2180 set_sqlcode(action, column);
2181}
2182
2183
2184//____________________________________________________________

Callers 1

OBJ_CXX_actionFunction · 0.70

Calls 7

ObjectNotImplementedFunction · 0.85
CPR_errorFunction · 0.85
PATTERN_expandFunction · 0.85
beginFunction · 0.70
status_vectorFunction · 0.70
endpFunction · 0.70
set_sqlcodeFunction · 0.70

Tested by

no test coverage detected