const f_string_static_t controller_default_s = macro_f_string_static_t_initialize(CONTROLLER_default_s, 0, CONTROLLER_default_s_length);
const f_string_static_t controller_define_s = macro_f_string_static_t_initialize(CONTROLLER_define_s, 0, CONTROLLER_define_s_length);
const f_string_static_t controller_delay_s = macro_f_string_static_t_initialize(CONTROLLER_delay_s, 0, CONTROLLER_delay_s_length);
+ const f_string_static_t controller_directory_s = macro_f_string_static_t_initialize(CONTROLLER_directory_s, 0, CONTROLLER_directory_s_length);
const f_string_static_t controller_disable_s = macro_f_string_static_t_initialize(CONTROLLER_disable_s, 0, CONTROLLER_disable_s_length);
const f_string_static_t controller_engine_s = macro_f_string_static_t_initialize(CONTROLLER_engine_s, 0, CONTROLLER_engine_s_length);
const f_string_static_t controller_entry_s = macro_f_string_static_t_initialize(CONTROLLER_entry_s, 0, CONTROLLER_entry_s_length);
const f_string_static_t controller_failsafe_s = macro_f_string_static_t_initialize(CONTROLLER_failsafe_s, 0, CONTROLLER_failsafe_s_length);
const f_string_static_t controller_failure_s = macro_f_string_static_t_initialize(CONTROLLER_failure_s, 0, CONTROLLER_failure_s_length);
const f_string_static_t controller_fifo_s = macro_f_string_static_t_initialize(CONTROLLER_fifo_s, 0, CONTROLLER_fifo_s_length);
+ const f_string_static_t controller_file_s = macro_f_string_static_t_initialize(CONTROLLER_file_s, 0, CONTROLLER_file_s_length);
const f_string_static_t controller_freeze_s = macro_f_string_static_t_initialize(CONTROLLER_freeze_s, 0, CONTROLLER_freeze_s_length);
const f_string_static_t controller_fsize_s = macro_f_string_static_t_initialize(CONTROLLER_fsize_s, 0, CONTROLLER_fsize_s_length);
const f_string_static_t controller_full_path_s = macro_f_string_static_t_initialize(CONTROLLER_full_path_s, 0, CONTROLLER_full_path_s_length);
const f_string_static_t controller_pid_file_s = macro_f_string_static_t_initialize(CONTROLLER_pid_file_s, 0, CONTROLLER_pid_file_s_length);
const f_string_static_t controller_processor_s = macro_f_string_static_t_initialize(CONTROLLER_processor_s, 0, CONTROLLER_processor_s_length);
const f_string_static_t controller_program_s = macro_f_string_static_t_initialize(CONTROLLER_program_s, 0, CONTROLLER_program_s_length);
+ const f_string_static_t controller_readonly_s = macro_f_string_static_t_initialize(CONTROLLER_readonly_s, 0, CONTROLLER_readonly_s_length);
const f_string_static_t controller_ready_s = macro_f_string_static_t_initialize(CONTROLLER_ready_s, 0, CONTROLLER_ready_s_length);
const f_string_static_t controller_reboot_s = macro_f_string_static_t_initialize(CONTROLLER_reboot_s, 0, CONTROLLER_reboot_s_length);
const f_string_static_t controller_reload_s = macro_f_string_static_t_initialize(CONTROLLER_reload_s, 0, CONTROLLER_reload_s_length);
const f_string_static_t controller_Entry_s = macro_f_string_static_t_initialize(CONTROLLER_Entry_s, 0, CONTROLLER_Entry_s_length);
const f_string_static_t controller_Exit_s = macro_f_string_static_t_initialize(CONTROLLER_Exit_s, 0, CONTROLLER_Exit_s_length);
+ const f_string_static_t controller_Item_s = macro_f_string_static_t_initialize(CONTROLLER_Item_s, 0, CONTROLLER_Item_s_length);
const f_string_static_t controller_parameter_map_option_s = macro_f_string_static_t_initialize(CONTROLLER_parameter_map_option_s, 0, CONTROLLER_parameter_map_option_s_length);
const f_string_static_t controller_parameter_map_value_s = macro_f_string_static_t_initialize(CONTROLLER_parameter_map_value_s, 0, CONTROLLER_parameter_map_value_s_length);
#define CONTROLLER_default_s "default"
#define CONTROLLER_define_s "define"
#define CONTROLLER_delay_s "delay"
+ #define CONTROLLER_directory_s "directory"
#define CONTROLLER_disable_s "disable"
#define CONTROLLER_engine_s "engine"
#define CONTROLLER_entry_s "entry"
#define CONTROLLER_failsafe_s "failsafe"
#define CONTROLLER_failure_s "failure"
#define CONTROLLER_fifo_s "fifo"
+ #define CONTROLLER_file_s "file"
#define CONTROLLER_freeze_s "freeze"
#define CONTROLLER_fsize_s "fsize"
#define CONTROLLER_full_path_s "full_path"
#define CONTROLLER_pid_file_s "pid_file"
#define CONTROLLER_processor_s "processor"
#define CONTROLLER_program_s "program"
+ #define CONTROLLER_readonly_s "readonly"
#define CONTROLLER_ready_s "ready"
#define CONTROLLER_reboot_s "reboot"
#define CONTROLLER_reload_s "reload"
#define CONTROLLER_Entry_s "Entry"
#define CONTROLLER_Exit_s "Exit"
+ #define CONTROLLER_Item_s "Item"
#define CONTROLLER_parameter_map_option_s ":option"
#define CONTROLLER_parameter_map_value_s ":value"
#define CONTROLLER_define_s_length 6
#define CONTROLLER_delay_s_length 5
#define CONTROLLER_disable_s_length 7
+ #define CONTROLLER_directory_s_length 9
#define CONTROLLER_engine_s_length 6
#define CONTROLLER_entry_s_length 5
#define CONTROLLER_entries_s_length 7
#define CONTROLLER_failure_s_length 7
#define CONTROLLER_failsafe_s_length 8
#define CONTROLLER_fifo_s_length 4
+ #define CONTROLLER_file_s_length 4
#define CONTROLLER_freeze_s_length 6
#define CONTROLLER_fsize_s_length 5
#define CONTROLLER_full_path_s_length 9
#define CONTROLLER_pid_file_s_length 8
#define CONTROLLER_processor_s_length 9
#define CONTROLLER_program_s_length 7
+ #define CONTROLLER_readonly_s_length 8
#define CONTROLLER_ready_s_length 5
#define CONTROLLER_reboot_s_length 6
#define CONTROLLER_reload_s_length 6
#define CONTROLLER_Entry_s_length 5
#define CONTROLLER_Exit_s_length 4
+ #define CONTROLLER_Item_s_length 4
#define CONTROLLER_parameter_map_option_s_length 7
#define CONTROLLER_parameter_map_value_s_length 6
extern const f_string_static_t controller_default_s;
extern const f_string_static_t controller_define_s;
extern const f_string_static_t controller_delay_s;
+ extern const f_string_static_t controller_directory_s;
extern const f_string_static_t controller_disable_s;
extern const f_string_static_t controller_engine_s;
extern const f_string_static_t controller_entry_s;
extern const f_string_static_t controller_failsafe_s;
extern const f_string_static_t controller_failure_s;
extern const f_string_static_t controller_fifo_s;
+ extern const f_string_static_t controller_file_s;
extern const f_string_static_t controller_freeze_s;
extern const f_string_static_t controller_fsize_s;
extern const f_string_static_t controller_full_path_s;
extern const f_string_static_t controller_pid_file_s;
extern const f_string_static_t controller_processor_s;
extern const f_string_static_t controller_program_s;
+ extern const f_string_static_t controller_readonly_s;
extern const f_string_static_t controller_ready_s;
extern const f_string_static_t controller_reboot_s;
extern const f_string_static_t controller_reload_s;
extern const f_string_static_t controller_Entry_s;
extern const f_string_static_t controller_Exit_s;
+ extern const f_string_static_t controller_Item_s;
extern const f_string_static_t controller_parameter_map_option_s;
extern const f_string_static_t controller_parameter_map_value_s;
}
#endif // _di_controller_entry_settings_read_map_
+#ifndef _di_controller_entry_setting_validate_
+ void controller_entry_setting_validate(const controller_global_t global, const bool is_entry, controller_cache_t * const cache) {
+
+ controller_entry_t * const entry = is_entry ? &global.setting->entry : &global.setting->exit;
+
+ controller_lock_print(global.main->output.to, global.thread);
+
+ const f_string_static_t *string = 0;
+
+ f_status_t status = F_none;
+ f_array_length_t i = 0;
+ f_array_length_t j = 0;
+
+ fl_print_format("%r%Q %[%Q%] {%r", global.main->output.to.stream, f_string_eol_s, is_entry ? controller_Entry_s : controller_Exit_s, global.main->context.set.title, controller_settings_s, global.main->context.set.title, f_string_eol_s);
+
+
+ // Mode.
+ if (global.setting->mode == controller_setting_mode_service_e) {
+ string = &controller_mode_s;
+ }
+ else if (global.setting->mode == controller_setting_mode_helper_e) {
+ string = &controller_helper_s;
+ }
+ else if (global.setting->mode == controller_setting_mode_program_e) {
+ string = &controller_program_s;
+ }
+ else {
+ string = &f_string_empty_s;
+ }
+
+ fl_print_format(" %[%r%]", global.main->output.to.stream, global.main->context.set.important, controller_mode_s, global.main->context.set.important, f_string_eol_s);
+
+ if (string->used) {
+ fl_print_format(" %r", global.main->output.to.stream, *string);
+ }
+
+ fl_print_format("%r", global.main->output.to.stream, f_string_eol_s);
+
+
+ // Session.
+ if (entry->pid == controller_entry_session_new_e) {
+ string = &controller_new_s;
+ }
+ else if (entry->pid == controller_entry_session_same_e) {
+ string = &controller_same_s;
+ }
+ else {
+ string = &f_string_empty_s;
+ }
+
+ fl_print_format(" %[%r%]", global.main->output.to.stream, global.main->context.set.important, controller_session_s, global.main->context.set.important, f_string_eol_s);
+
+ if (string->used) {
+ fl_print_format(" %r", global.main->output.to.stream, *string, f_string_eol_s);
+ }
+
+ fl_print_format("%r", global.main->output.to.stream, f_string_eol_s);
+
+
+ // Show.
+ if (entry->pid == controller_entry_show_normal_e) {
+ string = &controller_normal_s;
+ }
+ else if (entry->pid == controller_entry_show_init_e) {
+ string = &controller_init_s;
+ }
+ else {
+ string = &f_string_empty_s;
+ }
+
+ fl_print_format(" %[%r%]", global.main->output.to.stream, global.main->context.set.important, controller_show_s, global.main->context.set.important, f_string_eol_s);
+
+ if (string->used) {
+ fl_print_format(" %r", global.main->output.to.stream, *string, f_string_eol_s);
+ }
+
+ fl_print_format("%r", global.main->output.to.stream, f_string_eol_s);
+
+
+ // Pid.
+ if (entry->pid == controller_entry_pid_disable_e) {
+ string = &controller_disable_s;
+ }
+ else if (entry->pid == controller_entry_pid_require_e) {
+ string = &controller_require_s;
+ }
+ else if (entry->pid == controller_entry_pid_ready_e) {
+ string = &controller_ready_s;
+ }
+ else {
+ string = &f_string_empty_s;
+ }
+
+ fl_print_format(" %[%r%]", global.main->output.to.stream, global.main->context.set.important, controller_pid_s, global.main->context.set.important);
+
+ if (string->used) {
+ fl_print_format(" %r", global.main->output.to.stream, *string);
+ }
+
+ fl_print_format("%r", global.main->output.to.stream, f_string_eol_s);
+
+
+ // Pid File.
+ fl_print_format(" %[%r%]", global.main->output.to.stream, global.main->context.set.important, controller_pid_file_s, global.main->context.set.important);
+
+ if (global.setting->path_pid.used) {
+ fl_print_format(" %r", global.main->output.to.stream, global.setting->path_pid);
+ }
+
+ fl_print_format("%r", global.main->output.to.stream, f_string_eol_s);
+
+
+ // Control.
+ fl_print_format(" %[%r%]", global.main->output.to.stream, global.main->context.set.important, controller_control_s, global.main->context.set.important);
+
+ if (global.setting->path_control.used) {
+ fl_print_format(" %Q", global.main->output.to.stream, global.setting->path_control);
+ }
+
+ if (global.setting->control.flag & controller_control_flag_readonly_e) {
+ fl_print_format(" %r", global.main->output.to.stream, controller_readonly_s);
+ }
+
+ fl_print_format("%r", global.main->output.to.stream, f_string_eol_s);
+
+
+ // Control User.
+ fl_print_format(" %[%r%]", global.main->output.to.stream, global.main->context.set.important, controller_control_user_s, global.main->context.set.important);
+
+ if (global.setting->control.flag & controller_control_flag_has_user_e) {
+ fl_print_format(" %u", global.main->output.to.stream, (unsigned int) global.setting->control.user);
+ }
+
+ fl_print_format("%r", global.main->output.to.stream, f_string_eol_s);
+
+
+ // Control Group.
+ fl_print_format(" %[%r%]", global.main->output.to.stream, global.main->context.set.important, controller_control_group_s, global.main->context.set.important);
+
+ if (global.setting->control.flag & controller_control_flag_has_group_e) {
+ fl_print_format(" %u", global.main->output.to.stream, (unsigned int) global.setting->control.group);
+ }
+
+ fl_print_format("%r", global.main->output.to.stream, f_string_eol_s);
+
+
+ // Control Mode.
+ fl_print_format(" %[%r%]", global.main->output.to.stream, global.main->context.set.important, controller_control_mode_s, global.main->context.set.important);
+
+ if (F_status_is_error_not(status)) {
+ if (global.setting->control.flag & controller_control_flag_has_group_e) {
+ fl_print_format(" %@05u", global.main->output.to.stream, (unsigned int) global.setting->control.mode);
+ }
+ }
+
+ fl_print_format("%r", global.main->output.to.stream, f_string_eol_s);
+
+
+ // Timeout: Exit.
+ fl_print_format(" %[%r%] %r", global.main->output.to.stream, global.main->context.set.important, controller_timeout_s, global.main->context.set.important, controller_exit_s);
+
+ if (!(entry->flag & controller_entry_flag_timeout_exit_no_e)) {
+ fl_print_format(" %ul", global.main->output.to.stream, entry->timeout_exit, f_string_eol_s);
+ }
+
+ fl_print_format("%r", global.main->output.to.stream, f_string_eol_s);
+
+
+ // Timeout: Kill.
+ fl_print_format(" %[%r%] %r", global.main->output.to.stream, global.main->context.set.important, controller_timeout_s, global.main->context.set.important, controller_kill_s);
+
+ if (!(entry->flag & controller_entry_flag_timeout_kill_no_e)) {
+ fl_print_format(" %ul", global.main->output.to.stream, entry->timeout_kill, f_string_eol_s);
+ }
+
+ fl_print_format("%r", global.main->output.to.stream, f_string_eol_s);
+
+
+ // Timeout: Start.
+ fl_print_format(" %[%r%] %r", global.main->output.to.stream, global.main->context.set.important, controller_timeout_s, global.main->context.set.important, controller_start_s);
+
+ if (!(entry->flag & controller_entry_flag_timeout_start_no_e)) {
+ fl_print_format(" %ul", global.main->output.to.stream, entry->timeout_start, f_string_eol_s);
+ }
+
+ fl_print_format("%r", global.main->output.to.stream, f_string_eol_s);
+
+
+ // Timeout: Stop.
+ fl_print_format(" %[%r%] %r", global.main->output.to.stream, global.main->context.set.important, controller_timeout_s, global.main->context.set.important, controller_stop_s);
+
+ if (!(entry->flag & controller_entry_flag_timeout_stop_no_e)) {
+ fl_print_format(" %ul", global.main->output.to.stream, entry->timeout_stop, f_string_eol_s);
+ }
+
+ fl_print_format("%r", global.main->output.to.stream, f_string_eol_s);
+
+
+ // Define.
+ fl_print_format(" %[%r%] {%r", global.main->output.to.stream, global.main->context.set.important, controller_define_s, global.main->context.set.important, f_string_eol_s);
+
+ for (i = 0; i < entry->define.used; ++i) {
+ fl_print_format(" %Q %Q%r", global.main->output.to.stream, entry->define.array[i].name, entry->define.array[i].value, f_string_eol_s);
+ } // for
+
+ fl_print_format(" }%r", global.main->output.to.stream, f_string_eol_s, f_string_eol_s);
+
+
+ // Parameter.
+ fl_print_format(" %[%r%] {%r", global.main->output.to.stream, global.main->context.set.important, controller_parameter_s, global.main->context.set.important, f_string_eol_s);
+
+ for (i = 0; i < entry->parameter.used; ++i) {
+ fl_print_format(" %Q %Q%r", global.main->output.to.stream, entry->parameter.array[i].name, entry->parameter.array[i].value, f_string_eol_s);
+ } // for
+
+ fl_print_format(" }%r", global.main->output.to.stream, f_string_eol_s);
+
+ fl_print_format("}%r", global.main->output.to.stream, f_string_eol_s);
+
+
+ // Entry Items.
+ if (entry->items.used) {
+ controller_entry_action_t *action = 0;
+ bool raw = F_false;
+ f_array_length_t k = 0;
+
+ for (i = 0; i < entry->items.used; ++i) {
+
+ fl_print_format("%r%Q %Q %[%Q%] {%r", global.main->output.to.stream, f_string_eol_s, is_entry ? controller_Entry_s : controller_Exit_s, controller_Item_s, global.main->context.set.title, entry->items.array[i].name, global.main->context.set.title, f_string_eol_s);
+
+ for (j = 0; j < entry->items.array[i].actions.used; ++j) {
+
+ action = &entry->items.array[i].actions.array[j];
+
+ fl_print_format(" %[%r%] {%r", global.main->output.to.stream, global.main->context.set.important, controller_action_s, global.main->context.set.important, f_string_eol_s);
+
+
+ // Item Type.
+ if (action->type == controller_entry_action_type_consider_e) {
+ string = &controller_consider_s;
+ raw = F_false;
+ }
+ else if (action->type == controller_entry_action_type_execute_e) {
+ string = &controller_execute_s;
+ raw = F_true;
+ }
+ else if (action->type == controller_entry_action_type_failsafe_e) {
+ string = &controller_failsafe_s;
+ raw = F_true;
+ }
+ else if (action->type == controller_entry_action_type_freeze_e) {
+ string = &controller_freeze_s;
+ raw = F_false;
+ }
+ else if (action->type == controller_entry_action_type_item_e) {
+ string = &controller_item_s;
+ raw = F_true;
+ }
+ else if (action->type == controller_entry_action_type_kexec_e) {
+ string = &controller_kexec_s;
+ raw = F_false;
+ }
+ else if (action->type == controller_entry_action_type_kill_e) {
+ string = &controller_kill_s;
+ raw = F_false;
+ }
+ else if (action->type == controller_entry_action_type_pause_e) {
+ string = &controller_pause_s;
+ raw = F_false;
+ }
+ else if (action->type == controller_entry_action_type_ready_e) {
+ string = &controller_ready_s;
+ raw = F_true;
+ }
+ else if (action->type == controller_entry_action_type_reboot_e) {
+ string = &controller_reboot_s;
+ raw = F_false;
+ }
+ else if (action->type == controller_entry_action_type_reload_e) {
+ string = &controller_reload_s;
+ raw = F_false;
+ }
+ else if (action->type == controller_entry_action_type_restart_e) {
+ string = &controller_restart_s;
+ raw = F_false;
+ }
+ else if (action->type == controller_entry_action_type_resume_e) {
+ string = &controller_resume_s;
+ raw = F_false;
+ }
+ else if (action->type == controller_entry_action_type_shutdown_e) {
+ string = &controller_shutdown_s;
+ raw = F_false;
+ }
+ else if (action->type == controller_entry_action_type_start_e) {
+ string = &controller_start_s;
+ raw = F_false;
+ }
+ else if (action->type == controller_entry_action_type_stop_e) {
+ string = &controller_stop_s;
+ raw = F_false;
+ }
+ else if (action->type == controller_entry_action_type_timeout_e) {
+ string = &controller_timeout_s;
+ raw = F_true;
+ }
+ else if (action->type == controller_entry_action_type_thaw_e) {
+ string = &controller_thaw_s;
+ raw = F_false;
+ }
+ else {
+ string = &f_string_empty_s;
+ }
+
+ fl_print_format(" %[%r%] %r%r", global.main->output.to.stream, global.main->context.set.important, controller_type_s, global.main->context.set.important, *string, f_string_eol_s);
+
+
+ // Item Code (How).
+ fl_print_format(" %[%r%]", global.main->output.to.stream, global.main->context.set.important, controller_how_s, global.main->context.set.important);
+
+ if (action->code) {
+ if (action->code == controller_entry_rule_code_asynchronous_d) {
+ fl_print_format(" %r", global.main->output.to.stream, controller_asynchronous_s);
+ }
+
+ if (action->type == controller_entry_rule_code_require_d) {
+ fl_print_format(" %r", global.main->output.to.stream, controller_require_s);
+ }
+
+ if (action->type == controller_entry_rule_code_wait_d) {
+ fl_print_format(" %r", global.main->output.to.stream, controller_wait_s);
+ }
+ }
+
+ fl_print_format("%r", global.main->output.to.stream, f_string_eol_s);
+
+
+ // Parameters.
+ if (action->type == controller_entry_action_type_item_e) {
+ fl_print_format(" %[%r%]", global.main->output.to.stream, global.main->context.set.important, controller_item_s, global.main->context.set.important);
+
+ if (action->parameters.used && action->parameters.array[0].used) {
+ fl_print_format(" %Q", global.main->output.to.stream, action->parameters.array[0], f_string_eol_s);
+ }
+
+ fl_print_format("%r", global.main->output.to.stream, f_string_eol_s);
+ }
+ else if (raw) {
+ for (k = 0; k < action->parameters.used; ++k) {
+ fl_print_format(" %[%r%] %Q%r", global.main->output.to.stream, global.main->context.set.important, controller_parameter_s, global.main->context.set.important, action->parameters.array[k], f_string_eol_s);
+ } // for
+ }
+ else {
+
+ // Parameter, Directory.
+ fl_print_format(" %[%r%]", global.main->output.to.stream, global.main->context.set.important, controller_directory_s, global.main->context.set.important);
+
+ if (action->parameters.used && action->parameters.array[0].used) {
+ fl_print_format(" %Q", global.main->output.to.stream, action->parameters.array[0], f_string_eol_s);
+ }
+
+ fl_print_format("%r", global.main->output.to.stream, f_string_eol_s);
+
+
+ // Parameter, File.
+ fl_print_format(" %[%r%]", global.main->output.to.stream, global.main->context.set.important, controller_file_s, global.main->context.set.important);
+
+ if (action->parameters.used && action->parameters.array[0].used > 1) {
+ fl_print_format(" %Q", global.main->output.to.stream, action->parameters.array[1], f_string_eol_s);
+ }
+
+ fl_print_format("%r", global.main->output.to.stream, f_string_eol_s);
+ }
+
+ fl_print_format(" }%r", global.main->output.to.stream, f_string_eol_s);
+ } // for
+
+ fl_print_format("}%r", global.main->output.to.stream, f_string_eol_s);
+ } // for
+ }
+
+ controller_unlock_print_flush(global.main->output.to, global.thread);
+ }
+#endif // _di_controller_entry_setting_validate_
+
#ifdef __cplusplus
} // extern "C"
#endif