| 2467 | // |
| 2468 | |
| 2469 | static void gen_request( gpre_req* request, int column) |
| 2470 | { |
| 2471 | // generate request handle, blob handles, and ports |
| 2472 | |
| 2473 | if (!(request->req_flags & (REQ_exp_hand | REQ_sql_blob_open | REQ_sql_blob_create)) && |
| 2474 | request->req_type != REQ_slice && request->req_type != REQ_procedure) |
| 2475 | { |
| 2476 | printa(column, "%s\t: firebird.request_handle := 0;-- request handle --", request->req_handle); |
| 2477 | } |
| 2478 | |
| 2479 | if (request->req_flags & (REQ_sql_blob_open | REQ_sql_blob_create)) |
| 2480 | printa(column, "isc_%do\t: %s;\t\t-- SQL CURSOR FLAG --", request->req_ident, SHORT_DCL); |
| 2481 | |
| 2482 | // check the case where we need to extend the dpb dynamically at runtime, |
| 2483 | // in which case we need dpb length and a pointer to be defined even if |
| 2484 | // there is no static dpb defined |
| 2485 | |
| 2486 | if (request->req_flags & REQ_extend_dpb) |
| 2487 | { |
| 2488 | printa(column, "isc_%dp\t: firebird.dpb_ptr := 0;\t-- db parameter block --", |
| 2489 | request->req_ident); |
| 2490 | if (!request->req_length) |
| 2491 | printa(column, "isc_%dl\t: firebird.isc_ushort := 0;\t-- db parameter block --", |
| 2492 | request->req_ident); |
| 2493 | } |
| 2494 | |
| 2495 | // generate actual BLR string |
| 2496 | |
| 2497 | if (request->req_length) |
| 2498 | { |
| 2499 | const SSHORT length = request->req_length; |
| 2500 | switch (request->req_type) |
| 2501 | { |
| 2502 | case REQ_create_database: |
| 2503 | if (gpreGlob.ada_flags & gpreGlob.ADA_create_database) |
| 2504 | { |
| 2505 | printa(column, |
| 2506 | "function isc_to_dpb_ptr is new unchecked_conversion (system.address, firebird.dpb_ptr);"); |
| 2507 | gpreGlob.ada_flags &= ~gpreGlob.ADA_create_database; |
| 2508 | } |
| 2509 | // fall into ... |
| 2510 | case REQ_ready: |
| 2511 | printa(column, "isc_%dl\t: firebird.isc_ushort := %d;\t-- db parameter block --", |
| 2512 | request->req_ident, length); |
| 2513 | printa(column, "isc_%d\t: CONSTANT firebird.dpb (1..%d) := (", request->req_ident, length); |
| 2514 | break; |
| 2515 | |
| 2516 | default: |
| 2517 | if (request->req_flags & REQ_sql_cursor) |
| 2518 | printa(column, "isc_%do\t: %s;\t\t-- SQL CURSOR FLAG --", |
| 2519 | request->req_ident, SHORT_DCL); |
| 2520 | printa(column, "isc_%d\t: CONSTANT firebird.blr (1..%d) := (", request->req_ident, length); |
| 2521 | } |
| 2522 | gen_raw(request->req_blr, request->req_length); |
| 2523 | printa(column, ");\n"); |
| 2524 | const TEXT* string_type; |
| 2525 | if (!gpreGlob.sw_raw) |
| 2526 | { |
no test coverage detected