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

Function compile_module

src/gpre/gpre.cpp:1302–1364  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1300//
1301
1302static SLONG compile_module( SLONG start_position, const TEXT* base_directory)
1303{
1304 // Reset miscellaneous pointers
1305
1306 gpreGlob.isc_databases = sw_databases;
1307 gpreGlob.requests = NULL;
1308 gpreGlob.events = NULL;
1309 global_last_action = global_first_action = gpreGlob.global_functions = NULL;
1310
1311 // Position the input file and initialize various modules
1312
1313 fseek(input_file, start_position, 0);
1314 input_char = input_buffer;
1315
1316 const Firebird::PathName filename = Firebird::TempFile::create(SCRATCH);
1317 strcpy(trace_file_name, filename.c_str());
1318 trace_file = os_utils::fopen(trace_file_name, "w+b");
1319#ifdef UNIX
1320 unlink(trace_file_name);
1321#endif
1322
1323 if (!trace_file)
1324 {
1325 CPR_error("Couldn't open scratch file");
1326 return 0;
1327 }
1328
1329 position = start_position;
1330 MSC_init();
1331 HSH_init();
1332 PAR_init();
1333 CMP_init();
1334
1335 // Take a first pass at the module
1336
1337 const SLONG end_position = pass1(base_directory);
1338
1339 // finish up any based_ons that got deferred
1340
1341#ifdef GPRE_FORTRAN
1342 if (gpreGlob.sw_language == lang_fortran)
1343 finish_based(global_first_action);
1344#endif
1345
1346 MET_fini(NULL);
1347 PAR_fini();
1348
1349 if (gpreGlob.errors_global)
1350 return end_position;
1351
1352 for (gpre_req* request = gpreGlob.requests; request; request = request->req_next)
1353 {
1354 CMP_compile_request(request);
1355 }
1356
1357 fseek(input_file, start_position, 0);
1358 input_char = input_buffer;
1359

Callers 1

mainFunction · 0.85

Calls 15

fseekFunction · 0.85
createFunction · 0.85
CPR_errorFunction · 0.85
MSC_initFunction · 0.85
HSH_initFunction · 0.85
PAR_initFunction · 0.85
CMP_initFunction · 0.85
pass1Function · 0.85
finish_basedFunction · 0.85
MET_finiFunction · 0.85
PAR_finiFunction · 0.85
pass2Function · 0.85

Tested by

no test coverage detected