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

Function t_start_auto

src/gpre/languages/ada.cpp:3575–3638  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3573//
3574
3575static void t_start_auto(const act* action,
3576 const gpre_req* request,
3577 const TEXT* vector,
3578 int column,
3579 bool test)
3580{
3581 const TEXT* trname = request_trans(action, request);
3582 const int stat = !strcmp(vector, "isc_status");
3583
3584 begin(column);
3585
3586 if (gpreGlob.sw_auto)
3587 {
3588 TEXT buffer[256], temp[40];
3589 buffer[0] = 0;
3590 for (const gpre_dbb* db = gpreGlob.isc_databases; db; db = db->dbb_next)
3591 {
3592 const TEXT* filename = db->dbb_runtime;
3593 if (filename || !(db->dbb_flags & DBB_sqlca))
3594 {
3595 align(column);
3596 fprintf(gpreGlob.out_file, "if (%s%s = 0", gpreGlob.ada_package,
3597 db->dbb_name->sym_string);
3598 if (stat && buffer[0])
3599 fprintf(gpreGlob.out_file, "and %s(1) = 0", vector);
3600 fprintf(gpreGlob.out_file, ") then");
3601 make_ready(db, filename, vector, column + INDENT, 0);
3602 endif(column);
3603 if (buffer[0])
3604 strcat(buffer, ") and (");
3605 sprintf(temp, "%s%s /= 0", gpreGlob.ada_package, db->dbb_name->sym_string);
3606 strcat(buffer, temp);
3607 }
3608 }
3609 if (!buffer[0])
3610 strcpy(buffer, "True");
3611 if (test)
3612 printa(column, "if (%s) and (%s%s = 0) then", buffer, gpreGlob.ada_package, trname);
3613 else
3614 printa(column, "if (%s) then", buffer);
3615 column += INDENT;
3616 }
3617
3618 int count = 0;
3619 for (const gpre_dbb* db = gpreGlob.isc_databases; db; db = db->dbb_next)
3620 {
3621 count++;
3622 printa(column, "isc_teb(%d).tpb_len:= 0;", count);
3623 printa(column, "isc_teb(%d).tpb_ptr := firebird.null_tpb'address;", count);
3624 printa(column, "isc_teb(%d).dbb_ptr := %s%s'address;", count,
3625 gpreGlob.ada_package, db->dbb_name->sym_string);
3626 }
3627
3628 printa(column, "firebird.start_multiple (%s %s%s, %d, isc_teb'address);",
3629 vector, gpreGlob.ada_package, trname, count);
3630
3631 if (gpreGlob.sw_auto)
3632 {

Callers 8

gen_compileFunction · 0.70
gen_ddlFunction · 0.70
gen_dyn_executeFunction · 0.70
gen_dyn_immediateFunction · 0.70
gen_dyn_openFunction · 0.70
gen_dyn_prepareFunction · 0.70
gen_procedureFunction · 0.70
gen_t_startFunction · 0.70

Calls 7

request_transFunction · 0.70
beginFunction · 0.70
alignFunction · 0.70
make_readyFunction · 0.70
endifFunction · 0.70
printaFunction · 0.70
endpFunction · 0.70

Tested by

no test coverage detected