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

Function gen_request

src/gpre/c_cxx.cpp:2801–2938  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2799//
2800
2801static void gen_request(const gpre_req* request)
2802{
2803 if (!(request->req_flags & (REQ_exp_hand | REQ_sql_blob_open | REQ_sql_blob_create)) &&
2804 request->req_type != REQ_slice && request->req_type != REQ_procedure)
2805 {
2806 printa(0, "static isc_req_handle\n %s = 0;\t\t/* request handle */\n", request->req_handle);
2807 }
2808
2809 // check the case where we need to extend the dpb dynamically at runtime,
2810 // in which case we need dpb length and a pointer to be defined even if
2811 // there is no static dpb defined
2812
2813 if (request->req_flags & REQ_extend_dpb)
2814 {
2815 printa(0, "static char\n *isc_%dp;", request->req_ident);
2816 if (!request->req_length)
2817 printa(0, "static short\n isc_%dl = %d;", request->req_ident, request->req_length);
2818 }
2819
2820 if (request->req_type == REQ_create_database)
2821 printa(0, "static %s\n *isc_%dt;", DCL_LONG, request->req_ident);
2822
2823 if (request->req_flags & (REQ_sql_blob_open | REQ_sql_blob_create))
2824 printa(0, "static isc_stmt_handle\n isc_%ds;\t\t/* sql statement handle */",
2825 request->req_ident);
2826
2827 if (request->req_length)
2828 {
2829 if (request->req_flags & REQ_sql_cursor)
2830 printa(0, "static isc_stmt_handle\n isc_%ds;\t\t/* sql statement handle */",
2831 request->req_ident);
2832 printa(0, "static %sshort\n isc_%dl = %d;",
2833 (request->req_flags & REQ_extend_dpb) ? "" : CONST_STR,
2834 request->req_ident, request->req_length);
2835
2836 const TEXT* string_type = "blr";
2837 bool is_blr = true;
2838
2839 switch (request->req_type)
2840 {
2841 case REQ_create_database:
2842 case REQ_ready:
2843 string_type = "dpb";
2844 is_blr = false;
2845 break;
2846
2847 case REQ_ddl:
2848 string_type = "dyn";
2849 is_blr = false;
2850 break;
2851
2852 case REQ_slice:
2853 string_type = "sdl";
2854 is_blr = false;
2855 break;
2856 }
2857
2858 if (is_blr)

Callers 1

gen_databaseFunction · 0.70

Calls 6

PRETTY_print_cdbFunction · 0.85
CPR_errorFunction · 0.85
PRETTY_print_dynFunction · 0.85
PRETTY_print_sdlFunction · 0.85
printaFunction · 0.70
gen_rawFunction · 0.70

Tested by

no test coverage detected