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

Function gen_event_init

src/gpre/c_cxx.cpp:2032–2083  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2030//
2031
2032static void gen_event_init( const act* action, int column)
2033{
2034 const TEXT* pattern1 = "isc_%L1l = isc_event_block (&isc_%L1a, &isc_%L1b, (short) %N2";
2035 const TEXT* pattern2 = "isc_wait_for_event (%V1, &%DH, isc_%L1l, isc_%L1a, isc_%L1b);";
2036 const TEXT* pattern3 = "isc_event_counts (isc_events, isc_%L1l, isc_%L1a, isc_%L1b);";
2037
2038 if (action->act_error)
2039 begin(column);
2040 begin(column);
2041
2042 const gpre_nod* init = (gpre_nod*) action->act_object;
2043 const gpre_nod* event_list = init->nod_arg[1];
2044
2045 PAT args;
2046 args.pat_database = (gpre_dbb*) init->nod_arg[3];
2047 args.pat_vector1 = status_vector(action);
2048 args.pat_long1 = (IPTR) init->nod_arg[2];
2049 args.pat_value2 = (int) event_list->nod_count;
2050
2051 // generate call to dynamically generate event blocks
2052
2053 PATTERN_expand((USHORT) column, pattern1, &args);
2054
2055 TEXT variable[MAX_REF_SIZE];
2056 const gpre_nod* const* ptr = event_list->nod_arg;
2057 for (const gpre_nod* const* const end = ptr + event_list->nod_count; ptr < end; ptr++)
2058 {
2059 const gpre_nod* node = *ptr;
2060 if (node->nod_type == nod_field)
2061 {
2062 const ref* reference = (ref*) node->nod_arg[0];
2063 gen_name(variable, reference, true);
2064 printb(", %s", variable);
2065 }
2066 else
2067 printb(", %s", (TEXT* ) node->nod_arg[0]);
2068 }
2069
2070 printb(");");
2071
2072 // generate actual call to event_wait
2073
2074 PATTERN_expand((USHORT) column, pattern2, &args);
2075
2076 // get change in event counts, copying event parameter block for reuse
2077
2078 PATTERN_expand((USHORT) column, pattern3, &args);
2079
2080 if (action->act_error)
2081 endp(column);
2082 set_sqlcode(action, column);
2083}
2084
2085
2086//____________________________________________________________

Callers 1

C_CXX_actionFunction · 0.70

Calls 7

PATTERN_expandFunction · 0.85
beginFunction · 0.70
status_vectorFunction · 0.70
gen_nameFunction · 0.70
printbFunction · 0.70
endpFunction · 0.70
set_sqlcodeFunction · 0.70

Tested by

no test coverage detected