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

Function gen_get_segment

src/gpre/obj_cxx.cpp:2491–2534  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2489//
2490
2491static void gen_get_segment( const act* action, int column)
2492{
2493 ObjectNotImplemented();
2494 const TEXT* pattern1 =
2495 "fbIStatus = %BH->getSegment(%V1, sizeof(%I2), %I2, &%I1);";
2496
2497 if (action->act_error && (action->act_type != ACT_blob_for))
2498 begin(column);
2499
2500 const blb* blob;
2501 if (action->act_flags & ACT_sql)
2502 blob = (blb*) action->act_request->req_blobs;
2503 else
2504 blob = (blb*) action->act_object;
2505
2506 PAT args;
2507 args.pat_blob = blob;
2508 args.pat_vector1 = status_vector(action);
2509 args.pat_condition = !(action->act_error || (action->act_flags & ACT_sql));
2510 args.pat_ident1 = blob->blb_len_ident;
2511 args.pat_ident2 = blob->blb_buff_ident;
2512 args.pat_string1 = global_status_name;
2513 PATTERN_expand((USHORT) column, pattern1, &args);
2514
2515 if (action->act_flags & ACT_sql)
2516 {
2517 const ref* into = action->act_object;
2518 set_sqlcode(action, column);
2519 printa(column, "if (fbIStatus == Firebird::IStatus::RESULT_OK || fbIStatus == Firebird::IStatus::RESULT_SEGMENT)");
2520 column += INDENT;
2521 begin(column);
2522 align(column);
2523 fprintf(gpreGlob.out_file, "isc_ftof (fb_%d, fb_%d, %s, fb_%d);",
2524 blob->blb_buff_ident, blob->blb_len_ident,
2525 into->ref_value, blob->blb_len_ident);
2526 if (into->ref_null_value)
2527 {
2528 align(column);
2529 fprintf(gpreGlob.out_file, "%s = fb_%d;", into->ref_null_value, blob->blb_len_ident);
2530 }
2531 endp(column);
2532 column -= INDENT;
2533 }
2534}
2535
2536
2537//____________________________________________________________

Callers 2

OBJ_CXX_actionFunction · 0.70
gen_blob_forFunction · 0.70

Calls 8

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