| 1146 | // |
| 1147 | |
| 1148 | static void gen_database(/* const act* action,*/ int column) |
| 1149 | { |
| 1150 | const gpre_req* request; |
| 1151 | |
| 1152 | if (global_first_flag) |
| 1153 | return; |
| 1154 | global_first_flag = true; |
| 1155 | |
| 1156 | fprintf(gpreGlob.out_file, "\n(**** GPRE Preprocessor Definitions ****)\n"); |
| 1157 | fprintf(gpreGlob.out_file, "%%include '/firebird/include/gds.ins.pas';\n"); |
| 1158 | |
| 1159 | int indent = column + INDENT; |
| 1160 | bool flag = true; |
| 1161 | |
| 1162 | for (request = gpreGlob.requests; request; request = request->req_next) |
| 1163 | { |
| 1164 | if (request->req_flags & REQ_local) |
| 1165 | continue; |
| 1166 | for (const gpre_port* port = request->req_ports; port; port = port->por_next) |
| 1167 | { |
| 1168 | if (flag) |
| 1169 | { |
| 1170 | flag = false; |
| 1171 | fprintf(gpreGlob.out_file, "type"); |
| 1172 | } |
| 1173 | make_port(port, indent); |
| 1174 | } |
| 1175 | } |
| 1176 | fprintf(gpreGlob.out_file, "\nvar"); |
| 1177 | for (request = gpreGlob.requests; request; request = request->req_routine) |
| 1178 | { |
| 1179 | if (request->req_flags & REQ_local) |
| 1180 | continue; |
| 1181 | for (const gpre_port* port = request->req_ports; port; port = port->por_next) |
| 1182 | printa(indent, "gds__%d\t: gds__%dt;\t\t\t(* message *)", |
| 1183 | port->por_ident, port->por_ident); |
| 1184 | |
| 1185 | for (blb* blob = request->req_blobs; blob; blob = blob->blb_next) |
| 1186 | { |
| 1187 | printa(indent, "gds__%d\t: gds__handle;\t\t\t(* blob handle *)", blob->blb_ident); |
| 1188 | printa(indent, "gds__%d\t: %s [1 .. %d] of char;\t(* blob segment *)", |
| 1189 | blob->blb_buff_ident, PACKED_ARRAY, blob->blb_seg_length); |
| 1190 | printa(indent, "gds__%d\t: %s;\t\t\t(* segment length *)", blob->blb_len_ident, SHORT_DCL); |
| 1191 | } |
| 1192 | } |
| 1193 | |
| 1194 | const gpre_dbb* db; |
| 1195 | bool all_static = true; |
| 1196 | bool all_extern = true; |
| 1197 | |
| 1198 | for (db = gpreGlob.isc_databases; db; db = db->dbb_next) |
| 1199 | { |
| 1200 | all_static = all_static && (db->dbb_scope == DBB_STATIC); |
| 1201 | all_extern = all_extern && (db->dbb_scope == DBB_EXTERN); |
| 1202 | if (db->dbb_scope == DBB_STATIC) |
| 1203 | printa(indent, "%s\t: %s gds__handle\t:= nil; (* database handle *)", |
| 1204 | db->dbb_name->sym_string, STATIC_STRING); |
| 1205 | } |
no test coverage detected