void free_channel(struct channel *chan_ptr) { free_stages(chan_ptr->first_stage); strncpy(chan_ptr->staname,"",STALEN); strncpy(chan_ptr->network,"",NETLEN); strncpy(chan_ptr->locid,"",LOCIDLEN); strncpy(chan_ptr->chaname,"",CHALEN); strncpy(chan_ptr->beg_t,"",DATIMLEN); strncpy(chan_ptr->end_t,"",DATIMLEN); strncpy(chan_ptr->first_units,"",MAXLINELEN); strncpy(chan_ptr->last_units,"",MAXLINELEN); }
void free_stages(struct stage *stage_ptr) { struct blkt *this_blkt, *next_blkt; if(stage_ptr != (struct stage *)NULL) { free_stages(stage_ptr->next_stage); this_blkt = stage_ptr->first_blkt; while(this_blkt != (struct blkt *)NULL) { next_blkt = this_blkt->next_blkt; switch (this_blkt->type) { case LAPLACE_PZ: case ANALOG_PZ: case IIR_PZ: free_pz(this_blkt); break; case FIR_SYM_1: case FIR_SYM_2: case FIR_ASYM: free_fir(this_blkt); break; case FIR_COEFFS: free_coeff(this_blkt); break; case LIST: free_list(this_blkt); break; case GENERIC: free_generic(this_blkt); break; case DECIMATION: free_deci(this_blkt); break; case GAIN: free_gain(this_blkt); break; case REFERENCE: free_ref(this_blkt); break; default: break; } this_blkt = next_blkt; } free(stage_ptr); } }
/*--------------------------------------------------------------------------------------------- * (function: endSimulation) *-------------------------------------------------------------------------------------------*/ void OdinInterface::endSimulation(){ free_pin_name_list(hold_high); free_pin_name_list(hold_low); hold_high_index->destroy_free_items(hold_high_index); hold_low_index ->destroy_free_items(hold_low_index); fflush(out); fprintf(modelsim_out, "run %d\n", num_vectors*100); printf("\n"); free_stages(stgs); free_lines(output_lines); free_lines(input_lines); fclose(modelsim_out); fclose(in_out); if (input_vector_file) fclose(in); fclose(out); }