| 2815 | // |
| 2816 | |
| 2817 | static void gen_request(const gpre_req* request) |
| 2818 | { |
| 2819 | if (!(request->req_flags & (REQ_exp_hand | REQ_sql_blob_open | REQ_sql_blob_create)) && |
| 2820 | request->req_type != REQ_slice && request->req_type != REQ_procedure) |
| 2821 | { |
| 2822 | printa(0, "static Firebird::IRequest*\n %s = 0;\t\t/* request handle */\n", request->req_handle); |
| 2823 | } |
| 2824 | |
| 2825 | // check the case where we need to extend the dpb dynamically at runtime, |
| 2826 | // in which case we need dpb length and a pointer to be defined even if |
| 2827 | // there is no static dpb defined |
| 2828 | |
| 2829 | if (request->req_flags & REQ_extend_dpb) |
| 2830 | { |
| 2831 | printa(0, "static char\n *fb_%dp;", request->req_ident); |
| 2832 | if (!request->req_length) |
| 2833 | printa(0, "static short\n fb_%dl = %d;", request->req_ident, request->req_length); |
| 2834 | } |
| 2835 | |
| 2836 | if (request->req_type == REQ_create_database) |
| 2837 | printa(0, "static %s\n *fb_%dt;", DCL_LONG, request->req_ident); |
| 2838 | |
| 2839 | if (request->req_flags & (REQ_sql_blob_open | REQ_sql_blob_create)) |
| 2840 | printa(0, "static Firebird::IStatement*\n fb_%ds;\t\t/* sql statement handle */", |
| 2841 | request->req_ident); |
| 2842 | |
| 2843 | if (request->req_length) |
| 2844 | { |
| 2845 | if (request->req_flags & REQ_sql_cursor) |
| 2846 | printa(0, "static Firebird::IStatement*\n fb_%ds;\t\t/* sql statement handle */", |
| 2847 | request->req_ident); |
| 2848 | printa(0, "static %sunsigned\n fb_%dl = %d;", |
| 2849 | (request->req_flags & REQ_extend_dpb) ? "" : CONST_STR, |
| 2850 | request->req_ident, request->req_length); |
| 2851 | printa(0, "static %sunsigned char\n fb_%d [] = {", CONST_STR, request->req_ident); |
| 2852 | |
| 2853 | const TEXT* string_type = "blr"; |
| 2854 | if (gpreGlob.sw_raw) |
| 2855 | { |
| 2856 | gen_raw(request->req_blr, request->req_length); |
| 2857 | |
| 2858 | switch (request->req_type) |
| 2859 | { |
| 2860 | case REQ_create_database: |
| 2861 | case REQ_ready: |
| 2862 | string_type = "dpb"; |
| 2863 | break; |
| 2864 | |
| 2865 | case REQ_ddl: |
| 2866 | string_type = "dyn"; |
| 2867 | break; |
| 2868 | case REQ_slice: |
| 2869 | string_type = "sdl"; |
| 2870 | break; |
| 2871 | |
| 2872 | default: |
| 2873 | string_type = "blr"; |
| 2874 | } |
no test coverage detected