#define fss_status_code_total_parameters_d 13
#endif // _di_fss_status_code_defines_
-/**
- * Deallocate main.
- *
- * Be sure to call this after executing fss_status_code_main().
- *
- * @param main
- * The main program data.
- *
- * @return
- * F_none on success.
- *
- * Status codes (with error bit) are returned on any problem.
- *
- * @see fss_status_code_main()
- */
-#ifndef _di_fss_status_code_main_delete_
- extern f_status_t fss_status_code_main_delete(fll_program_data_t * const main);
-#endif // _di_fss_status_code_main_delete_
-
#ifdef __cplusplus
} // extern "C"
#endif
f_status_t status = F_none;
- f_console_parameter_t parameters[] = fss_status_code_console_parameter_t_initialize;
- main->parameters.array = parameters;
- main->parameters.used = fss_status_code_total_parameters_d;
-
{
f_console_parameter_id_t ids[3] = { fss_status_code_parameter_no_color_e, fss_status_code_parameter_light_e, fss_status_code_parameter_dark_e };
const f_console_parameter_ids_t choices = macro_f_console_parameter_ids_t_initialize(ids, 3);
fll_program_parameter_process_empty(&main->context, sets);
}
- if (F_status_is_error(status)) {
- fss_status_code_main_delete(main);
-
- return F_status_set_error(status);
- }
+ if (F_status_is_error(status)) return F_status_set_error(status);
}
// Identify priority of verbosity related parameters.
status = f_console_parameter_prioritize_right(main->parameters, choices, &choice);
- if (F_status_is_error(status)) {
- fss_status_code_main_delete(main);
-
- return status;
- }
+ if (F_status_is_error(status)) return status;
if (choice == fss_status_code_parameter_verbosity_quiet_e) {
main->output.verbosity = f_console_verbosity_quiet_e;
if (main->parameters.array[fss_status_code_parameter_help_e].result == f_console_result_found_e) {
fss_status_code_print_help(main->output.to, main->context);
- fss_status_code_main_delete(main);
-
return F_none;
}
if (main->parameters.array[fss_status_code_parameter_version_e].result == f_console_result_found_e) {
fll_program_print_version(main->output.to, fss_status_code_program_version_s);
- fss_status_code_main_delete(main);
-
return F_none;
}
funlockfile(main->error.to.stream);
- fss_status_code_main_delete(main);
-
return F_status_set_error(status);
}
funlockfile(main->error.to.stream);
- fss_status_code_main_delete(main);
-
return F_status_set_error(status);
}
}
funlockfile(main->error.to.stream);
- fss_status_code_main_delete(main);
-
return F_status_set_error(status);
}
if (main->parameters.remaining.used == 0 && !main->process_pipe) {
fll_print_format("%[You failed to specify an error code.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
- fss_status_code_main_delete(main);
-
return F_status_set_error(F_parameter);
}
}
}
- fss_status_code_main_delete(main);
-
return status;
}
#endif // _di_fss_status_code_main_
const f_console_arguments_t arguments = macro_f_console_arguments_t_initialize(argc, argv, envp);
fll_program_data_t data = fll_program_data_t_initialize;
+ f_console_parameter_t parameters[] = fss_status_code_console_parameter_t_initialize;
+ data.parameters.array = parameters;
+ data.parameters.used = fss_status_code_total_parameters_d;
+
if (f_pipe_input_exists()) {
data.process_pipe = F_true;
}
const f_status_t status = fss_status_code_main(&data, &arguments);
+ fll_program_data_delete(&data);
+
fll_program_standard_setdown(&data.signal);
if (F_status_is_error(status) || status == F_false) return 1;