*
* @see f_thread_cancel_state_set()
*
- * @see controller_signal_handler()
+ * @see controller_main_thread_signal()
*/
#if !defined(_di_controller_main_thread_signal_) && !defined(_di_thread_support_)
extern void * controller_main_thread_signal(void * const main);
build_libraries-level -lfll_2 -lfll_1 -lfll_0
build_libraries-monolithic -lfll
-build_objects_library main/controller.o
+build_objects_library main/common.o main/common/define.o main/common/enumeration.o main/common/print.o main/common/string.o main/common/type.o
+build_objects_library main/print/data.o main/print/debug.o main/print/error.o main/print/message.o main/print/verbose.o main/print/warning.o
+build_objects_library main/signal.o main/thread.o
build_sources_library controller/controller.c
build_libraries-level -lfll_2 -lfll_1 -lfll_0
build_libraries-monolithic -lfll
-build_objects_library main/controller.o
+build_objects_library main/common.o main/common/define.o main/common/enumeration.o main/common/print.o main/common/string.o main/common/type.o
+build_objects_library main/print/data.o main/print/debug.o main/print/error.o main/print/message.o main/print/verbose.o main/print/warning.o
+build_objects_library main/signal.o main/thread.o
build_sources_library init/init.c
if (main->setting.flag & controller_main_flag_version_copyright_help_e) {
if (main->setting.flag & controller_main_flag_help_e) {
- controller_print_message_help(&main->program.message);
+ controller_main_print_message_help(&main->program.message);
}
else if (main->setting.flag & controller_main_flag_version_e) {
fll_program_print_version(&main->program.message, controller_program_version_s);
extern void controller_controller_main(controller_main_t * const main);
#endif // _di_controller_controller_main_
-#ifdef _controller_controller_h
+#ifdef __cplusplus
} // extern "C"
#endif
-#endif // _controller_h
+#endif // _controller_controller_h
{
const f_console_arguments_t arguments = macro_f_console_arguments_t_initialize_1(argc, argv, envp);
- controller_setting_load(arguments, &data);
+ controller_main_setting_load(arguments, &data);
}
- controller_main(&data);
+ controller_controller_main(&data);
#else
{
f_thread_id_t id_signal;
memset(&id_signal, 0, sizeof(f_thread_id_t));
- data.setting.state.status = f_thread_create(0, &id_signal, &controller_thread_signal, (void *) &data);
+ data.setting.state.status = f_thread_create(0, &id_signal, &controller_main_thread_signal, (void *) &data);
if (F_status_is_error(data.setting.state.status)) {
- controller_print_error(&data.program.error, macro_controller_f(f_thread_create));
+ controller_main_print_error(&data.program.error, macro_controller_f(f_thread_create));
}
else {
{
const f_console_arguments_t arguments = macro_f_console_arguments_t_initialize_1(argc, argv, envp);
- controller_setting_load(arguments, &data);
+ controller_main_setting_load(arguments, &data);
}
- if (!controller_signal_check(&data)) {
- controller_main(&data);
+ if (!controller_main_signal_check(&data)) {
+ controller_controller_main(&data);
}
f_thread_cancel(id_signal);
#endif
#ifndef _di_controller_init_main_
- void controller_init_main(controller_init_main_t * const main) {
+ void controller_init_main(controller_main_t * const main) {
if (!main) return;
if (F_status_is_error(main->setting.state.status)) {
- if ((main->setting.flag & controller_init_main_flag_print_last_e) && main->program.message.verbosity > f_console_verbosity_error_e) {
+ if ((main->setting.flag & controller_main_flag_print_last_e) && main->program.message.verbosity > f_console_verbosity_error_e) {
fll_print_dynamic_raw(f_string_eol_s, main->program.message.to);
}
return;
}
- if ((main->setting.flag & controller_init_main_flag_print_first_e) && main->program.message.verbosity > f_console_verbosity_error_e) {
+ if ((main->setting.flag & controller_main_flag_print_first_e) && main->program.message.verbosity > f_console_verbosity_error_e) {
fll_print_dynamic_raw(f_string_eol_s, main->program.message.to);
}
main->setting.state.status = F_okay;
- if (main->setting.flag & controller_init_main_flag_version_copyright_help_e) {
- if (main->setting.flag & controller_init_main_flag_help_e) {
- controller_print_message_help(&main->program.message);
+ if (main->setting.flag & controller_main_flag_version_copyright_help_e) {
+ if (main->setting.flag & controller_main_flag_help_e) {
+ controller_main_print_message_help(&main->program.message);
}
- else if (main->setting.flag & controller_init_main_flag_version_e) {
+ else if (main->setting.flag & controller_main_flag_version_e) {
fll_program_print_version(&main->program.message, controller_program_version_s);
}
- else if (main->setting.flag & controller_init_main_flag_copyright_e) {
+ else if (main->setting.flag & controller_main_flag_copyright_e) {
fll_program_print_copyright(&main->program.message);
}
- if ((main->setting.flag & controller_init_main_flag_print_last_e) && main->program.message.verbosity > f_console_verbosity_error_e) {
+ if ((main->setting.flag & controller_main_flag_print_last_e) && main->program.message.verbosity > f_console_verbosity_error_e) {
fll_print_dynamic_raw(f_string_eol_s, main->program.message.to);
}
fll_program_print_signal_received(&main->program.warning, main->program.signal_received);
}
- if ((main->setting.flag & controller_init_main_flag_print_last_e) && main->program.message.verbosity > f_console_verbosity_error_e) {
+ if ((main->setting.flag & controller_main_flag_print_last_e) && main->program.message.verbosity > f_console_verbosity_error_e) {
fll_print_dynamic_raw(f_string_eol_s, main->program.message.to);
}
}
* F_parameter (with error bit) if main is NULL or setting is NULL.
*/
#ifndef _di_controller_init_main_
- extern void controller_init_main(controller_init_main_t * const main);
+ extern void controller_init_main(controller_main_t * const main);
#endif // _di_controller_init_main_
#ifdef __cplusplus
{
const f_console_arguments_t arguments = macro_f_console_arguments_t_initialize_1(argc, argv, envp);
- controller_setting_load(arguments, &data);
+ controller_main_setting_load(arguments, &data);
}
- controller_main(&data);
+ controller_init_main(&data);
#else
{
f_thread_id_t id_signal;
memset(&id_signal, 0, sizeof(f_thread_id_t));
- data.setting.state.status = f_thread_create(0, &id_signal, &controller_thread_signal, (void *) &data);
+ data.setting.state.status = f_thread_create(0, &id_signal, &controller_main_thread_signal, (void *) &data);
if (F_status_is_error(data.setting.state.status)) {
- controller_print_error(&data.program.error, macro_controller_f(f_thread_create));
+ controller_main_print_error(&data.program.error, macro_controller_f(f_thread_create));
}
else {
{
const f_console_arguments_t arguments = macro_f_console_arguments_t_initialize_1(argc, argv, envp);
- controller_setting_load(arguments, &data);
+ controller_main_setting_load(arguments, &data);
}
- if (!controller_signal_check(&data)) {
- controller_main(&data);
+ if (!controller_main_signal_check(&data)) {
+ controller_init_main(&data);
}
f_thread_cancel(id_signal);
fll_print_dynamic_raw(f_string_eol_s, main->program.message.to);
}
- controller_print_error(&main->program.error, macro_controller_f(f_console_parameter_process));
+ controller_main_print_error(&main->program.error, macro_controller_f(f_console_parameter_process));
return;
}
fll_print_dynamic_raw(f_string_eol_s, main->program.message.to);
}
- controller_print_error(&main->program.error, macro_controller_f(fll_program_parameter_process_context_standard));
+ controller_main_print_error(&main->program.error, macro_controller_f(fll_program_parameter_process_context_standard));
return;
}
fll_print_dynamic_raw(f_string_eol_s, main->program.message.to);
}
- controller_print_error(&main->program.error, macro_controller_f(fll_program_parameter_process_verbosity_standard));
+ controller_main_print_error(&main->program.error, macro_controller_f(fll_program_parameter_process_verbosity_standard));
return;
}
main->setting.status_signal = f_signal_wait(&main->program.signal.set, &information);
if (F_status_is_error(main->setting.status_signal) && F_status_set_fine(main->setting.status_signal) != F_interrupt) {
- if (++failsafe >= controller_main_signal_check_failsafe_d) break;
+ if (++failsafe >= controller_signal_check_failsafe_d) break;
}
switch (information.si_signo) {
f_thread_cancel_state_set(PTHREAD_CANCEL_DEFERRED, 0);
if (main) {
- controller_signal_handler((controller_main_t *) main);
+ controller_main_thread_signal((controller_main_t *) main);
}
return 0;
*
* @see f_thread_cancel_state_set()
*
- * @see controller_signal_handler()
+ * @see controller_main_thread_signal()
*/
#if !defined(_di_controller_main_thread_signal_) && !defined(_di_thread_support_)
extern void * controller_main_thread_signal(void * const main);