/** * Shuts down the scanner */ void quit_scanner() { close_source_file(); }
void Uil_src_cleanup_source(void) { int i; /* index over fcbs */ src_source_buffer_type *buffer_to_free; src_source_record_type *record_to_free; src_machine_code_type *first_code_item; src_machine_code_type *code_item_to_free; status l_close_status; /* ** Loop through all open files freeing their fcbs */ for (i = 0; i <= src_l_last_source_file_number; i++) { /* it is possible to get an error before the files are open, so check and see if table is NULL before opening */ if (src_az_source_file_table[i] == NULL) continue; l_close_status = close_source_file (src_az_source_file_table[i]); if ( l_close_status == src_k_close_error ) { diag_issue_diagnostic (d_src_close, diag_k_no_source, diag_k_no_column, src_az_source_file_table[i]->expanded_name); } _free_memory ((char*)src_az_source_file_table [i]); src_az_source_file_table[i] = NULL; } /* ** Loop through list of current source buffers, freeing them */ while (src_az_current_source_buffer != NULL) { buffer_to_free = src_az_current_source_buffer; src_az_current_source_buffer = src_az_current_source_buffer->az_prior_source_buffer; _free_memory ((char*)buffer_to_free); } /* ** Loop through list of source records, freeing them */ while (src_az_first_source_record != NULL) { record_to_free = src_az_first_source_record; first_code_item = record_to_free->az_machine_code_list; while (first_code_item != NULL) { code_item_to_free = first_code_item; first_code_item = first_code_item->az_next_machine_code; _free_memory((char *)code_item_to_free); } src_az_first_source_record = src_az_first_source_record->az_next_source_record; _free_memory ((char*)record_to_free); } /* ** Free Own storage */ /* BEGIN OSF FIX pir 2240 */ /* Memory pointed to by main_fcb already freed. */ /* END OSF FIX pir 2240 */ _free_memory (include_dir); return; }