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

Function gen_request_decls

src/gpre/languages/ftn.cpp:2946–3005  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2944//
2945
2946static void gen_request_decls( const gpre_req* request)
2947{
2948 if (!(request->req_flags & (REQ_exp_hand | REQ_sql_blob_open | REQ_sql_blob_create)) &&
2949 request->req_type != REQ_slice && request->req_type != REQ_procedure)
2950 {
2951 fprintf(gpreGlob.out_file, "%sINTEGER*4 %s %s{ request handle }\n\n",
2952 COLUMN, request->req_handle, INLINE_COMMENT);
2953 }
2954 // generate the request as BLR long words
2955
2956 const int rlength = (request->req_length + (sizeof(SLONG) - 1)) / sizeof(SLONG);
2957 if (rlength)
2958 {
2959 fprintf(gpreGlob.out_file, "%sINTEGER*4 isc_%d(%d) %s{ request BLR }\n",
2960 COLUMN, request->req_ident, rlength, INLINE_COMMENT);
2961 }
2962
2963 // Generate declarations for the slice description language
2964
2965 for (const gpre_port* port = request->req_ports; port; port = port->por_next)
2966 for (const ref* reference = port->por_references; reference; reference = reference->ref_next)
2967 {
2968 if (reference->ref_sdl)
2969 {
2970 const int slength = (reference->ref_sdl_length + (sizeof(SLONG) - 1)) / sizeof(SLONG);
2971 fprintf(gpreGlob.out_file, "%sINTEGER*4 isc_%d(%d) %s{ request SDL }\n",
2972 COLUMN, reference->ref_sdl_ident, slength, INLINE_COMMENT);
2973 }
2974 }
2975
2976 // Print out any blob parameter block variable declarations required
2977 for (blb* blob = request->req_blobs; blob; blob = blob->blb_next)
2978 if (blob->blb_const_from_type)
2979 {
2980 const int blength = (blob->blb_bpb_length + (sizeof(SLONG) - 1)) / sizeof(SLONG);
2981 fprintf(gpreGlob.out_file, "%sINTEGER*4 isc_%d(%d) %s{ blob parameter block }\n",
2982 COLUMN, blob->blb_bpb_ident, blength, INLINE_COMMENT);
2983 }
2984
2985 if (request->req_flags & REQ_sql_cursor)
2986 fprintf(gpreGlob.out_file, "%sINTEGER*4 isc_%dS %s{ SQL statement handle }\n\n",
2987 COLUMN, request->req_ident, INLINE_COMMENT);
2988
2989 if (request->req_type == REQ_ready || request->req_type == REQ_create_database)
2990 {
2991 printa(COLUMN, "INTEGER*2 isc_%dl", request->req_ident);
2992 if (request->req_flags & REQ_extend_dpb)
2993 printa(COLUMN, "INTEGER*4 isc_%dp", request->req_ident);
2994 }
2995
2996
2997 // If this is a GET_SLICE/PUT_slice, allocate some variables
2998
2999 if (request->req_type == REQ_slice)
3000 {
3001 printa(COLUMN, "INTEGER*4 isc_%dv (%d)", request->req_ident,
3002 MAX(request->req_slice->slc_parameters, 1));
3003 printa(COLUMN, "INTEGER*4 isc_%ds", request->req_ident);

Callers 1

gen_database_declsFunction · 0.85

Calls 1

printaFunction · 0.70

Tested by

no test coverage detected