// file: process_data.C // // the solution to homework assignment no. 1 // #include "./process_data.h" main(int argc, char** argv) { printf("%s:\n\n", PROGRAM_NAME); // process the command line // char output_file[MAX_STRING_LENGTH]; char input_file[MAX_STRING_LENGTH]; char param_file[MAX_STRING_LENGTH]; if (process_command_line_C(output_file, input_file, param_file, argc, argv) == L_FALSE) { printf("%s: error parsing command line\n", PROGRAM_NAME); return(SSPL_ERROR); } printf("\tinput_file = %s\n", input_file); printf("\tparameter_file = %s\n", param_file); printf("\toutput_file = %s\n", output_file); // get parameters // float sample_frequency; float frame_duration; float window_duration; if (get_parameters_C(sample_frequency, frame_duration, window_duration, param_file) == L_FALSE) { printf("%s: error parsing parameter file\n", PROGRAM_NAME); return(SSPL_ERROR); } printf("\tsample_frequency = %f\n", sample_frequency); printf("\tframe_duration = %f\n", frame_duration); printf("\twindow_duration = %f\n", window_duration); printf("\n"); // process the files // if (process_file_C(output_file, input_file, sample_frequency, frame_duration, window_duration) == L_FALSE) { printf("%s: error processing data\n", PROGRAM_NAME); return(SSPL_ERROR); } // exit gracefully // printf("\nend of %s\n", PROGRAM_NAME); return(SSPL_NO_ERROR); }