//#define _di_f_memory_default_d_
//#define _di_f_memory_delete_
#define _di_f_memory_destroy_
+//#define _di_f_memory_increase_step_d_
//#define _di_f_memory_new_
#define _di_f_memory_new_aligned_
//#define _di_f_memory_resize_
#define _di_f_thread_unlock_
#define _di_f_time_calendar_string_
#define _di_f_time_calendar_string_part_
-#define _di_f_time_clock_get_
+//#define _di_f_time_clock_get_
#define _di_f_time_clock_precision_
#define _di_f_time_clock_set_
#define _di_f_time_d_
#define _di_f_time_of_day_set_
#define _di_f_time_part_t_
#define _di_f_time_simple_t_
-#define _di_f_time_sleep_spec_
+//#define _di_f_time_sleep_spec_
#define _di_f_time_spec_millisecond_
#define _di_f_time_spec_nanosecond_
-#define _di_f_time_spec_t_
+//#define _di_f_time_spec_t_
//#define _di_f_time_t_
#define _di_f_time_utc_get_
#define _di_f_time_value_t_
//#define _di_f_memory_default_d_
//#define _di_f_memory_delete_
#define _di_f_memory_destroy_
+//#define _di_f_memory_increase_step_d_
//#define _di_f_memory_new_
#define _di_f_memory_new_aligned_
//#define _di_f_memory_resize_
#define _di_f_time_of_day_set_
#define _di_f_time_part_t_
#define _di_f_time_simple_t_
-#define _di_f_time_sleep_spec_
+//#define _di_f_time_sleep_spec_
//#define _di_f_time_spec_millisecond_
#define _di_f_time_spec_nanosecond_
//#define _di_f_time_spec_t_
date->type |= kt_remove_flag_date_time_epoch_d;
}
else {
- struct timespec now;
- int result = 0;
-
- memset(&now, 0, sizeof(struct timespec));
-
- // The current year is used for single colon when no year is specified.
- {
- result = clock_gettime(CLOCK_REALTIME, &now);
-
- if (!result) {
- if (result == EFAULT) {
- main->setting.state.status = F_status_set_error(F_buffer);
- }
- else if (result == EINVAL) {
- main->setting.state.status = F_status_set_error(F_parameter);
- }
- else if (result == EPERM) {
- main->setting.state.status = F_status_set_error(F_prohibited);
- }
- else {
- main->setting.state.status = F_status_set_error(F_failure);
- }
+ f_time_spec_t now;
- return;
- }
- }
+ memset(&now, 0, sizeof(f_time_spec_t));
+
+ main->setting.state.status = f_time_clock_get(CLOCK_REALTIME, &now);
+ if (F_status_is_error(main->setting.state.status)) return;
date->start_year = now.tv_sec / kt_remove_time_seconds_in_year_d;
date->type |= kt_remove_flag_date_time_d;
return;
}
- struct timespec now;
-
- memset(&now, 0, sizeof(struct timespec));
+ f_time_spec_t now;
- if (clock_gettime(CLOCK_REALTIME, &now)) {
- if (errno == EFAULT) {
- main->setting.state.status = F_status_set_error(F_buffer);
- }
- else if (errno == EINVAL) {
- main->setting.state.status = F_status_set_error(F_parameter);
- }
- else if (errno == EPERM) {
- main->setting.state.status = F_status_set_error(F_prohibited);
- }
- else {
- main->setting.state.status = F_status_set_error(F_failure);
- }
+ memset(&now, 0, sizeof(f_time_spec_t));
- return;
- }
+ main->setting.state.status = f_time_clock_get(CLOCK_REALTIME, &now);
+ if (F_status_is_error(main->setting.state.status)) return;
date->start_year = kt_remove_time_year_unix_epoch_d;
date->start_second = now.tv_sec;
const uint8_t flag = kt_remove_operate_file_simulate(main, name);
if (F_status_is_error(main->setting.state.status)) return;
- // @todo needs empty check to see if directory contents are fully removed (because of removal conditions).
-
if (!(main->setting.flag & kt_remove_main_flag_simulate_d)) {
+ // @todo needs empty check to see if directory contents are fully removed (because of removal conditions).
+
if (flag & kt_remove_flag_file_operate_directory_d) {
kt_remove_operate_file_directory(main, name, flag);
if (F_status_is_error(main->setting.state.status)) return;
&main->setting.updated,
};
- struct timespec times[] = {
+ f_time_spec_t times[] = {
statistics.st_atim,
statistics.st_ctim,
statistics.st_mtim,
if (main->setting.receive.array[i].retry < kt_tacocat_startup_retry_max_d) {
kt_tacocat_print_warning_on_busy(&main->program.warning, kt_tacocat_receive_s, main->setting.receive.array[i].network, main->setting.receive.array[i].retry + 1);
- struct timespec time = { 0 };
+ f_time_spec_t time = { 0 };
main->setting.receive.array[i].status = f_time_spec_millisecond(kt_tacocat_startup_retry_delay_second_d, kt_tacocat_startup_retry_delay_millisecond_d, &time);
if (F_status_is_error_not(main->setting.receive.array[i].status)) {
- nanosleep(&time, 0);
+ f_time_sleep_spec(time, 0);
}
if (main->program.signal_received) {
if (main->setting.send.array[i].retry < kt_tacocat_startup_retry_max_d) {
kt_tacocat_print_warning_on_busy(&main->program.warning, kt_tacocat_send_s, main->setting.send.array[i].network, main->setting.send.array[i].retry + 1);
- struct timespec time = { 0 };
+ f_time_spec_t time = { 0 };
main->setting.send.array[i].status = f_time_spec_millisecond(kt_tacocat_startup_retry_delay_second_d, kt_tacocat_startup_retry_delay_millisecond_d, &time);
if (F_status_is_error_not(main->setting.send.array[i].status)) {
- nanosleep(&time, 0);
+ f_time_sleep_spec(time, 0);
}
if (main->program.signal_received) {
// Try again, but only once if blocked.
if (main->setting.state.status == F_status_set_error(F_again)) {
- {
- const struct timespec time = { .tv_sec = kt_tacocat_startup_seed_delay_second_d, .tv_nsec = kt_tacocat_startup_seed_delay_nanosecond_d };
+ const f_time_spec_t time = { .tv_sec = kt_tacocat_startup_seed_delay_second_d, .tv_nsec = kt_tacocat_startup_seed_delay_nanosecond_d };
- nanosleep(&time, 0);
- }
+ f_time_sleep_spec(time, 0);
main->setting.state.status = f_random_seed(F_random_seed_flag_block_not_d);
}