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

Function gen_event_init

src/gpre/obj_cxx.cpp:2071–2123  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2069//
2070
2071static void gen_event_init( const act* action, int column)
2072{
2073 ObjectNotImplemented();
2074 const TEXT* pattern1 = "fb_%L1l = isc_event_block (&fb_%L1a, &fb_%L1b, (short) %N2";
2075 const TEXT* pattern2 = "isc_wait_for_event (%V1, &%DH, fb_%L1l, fb_%L1a, fb_%L1b);";
2076 const TEXT* pattern3 = "isc_event_counts (fb_events, fb_%L1l, fb_%L1a, fb_%L1b);";
2077
2078 if (action->act_error)
2079 begin(column);
2080 begin(column);
2081
2082 const gpre_nod* init = (gpre_nod*) action->act_object;
2083 const gpre_nod* event_list = init->nod_arg[1];
2084
2085 PAT args;
2086 args.pat_database = (gpre_dbb*) init->nod_arg[3];
2087 args.pat_vector1 = status_vector(action);
2088 args.pat_long1 = (IPTR) init->nod_arg[2];
2089 args.pat_value2 = (int) event_list->nod_count;
2090
2091 // generate call to dynamically generate event blocks
2092
2093 PATTERN_expand((USHORT) column, pattern1, &args);
2094
2095 TEXT variable[MAX_REF_SIZE];
2096 const gpre_nod* const* ptr = event_list->nod_arg;
2097 for (const gpre_nod* const* const end = ptr + event_list->nod_count; ptr < end; ptr++)
2098 {
2099 const gpre_nod* node = *ptr;
2100 if (node->nod_type == nod_field)
2101 {
2102 const ref* reference = (ref*) node->nod_arg[0];
2103 gen_name(variable, reference, true);
2104 printb(", %s", variable);
2105 }
2106 else
2107 printb(", %s", (TEXT* ) node->nod_arg[0]);
2108 }
2109
2110 printb(");");
2111
2112 // generate actual call to event_wait
2113
2114 PATTERN_expand((USHORT) column, pattern2, &args);
2115
2116 // get change in event counts, copying event parameter block for reuse
2117
2118 PATTERN_expand((USHORT) column, pattern3, &args);
2119
2120 if (action->act_error)
2121 endp(column);
2122 set_sqlcode(action, column);
2123}
2124
2125
2126//____________________________________________________________

Callers 1

OBJ_CXX_actionFunction · 0.70

Calls 8

ObjectNotImplementedFunction · 0.85
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