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

Function gen_get_segment

src/gpre/languages/pas.cpp:2099–2142  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2097//
2098
2099static void gen_get_segment( const act* action, int column)
2100{
2101 blb* blob;
2102 PAT args;
2103 const ref* into;
2104 const TEXT *pattern1 =
2105 "%IFgds__status[2] := %ENGDS__GET_SEGMENT (%V1, %BH, %I1, %S1 (%I2), %RF%I2);";
2106
2107 if (action->act_error && (action->act_type != ACT_blob_for))
2108 begin(column);
2109
2110 if (action->act_flags & ACT_sql)
2111 blob = (blb*) action->act_request->req_blobs;
2112 else
2113 blob = (blb*) action->act_object;
2114
2115 args.pat_blob = blob;
2116 args.pat_vector1 = status_vector(action);
2117 args.pat_condition = true;
2118 args.pat_ident1 = blob->blb_len_ident;
2119 args.pat_ident2 = blob->blb_buff_ident;
2120 args.pat_string1 = SIZEOF;
2121 PATTERN_expand(column, pattern1, &args);
2122
2123 if (action->act_flags & ACT_sql)
2124 {
2125 into = action->act_object;
2126 set_sqlcode(action, column);
2127 printa(column, "if (SQLCODE = 0) or (SQLCODE = 101) then");
2128 column += INDENT;
2129 begin(column);
2130 align(column);
2131 fprintf(gpreGlob.out_file, "gds__ftof (gds__%d, gds__%d, %s, gds__%d);",
2132 blob->blb_buff_ident, blob->blb_len_ident,
2133 into->ref_value, blob->blb_len_ident);
2134 if (into->ref_null_value)
2135 {
2136 align(column);
2137 fprintf(gpreGlob.out_file, "%s := gds__%d;", into->ref_null_value, blob->blb_len_ident);
2138 }
2139 endp(column);
2140 column -= INDENT;
2141 }
2142}
2143
2144
2145//____________________________________________________________

Callers 2

PAS_actionFunction · 0.70
gen_blob_forFunction · 0.70

Calls 7

PATTERN_expandFunction · 0.85
beginFunction · 0.70
status_vectorFunction · 0.70
set_sqlcodeFunction · 0.70
printaFunction · 0.70
alignFunction · 0.70
endpFunction · 0.70

Tested by

no test coverage detected