From: Kevin Day Date: Wed, 2 Apr 2025 02:11:32 +0000 (-0500) Subject: Progress: Continue working on completing the remove program. X-Git-Url: https://git.kevux.org/?a=commitdiff_plain;h=97ef5cd464f51735088127d5049191d9d972668c;p=kevux-tools Progress: Continue working on completing the remove program. Clean up the function naming. The file remove and directory remove structure is rather confusing, name-wise. Simplify the names. Now that I know how I intended to implement the callbacks, I can remove unused callbacks. This is being committed in isolation to allow for better diagnostics. I will follow this up with additional testing whose changes, if any, will be in additional commits. I still need to review existing functionality and also resolve incomplete functionality. --- diff --git a/sources/c/program/kevux/tools/remove/main/common/type.h b/sources/c/program/kevux/tools/remove/main/common/type.h index 0bacbea..aef6031 100644 --- a/sources/c/program/kevux/tools/remove/main/common/type.h +++ b/sources/c/program/kevux/tools/remove/main/common/type.h @@ -172,24 +172,19 @@ extern "C" { /** * The main program callbacks. * - * print_help: Print help. - * process_normal: Process normally (data from parameters and files). - * process_operate_directory: Process an individual directory, returning F_done to designate handled, and F_okay for letting parent continue handling. - * process_operate_file: Process an individual file, returning F_done to designate handled, and F_okay for letting parent continue handling. - * process_operate_file_simulate: Simulate process of an individual file, returning F_done to designate handled, and F_okay for letting parent continue handling. + * print_help: Print help. + * process_normal: Process normally (data from parameters and files). + * process_remove: Process actual removal, returning F_done to designate handled, and F_okay for letting parent continue handling. */ #ifndef _di_kt_remove_callback_t_ typedef f_status_t (*print_help_call_t)(fl_print_t * const print, const f_color_context_t context); typedef void (*process_normal_call_t)(kt_remove_main_t * const main); - typedef f_status_t (*process_operate_file_call_t)(kt_remove_main_t * const main, const f_string_static_t path, const uint32_t flag_operate); - typedef void (*process_operate_file_simulate_call_t)(kt_remove_main_t * const main, const f_string_static_t path, const struct stat statistics, const uint32_t flag_operate, uint32_t * const flag_out); + typedef f_status_t (*process_remove_call_t)(kt_remove_main_t * const main, const f_string_static_t path, const uint32_t flag_operate); typedef struct { print_help_call_t print_help; process_normal_call_t process_normal; - process_operate_file_call_t process_operate_directory; - process_operate_file_call_t process_operate_file; - process_operate_file_simulate_call_t process_operate_file_simulate; + process_remove_call_t process_remove; } kt_remove_callback_t; #define kt_remove_callback_t_initialize \ @@ -197,8 +192,6 @@ extern "C" { 0, \ 0, \ 0, \ - 0, \ - 0, \ } #endif // _di_kt_remove_callback_t_ diff --git a/sources/c/program/kevux/tools/remove/main/operate.c b/sources/c/program/kevux/tools/remove/main/operate.c index c8bc445..9ce6796 100644 --- a/sources/c/program/kevux/tools/remove/main/operate.c +++ b/sources/c/program/kevux/tools/remove/main/operate.c @@ -4,6 +4,38 @@ extern "C" { #endif +// @fixme nothing is calling this. recurrsion is needed!? +#ifndef _di_kt_remove_operate_directory_ + f_status_t kt_remove_operate_directory(kt_remove_main_t * const main, const f_string_static_t path, const uint32_t flag_operate) { + + if (!kt_remove_operate_shall_remove(flag_operate)) return (flag_operate & kt_remove_flag_file_operate_remove_fail_d) ? F_status_set_error(F_no) : F_no; + + f_directory_recurse_do_t recurse = f_directory_recurse_do_t_initialize; + + // The recurse.state.code flags represent the top-level directory being recursed on. + recurse.state.code = flag_operate; + recurse.state.custom = (void *) main; + recurse.state.interrupt = &kt_remove_signal_check_recurse; + + recurse.depth_max = main->setting.flag & kt_remove_main_flag_recurse_d ? kt_remove_depth_max_d : 0; + recurse.flag = main->setting.flag & kt_remove_main_flag_recurse_d ? f_directory_recurse_do_flag_top_after_e : 0; + recurse.path_top = &path; + + recurse.action = &kt_remove_operate_recurse_action; + recurse.handle = &kt_remove_operate_recurse_handle; + + fl_directory_do(path, &recurse); + + const f_status_t status = f_directory_recurse_do_delete(&recurse); + + return F_status_is_error(recurse.state.status) + ? recurse.state.status + : F_status_is_error(status) + ? status + : F_yes; + } +#endif // _di_kt_remove_operate_directory_ + #ifndef _di_kt_remove_operate_file_ void kt_remove_operate_file(kt_remove_main_t * const main, const f_string_static_t path) { @@ -39,20 +71,18 @@ extern "C" { main->setting.state.status = F_okay; if (flag_operate & kt_remove_flag_file_operate_directory_d) { - if (main->call.process_operate_directory) { - status = main->setting.state.status = main->call.process_operate_directory(main, path, flag_operate); - } + status = main->setting.state.status = kt_remove_operate_directory(main, path, flag_operate); } else { - if (main->call.process_operate_file) { - status = main->setting.state.status = main->call.process_operate_file(main, path, flag_operate); - } - } + if (main->call.process_remove) { + status = main->setting.state.status = main->call.process_remove(main, path, flag_operate); - if (status == F_done) { - main->setting.state.status = F_okay; + if (status == F_done) { + main->setting.state.status = F_okay; - return; + return; + } + } } } } @@ -73,73 +103,6 @@ extern "C" { } #endif // _di_kt_remove_operate_file_ -#ifndef _di_kt_remove_operate_file_directory_ - f_status_t kt_remove_operate_file_directory(kt_remove_main_t * const main, const f_string_static_t path, const uint32_t flag_operate) { - - if (!kt_remove_operate_shall_remove(flag_operate)) return (flag_operate & kt_remove_flag_file_operate_remove_fail_d) ? F_status_set_error(F_no) : F_no; - - f_directory_recurse_do_t recurse = f_directory_recurse_do_t_initialize; - - // The recurse.state.code flags represent the top-level directory being recursed on. - recurse.state.code = flag_operate; - recurse.state.custom = (void *) main; - recurse.state.interrupt = &kt_remove_signal_check_recurse; - - recurse.depth_max = main->setting.flag & kt_remove_main_flag_recurse_d ? kt_remove_depth_max_d : 0; - recurse.flag = main->setting.flag & kt_remove_main_flag_recurse_d ? f_directory_recurse_do_flag_top_after_e : 0; - recurse.path_top = &path; - - recurse.action = &kt_remove_operate_file_directory_action; - recurse.handle = &kt_remove_operate_file_recurse_handle; - - fl_directory_do(path, &recurse); - - const f_status_t status = f_directory_recurse_do_delete(&recurse); - - return F_status_is_error(recurse.state.status) - ? recurse.state.status - : F_status_is_error(status) - ? status - : F_yes; - } -#endif // _di_kt_remove_operate_file_directory_ - -#ifndef _di_kt_remove_operate_file_directory_action_ - void kt_remove_operate_file_directory_action(f_directory_recurse_do_t * const recurse, const f_string_static_t name, const uint32_t flag) { - - if (!recurse || !recurse->state.custom || F_status_set_fine(recurse->state.status) == F_interrupt) return; - if (!kt_remove_operate_shall_remove(recurse->state.code) || !(flag & f_directory_recurse_do_flag_action_e)) return; - - const f_string_static_t path = flag & f_directory_recurse_do_flag_top_after_e - ? recurse->path_top - ? *recurse->path_top - : f_string_null_s - : recurse->path; - - kt_remove_main_t * const main = (kt_remove_main_t *) recurse->state.custom; - - if (main->call.process_operate_file) { - recurse->state.status = F_okay; - - recurse->state.status = main->call.process_operate_file( - main, - path, - flag & f_directory_recurse_do_flag_top_after_e - ? recurse->state.code - : flag & f_directory_recurse_do_flag_directory_e - ? (recurse->state.code | kt_remove_flag_file_operate_child_d | kt_remove_flag_file_operate_directory_d) & ~kt_remove_flag_file_operate_parent_d - : (recurse->state.code | kt_remove_flag_file_operate_child_d) & ~kt_remove_flag_file_operate_directory_parent_d - ); - - if (recurse->state.status == F_done) { - recurse->state.status = F_okay; - - return; - } - } - } -#endif // _di_kt_remove_operate_file_directory_action_ - #ifndef _di_kt_remove_operate_file_parent_ void kt_remove_operate_file_parent(kt_remove_main_t * const main, const f_string_static_t path) { @@ -158,10 +121,10 @@ extern "C" { if (!kt_remove_operate_shall_remove(flag_operate) || (main->setting.flag & kt_remove_main_flag_simulate_d)) return; if (F_status_is_error_not(main->setting.state.status) && !(flag_operate & kt_remove_flag_file_operate_processed_d)) { - if (main->call.process_operate_file) { + if (main->call.process_remove) { main->setting.state.status = F_okay; - main->setting.state.status = main->call.process_operate_file(main, path, flag_operate); + main->setting.state.status = main->call.process_remove(main, path, flag_operate); if (F_status_is_error(main->setting.state.status)) return; if (main->setting.state.status == F_done) { @@ -285,103 +248,6 @@ extern "C" { } #endif // _di_kt_remove_operate_file_prompt_ -#ifndef _di_kt_remove_operate_file_recurse_handle_ - void kt_remove_operate_file_recurse_handle(f_directory_recurse_do_t * const recurse, const f_string_static_t name, const uint32_t flag) { - - if (!recurse || !recurse->state.custom || F_status_set_fine(recurse->state.status) == F_interrupt) return; - - kt_remove_main_t * const main = (kt_remove_main_t *) recurse->state.custom; - - // Arguments to fl_recurse_do() are invalid (parameter checking). - if (flag == f_directory_recurse_do_flag_top_e) { - kt_remove_print_error_status(&main->program.error, macro_kt_remove_f(fl_recurse_do), recurse->state.status); - - return; - } - - if (flag & f_directory_recurse_do_flag_list_e && recurse->state.status == F_status_set_error(F_recurse)) { - recurse->state.status = F_status_set_error(F_directory_empty_not); - - kt_remove_print_error_file_status(&main->program.error, macro_kt_remove_f(fl_recurse_do), flag & f_directory_recurse_do_flag_top_after_e ? *recurse->path_top : recurse->path, f_file_operation_delete_s, fll_error_file_type_directory_e, recurse->state.status); - - return; - } - - // The top-level path is an empty string or an error occurred while processing the top-level path. - if (flag == (f_directory_recurse_do_flag_top_e | f_directory_recurse_do_flag_path_e) || flag == (f_directory_recurse_do_flag_top_e | f_directory_recurse_do_flag_path_e | f_directory_recurse_do_flag_before_e)) { - kt_remove_print_error_file_status(&main->program.error, macro_kt_remove_f(fl_recurse_do), flag & f_directory_recurse_do_flag_top_after_e ? *recurse->path_top : recurse->path, f_file_operation_stat_s, fll_error_file_type_path_e, recurse->state.status); - - return; - } - - // An error happened during directory list loading. - if (flag == (f_directory_recurse_do_flag_list_e | f_directory_recurse_do_flag_path_e)) { - kt_remove_print_error_file_status(&main->program.error, macro_kt_remove_f(fl_recurse_do), flag & f_directory_recurse_do_flag_top_after_e ? *recurse->path_top : recurse->path, f_file_operation_list_s, fll_error_file_type_directory_e, recurse->state.status); - - return; - } - } -#endif // _di_kt_remove_operate_file_recurse_handle_ - -#ifndef _di_kt_remove_operate_file_remove_ - f_status_t kt_remove_operate_file_remove(kt_remove_main_t * const main, const f_string_static_t path, const uint32_t flag_operate) { - - if (!main) return F_status_set_error(F_parameter); - if (!kt_remove_operate_shall_remove(flag_operate)) return (flag_operate & kt_remove_flag_file_operate_remove_fail_d) ? F_status_set_error(F_no) : F_no; - - kt_remove_print_debug_operate_file_remove(&main->program.output, path, flag_operate); - - f_status_t status = F_no; - - if (flag_operate & kt_remove_flag_file_operate_follow_d) { - main->cache.buffer.used = 0; - - status = f_file_link_read(path, F_false, &main->cache.buffer); - - if (F_status_is_error(status)) { - kt_remove_print_error_file(&main->program.error, macro_kt_remove_f(f_file_remove), path, f_file_operation_stat_s, fll_error_file_type_link_e); - - return status; - } - } - - status = flag_operate & kt_remove_flag_file_operate_directory_d - ? f_directory_remove((flag_operate & kt_remove_flag_file_operate_follow_d) ? main->cache.buffer : path, (flag_operate & kt_remove_flag_file_operate_recurse_d) ? kt_remove_depth_max_d : 0, F_false) - : f_file_remove((flag_operate & kt_remove_flag_file_operate_follow_d) ? main->cache.buffer : path); - - if (F_status_is_error(status)) { - if (F_status_set_fine(status) == F_directory_empty_not && (flag_operate & kt_remove_flag_file_operate_remove_not_d)) { - status = F_no; - } - else { - kt_remove_print_error_file_status( - &main->program.error, - flag_operate & kt_remove_flag_file_operate_directory_d - ? macro_kt_remove_f(f_directory_remove) - : macro_kt_remove_f(f_file_remove), - flag_operate & kt_remove_flag_file_operate_follow_d - ? main->cache.buffer - : path, - f_file_operation_delete_s, - flag_operate & kt_remove_flag_file_operate_directory_d - ? fll_error_file_type_directory_e - : fll_error_file_type_file_e, - status - ); - } - } - else { - status = F_yes; - } - - if (status == F_yes) { - kt_remove_print_verbose_operate_file_remove(&main->program.output, path, flag_operate); - } - - return status; - } -#endif // _di_kt_remove_operate_file_remove_ - #ifndef _di_kt_remove_operate_memory_check_ void kt_remove_operate_memory_check(kt_remove_main_t * const main, const f_string_static_t path, uint32_t * const flag_operate) { @@ -513,6 +379,139 @@ extern "C" { } #endif // _di_kt_remove_operate_memory_save_ +#ifndef _di_kt_remove_operate_recurse_action_ + void kt_remove_operate_recurse_action(f_directory_recurse_do_t * const recurse, const f_string_static_t name, const uint32_t flag) { + + if (!recurse || !recurse->state.custom || F_status_set_fine(recurse->state.status) == F_interrupt) return; + if (!kt_remove_operate_shall_remove(recurse->state.code) || !(flag & f_directory_recurse_do_flag_action_e)) return; + + const f_string_static_t path = flag & f_directory_recurse_do_flag_top_after_e + ? recurse->path_top + ? *recurse->path_top + : f_string_null_s + : recurse->path; + + kt_remove_main_t * const main = (kt_remove_main_t *) recurse->state.custom; + + if (main->call.process_remove) { + recurse->state.status = F_okay; + + recurse->state.status = main->call.process_remove( + main, + path, + flag & f_directory_recurse_do_flag_top_after_e + ? recurse->state.code + : flag & f_directory_recurse_do_flag_directory_e + ? (recurse->state.code | kt_remove_flag_file_operate_child_d | kt_remove_flag_file_operate_directory_d) & ~kt_remove_flag_file_operate_parent_d + : (recurse->state.code | kt_remove_flag_file_operate_child_d) & ~kt_remove_flag_file_operate_directory_parent_d + ); + + if (recurse->state.status == F_done) { + recurse->state.status = F_okay; + + return; + } + } + } +#endif // _di_kt_remove_operate_recurse_action_ + +#ifndef _di_kt_remove_operate_recurse_handle_ + void kt_remove_operate_recurse_handle(f_directory_recurse_do_t * const recurse, const f_string_static_t name, const uint32_t flag) { + + if (!recurse || !recurse->state.custom || F_status_set_fine(recurse->state.status) == F_interrupt) return; + + kt_remove_main_t * const main = (kt_remove_main_t *) recurse->state.custom; + + // Arguments to fl_recurse_do() are invalid (parameter checking). + if (flag == f_directory_recurse_do_flag_top_e) { + kt_remove_print_error_status(&main->program.error, macro_kt_remove_f(fl_recurse_do), recurse->state.status); + + return; + } + + if (flag & f_directory_recurse_do_flag_list_e && recurse->state.status == F_status_set_error(F_recurse)) { + recurse->state.status = F_status_set_error(F_directory_empty_not); + + kt_remove_print_error_file_status(&main->program.error, macro_kt_remove_f(fl_recurse_do), flag & f_directory_recurse_do_flag_top_after_e ? *recurse->path_top : recurse->path, f_file_operation_delete_s, fll_error_file_type_directory_e, recurse->state.status); + + return; + } + + // The top-level path is an empty string or an error occurred while processing the top-level path. + if (flag == (f_directory_recurse_do_flag_top_e | f_directory_recurse_do_flag_path_e) || flag == (f_directory_recurse_do_flag_top_e | f_directory_recurse_do_flag_path_e | f_directory_recurse_do_flag_before_e)) { + kt_remove_print_error_file_status(&main->program.error, macro_kt_remove_f(fl_recurse_do), flag & f_directory_recurse_do_flag_top_after_e ? *recurse->path_top : recurse->path, f_file_operation_stat_s, fll_error_file_type_path_e, recurse->state.status); + + return; + } + + // An error happened during directory list loading. + if (flag == (f_directory_recurse_do_flag_list_e | f_directory_recurse_do_flag_path_e)) { + kt_remove_print_error_file_status(&main->program.error, macro_kt_remove_f(fl_recurse_do), flag & f_directory_recurse_do_flag_top_after_e ? *recurse->path_top : recurse->path, f_file_operation_list_s, fll_error_file_type_directory_e, recurse->state.status); + + return; + } + } +#endif // _di_kt_remove_operate_recurse_handle_ + +#ifndef _di_kt_remove_operate_remove_ + f_status_t kt_remove_operate_remove(kt_remove_main_t * const main, const f_string_static_t path, const uint32_t flag_operate) { + + if (!main) return F_status_set_error(F_parameter); + if (!kt_remove_operate_shall_remove(flag_operate)) return (flag_operate & kt_remove_flag_file_operate_remove_fail_d) ? F_status_set_error(F_no) : F_no; + + kt_remove_print_debug_operate_file_remove(&main->program.output, path, flag_operate); + + f_status_t status = F_no; + + if (flag_operate & kt_remove_flag_file_operate_follow_d) { + main->cache.buffer.used = 0; + + status = f_file_link_read(path, F_false, &main->cache.buffer); + + if (F_status_is_error(status)) { + kt_remove_print_error_file(&main->program.error, macro_kt_remove_f(f_file_remove), path, f_file_operation_stat_s, fll_error_file_type_link_e); + + return status; + } + } + + status = flag_operate & kt_remove_flag_file_operate_directory_d + ? f_directory_remove((flag_operate & kt_remove_flag_file_operate_follow_d) ? main->cache.buffer : path, (flag_operate & kt_remove_flag_file_operate_recurse_d) ? kt_remove_depth_max_d : 0, F_false) + : f_file_remove((flag_operate & kt_remove_flag_file_operate_follow_d) ? main->cache.buffer : path); + + if (F_status_is_error(status)) { + if (F_status_set_fine(status) == F_directory_empty_not && (flag_operate & kt_remove_flag_file_operate_remove_not_d)) { + status = F_no; + } + else { + kt_remove_print_error_file_status( + &main->program.error, + flag_operate & kt_remove_flag_file_operate_directory_d + ? macro_kt_remove_f(f_directory_remove) + : macro_kt_remove_f(f_file_remove), + flag_operate & kt_remove_flag_file_operate_follow_d + ? main->cache.buffer + : path, + f_file_operation_delete_s, + flag_operate & kt_remove_flag_file_operate_directory_d + ? fll_error_file_type_directory_e + : fll_error_file_type_file_e, + status + ); + } + } + else { + status = F_yes; + } + + if (status == F_yes) { + kt_remove_print_verbose_operate_file_remove(&main->program.output, path, flag_operate); + } + + return status; + } +#endif // _di_kt_remove_operate_remove_ + #ifndef _di_kt_remove_operate_shall_remove_ f_status_t kt_remove_operate_shall_remove(const uint32_t flag) { diff --git a/sources/c/program/kevux/tools/remove/main/operate.h b/sources/c/program/kevux/tools/remove/main/operate.h index 49ae41a..6043de6 100644 --- a/sources/c/program/kevux/tools/remove/main/operate.h +++ b/sources/c/program/kevux/tools/remove/main/operate.h @@ -13,41 +13,6 @@ extern "C" { #endif /** - * Operate on a single file. - * - * @param main - * The main program and settings data. - * - * Must not be NULL. - * - * This alters main.setting.state.status: - * F_no on success and not removed. - * F_data_not on success but path is an empty string. - * - * Success from: kt_remove_operate_file_directory() - * Success from: kt_remove_operate_file_remove() - * - * Errors (with error bit) from: kt_remove_operate_file_directory(). - * Errors (with error bit) from: kt_remove_operate_file_remove(). - * Errors (with error bit) from: kt_remove_operate_memory_save(). - * Errors (with error bit) from: kt_remove_preprocess_file(). - * @param path - * The path to the file to operate on. - * - * This should always be TRUE when calling from the top level. - * This should always be FALSE if calling from within a fl_directory_do() callback. - * This is because fl_directory_do() handles directory traversal and processing. - * - * @see kt_remove_operate_file_directory() - * @see kt_remove_operate_file_remove() - * @see kt_remove_operate_memory_save() - * @see kt_remove_preprocess_file() - */ -#ifndef _di_kt_remove_operate_file_ - extern void kt_remove_operate_file(kt_remove_main_t * const main, const f_string_static_t path); -#endif // _di_kt_remove_operate_file_ - -/** * Perform actual file removal for directory files. * * @param main @@ -76,30 +41,44 @@ extern "C" { * @see f_file_remove() * @see fl_directory_do() */ -#ifndef _di_kt_remove_operate_file_directory_ - extern f_status_t kt_remove_operate_file_directory(kt_remove_main_t * const main, const f_string_static_t path, const uint32_t flag_operate); -#endif // _di_kt_remove_operate_file_directory_ +#ifndef _di_kt_remove_operate_directory_ + extern f_status_t kt_remove_operate_directory(kt_remove_main_t * const main, const f_string_static_t path, const uint32_t flag_operate); +#endif // _di_kt_remove_operate_directory_ /** - * Perform directory recurse for a single file operation action. + * Operate on a single file. * - * @param recurse - * The directory recurse data. + * @param main + * The main program and settings data. * * Must not be NULL. - * @param name - * The name of the file or directory the action is being performed on. - * Does not have the parent directory path. - * May be empty at the top level. - * @param flag - * A flag representing the particular directory action being performed. * - * @see f_directory_remove() - * @see fl_directory_do() + * This alters main.setting.state.status: + * F_no on success and not removed. + * F_data_not on success but path is an empty string. + * + * Success from: kt_remove_operate_directory() + * Success from: kt_remove_operate_remove() + * + * Errors (with error bit) from: kt_remove_operate_directory(). + * Errors (with error bit) from: kt_remove_operate_memory_save(). + * Errors (with error bit) from: kt_remove_operate_remove(). + * Errors (with error bit) from: kt_remove_preprocess_file(). + * @param path + * The path to the file to operate on. + * + * This should always be TRUE when calling from the top level. + * This should always be FALSE if calling from within a fl_directory_do() callback. + * This is because fl_directory_do() handles directory traversal and processing. + * + * @see kt_remove_operate_directory() + * @see kt_remove_operate_memory_save() + * @see kt_remove_operate_remove() + * @see kt_remove_preprocess_file() */ -#ifndef _di_kt_remove_operate_file_directory_action_ - extern void kt_remove_operate_file_directory_action(f_directory_recurse_do_t * const recurse, const f_string_static_t name, const uint32_t flag); -#endif // _di_kt_remove_operate_file_directory_action_ +#ifndef _di_kt_remove_operate_file_ + extern void kt_remove_operate_file(kt_remove_main_t * const main, const f_string_static_t path); +#endif // _di_kt_remove_operate_file_ /** * Operate on a single parent directory (from the tree array). @@ -115,8 +94,8 @@ extern "C" { * * F_no (with error bit set) on file not removed due to failure. * - * Errors (with error bit) from: kt_remove_operate_file_remove(). * Errors (with error bit) from: kt_remove_operate_memory_save(). + * Errors (with error bit) from: kt_remove_operate_remove(). * Errors (with error bit) from: kt_remove_preprocess_file(). * @param path * The path to the file to operate on. @@ -125,8 +104,8 @@ extern "C" { * This should always be FALSE if calling from within a fl_directory_do() callback. * This is because fl_directory_do() handles directory traversal and processing. * - * @see kt_remove_operate_file_remove() * @see kt_remove_operate_memory_save() + * @see kt_remove_operate_remove() * @see kt_remove_preprocess_file() */ #ifndef _di_kt_remove_operate_file_parent_ @@ -155,58 +134,6 @@ extern "C" { #endif // _di_kt_remove_operate_file_prompt_ /** - * Handle errors while performing directory recurse for a single file operation action. - * - * @param recurse - * The directory recurse data. - * - * Must not be NULL. - * @param name - * The name of the file or directory the action is being performed on. - * Does not have the parent directory path. - * May be empty at the top level. - * @param flag - * A flag representing the particular directory action being performed. - * - * @see fl_directory_do() - */ -#ifndef _di_kt_remove_operate_file_recurse_handle_ - extern void kt_remove_operate_file_recurse_handle(f_directory_recurse_do_t * const recurse, const f_string_static_t name, const uint32_t flag); -#endif // _di_kt_remove_operate_file_recurse_handle_ - -/** - * Perform actual file removal for non-directory files. - * - * This returns status rather than altering the main.setting.state.status so that it can safely be called within recursive functions. - * - * @param main - * The main program and settings data. - * - * Must not be NULL. - * - * This does not alter main.setting.state.status. - * @param path - * The path to the file to operate on. - * @param flag_operate - * The operate file specific flags from kt_remove_flag_file_operate_*_e. - * - * @return - * F_no on success but file is not to be removed. - * F_yes on success and file is removed. - * - * F_no (with error bit) on failure and file is not to be removed or cannot be removed. - * - * Errors (with error bit) from: f_file_link_read(). - * Errors (with error bit) from: f_file_remove(). - * - * @see f_file_link_read() - * @see f_file_remove() - */ -#ifndef _di_kt_remove_operate_file_remove_ - extern f_status_t kt_remove_operate_file_remove(kt_remove_main_t * const main, const f_string_static_t path, const uint32_t flag_operate); -#endif // _di_kt_remove_operate_file_remove_ - -/** * Check if a file should be skipped based on the memory. * * If memory is disabled, then this should always return F_okay. @@ -261,6 +188,79 @@ extern "C" { #endif // _di_kt_remove_operate_memory_save_ /** + * Perform directory recurse for a single file operation action. + * + * @param recurse + * The directory recurse data. + * + * Must not be NULL. + * @param name + * The name of the file or directory the action is being performed on. + * Does not have the parent directory path. + * May be empty at the top level. + * @param flag + * A flag representing the particular directory action being performed. + * + * @see f_directory_remove() + * @see fl_directory_do() + */ +#ifndef _di_kt_remove_operate_recurse_action_ + extern void kt_remove_operate_recurse_action(f_directory_recurse_do_t * const recurse, const f_string_static_t name, const uint32_t flag); +#endif // _di_kt_remove_operate_recurse_action_ + +/** + * Handle errors while performing directory recurse for a single file operation action. + * + * @param recurse + * The directory recurse data. + * + * Must not be NULL. + * @param name + * The name of the file or directory the action is being performed on. + * Does not have the parent directory path. + * May be empty at the top level. + * @param flag + * A flag representing the particular directory action being performed. + * + * @see fl_directory_do() + */ +#ifndef _di_kt_remove_operate_recurse_handle_ + extern void kt_remove_operate_recurse_handle(f_directory_recurse_do_t * const recurse, const f_string_static_t name, const uint32_t flag); +#endif // _di_kt_remove_operate_recurse_handle_ + +/** + * Perform actual file removal (directory, regular, and any other type of files). + * + * This returns status rather than altering the main.setting.state.status so that it can safely be called within recursive functions. + * + * @param main + * The main program and settings data. + * + * Must not be NULL. + * + * This does not alter main.setting.state.status. + * @param path + * The path to the file to operate on. + * @param flag_operate + * The operate file specific flags from kt_remove_flag_file_operate_*_e. + * + * @return + * F_no on success but file is not to be removed. + * F_yes on success and file is removed. + * + * F_no (with error bit) on failure and file is not to be removed or cannot be removed. + * + * Errors (with error bit) from: f_file_link_read(). + * Errors (with error bit) from: f_file_remove(). + * + * @see f_file_link_read() + * @see f_file_remove() + */ +#ifndef _di_kt_remove_operate_remove_ + extern f_status_t kt_remove_operate_remove(kt_remove_main_t * const main, const f_string_static_t path, const uint32_t flag_operate); +#endif // _di_kt_remove_operate_remove_ + +/** * Determine whether or not a file shall be removed based on the given flag. * * @param flag diff --git a/sources/c/program/kevux/tools/remove/main/preprocess.c b/sources/c/program/kevux/tools/remove/main/preprocess.c index 8d6151f..55d5dcb 100644 --- a/sources/c/program/kevux/tools/remove/main/preprocess.c +++ b/sources/c/program/kevux/tools/remove/main/preprocess.c @@ -321,19 +321,6 @@ extern "C" { kt_remove_print_simulate_operate_boolean(&main->program.output, kt_remove_remove_s, kt_remove_operate_shall_remove(flag_out)); - if (main->call.process_operate_file_simulate) { - main->setting.state.status = F_okay; - - main->call.process_operate_file_simulate(main, path, statistics, flag_operate, &flag_out); - if (F_status_is_error(main->setting.state.status)) return flag_out; - - if (main->setting.state.status == F_done) { - main->setting.state.status = F_okay; - - return flag_out; - } - } - // Only apply tree operations on non-child paths when the tree flag is set. if ((main->setting.flag & kt_remove_main_flag_tree_d) && !(flag_operate & kt_remove_flag_file_operate_child_d)) { f_range_t range = macro_f_range_t_initialize_2(path.used); @@ -413,8 +400,8 @@ extern "C" { recurse.flag = 0; recurse.path_top = &path; - recurse.action = &kt_remove_preprocess_file_recurse_action; - recurse.handle = &kt_remove_operate_file_recurse_handle; + recurse.action = &kt_remove_preprocess_recurse_action; + recurse.handle = &kt_remove_operate_recurse_handle; fl_directory_do(path, &recurse); @@ -428,23 +415,6 @@ extern "C" { } #endif // _di_kt_remove_preprocess_file_recurse_ -#ifndef _di_kt_remove_preprocess_file_recurse_action_ - void kt_remove_preprocess_file_recurse_action(f_directory_recurse_do_t * const recurse, const f_string_static_t name, const uint32_t flag) { - - if (!recurse || !recurse->state.custom || F_status_set_fine(recurse->state.status) == F_interrupt) return; - - if (flag & f_directory_recurse_do_flag_action_e) { - kt_remove_preprocess_file( - (kt_remove_main_t *) recurse->state.custom, - recurse->path, - flag & f_directory_recurse_do_flag_directory_e - ? (recurse->state.code | kt_remove_flag_file_operate_child_d | kt_remove_flag_file_operate_directory_d) & ~kt_remove_flag_file_operate_parent_d - : (recurse->state.code | kt_remove_flag_file_operate_child_d) & ~kt_remove_flag_file_operate_directory_parent_d - ); - } - } -#endif // _di_kt_remove_preprocess_file_recurse_action_ - #ifndef _di_kt_remove_preprocess_file_dates_ void kt_remove_preprocess_file_dates(kt_remove_main_t * const main, const f_string_static_t path, const uint32_t flag_operate, const struct stat statistics) { @@ -703,6 +673,23 @@ extern "C" { } #endif // _di_kt_remove_preprocess_file_dates_ +#ifndef _di_kt_remove_preprocess_recurse_action_ + void kt_remove_preprocess_recurse_action(f_directory_recurse_do_t * const recurse, const f_string_static_t name, const uint32_t flag) { + + if (!recurse || !recurse->state.custom || F_status_set_fine(recurse->state.status) == F_interrupt) return; + + if (flag & f_directory_recurse_do_flag_action_e) { + kt_remove_preprocess_file( + (kt_remove_main_t *) recurse->state.custom, + recurse->path, + flag & f_directory_recurse_do_flag_directory_e + ? (recurse->state.code | kt_remove_flag_file_operate_child_d | kt_remove_flag_file_operate_directory_d) & ~kt_remove_flag_file_operate_parent_d + : (recurse->state.code | kt_remove_flag_file_operate_child_d) & ~kt_remove_flag_file_operate_directory_parent_d + ); + } + } +#endif // _di_kt_remove_preprocess_recurse_action_ + #ifdef __cplusplus } // extern "C" #endif diff --git a/sources/c/program/kevux/tools/remove/main/preprocess.h b/sources/c/program/kevux/tools/remove/main/preprocess.h index 9be074f..394f811 100644 --- a/sources/c/program/kevux/tools/remove/main/preprocess.h +++ b/sources/c/program/kevux/tools/remove/main/preprocess.h @@ -80,27 +80,6 @@ extern "C" { #endif // _di_kt_remove_preprocess_file_recurse_ /** - * Perform directory recursion for a single file operation action. - * - * @param recurse - * The directory recurse data. - * - * Must not be NULL. - * @param name - * The name of the file or directory the action is being performed on. - * Does not have the parent directory path. - * May be empty at the top level. - * @param flag - * A flag representing the particular directory action being performed. - * - * @see f_directory_remove() - * @see fl_directory_do() - */ -#ifndef _di_kt_remove_preprocess_file_recurse_action_ - extern void kt_remove_preprocess_file_recurse_action(f_directory_recurse_do_t * const recurse, const f_string_static_t name, const uint32_t flag); -#endif // _di_kt_remove_preprocess_file_recurse_action_ - -/** * Perform pre-processing (including simulation) of the file operation, specifically handling dates. * * @param main @@ -123,6 +102,27 @@ extern "C" { extern void kt_remove_preprocess_file_dates(kt_remove_main_t * const main, const f_string_static_t path, const uint32_t flag_operate, const struct stat statistics); #endif // _di_kt_remove_preprocess_file_dates_ +/** + * Perform directory recursion for a single file operation action. + * + * @param recurse + * The directory recurse data. + * + * Must not be NULL. + * @param name + * The name of the file or directory the action is being performed on. + * Does not have the parent directory path. + * May be empty at the top level. + * @param flag + * A flag representing the particular directory action being performed. + * + * @see f_directory_remove() + * @see fl_directory_do() + */ +#ifndef _di_kt_remove_preprocess_recurse_action_ + extern void kt_remove_preprocess_recurse_action(f_directory_recurse_do_t * const recurse, const f_string_static_t name, const uint32_t flag); +#endif // _di_kt_remove_preprocess_recurse_action_ + #ifdef __cplusplus } // extern "C" #endif diff --git a/sources/c/program/kevux/tools/remove/main/remove.c b/sources/c/program/kevux/tools/remove/main/remove.c index ef4ad10..f9dd16b 100644 --- a/sources/c/program/kevux/tools/remove/main/remove.c +++ b/sources/c/program/kevux/tools/remove/main/remove.c @@ -41,8 +41,8 @@ extern "C" { } #endif // _di_kt_remove_main_ -#ifndef _di_kt_remove_process_normal_operate_ - void kt_remove_process_normal_operate(kt_remove_main_t * const main) { +#ifndef _di_kt_remove_normal_operate_ + void kt_remove_normal_operate(kt_remove_main_t * const main) { if (!main) return; @@ -96,7 +96,7 @@ extern "C" { } // for } } -#endif // _di_kt_remove_process_normal_operate_ +#endif // _di_kt_remove_normal_operate_ #ifdef __cplusplus } // extern "C" diff --git a/sources/c/program/kevux/tools/remove/main/remove.h b/sources/c/program/kevux/tools/remove/main/remove.h index 0abae11..6248e61 100644 --- a/sources/c/program/kevux/tools/remove/main/remove.h +++ b/sources/c/program/kevux/tools/remove/main/remove.h @@ -112,9 +112,9 @@ extern "C" { * This alters main.setting.state.status: * F_okay on success. */ -#ifndef _di_kt_remove_process_normal_operate_ - extern void kt_remove_process_normal_operate(kt_remove_main_t * const main); -#endif // _di_kt_remove_process_normal_operate_ +#ifndef _di_kt_remove_normal_operate_ + extern void kt_remove_normal_operate(kt_remove_main_t * const main); +#endif // _di_kt_remove_normal_operate_ #ifdef __cplusplus } // extern "C" diff --git a/sources/c/program/kevux/tools/remove/remove/main.c b/sources/c/program/kevux/tools/remove/remove/main.c index 23bbde3..fee2e6e 100644 --- a/sources/c/program/kevux/tools/remove/remove/main.c +++ b/sources/c/program/kevux/tools/remove/remove/main.c @@ -31,9 +31,8 @@ int data.setting.program_name_long = &kt_remove_program_name_long_s; data.call.print_help = &kt_remove_print_message_help; - data.call.process_normal = &kt_remove_process_normal_operate; - data.call.process_operate_directory = &kt_remove_operate_file_directory; - data.call.process_operate_file = &kt_remove_operate_file_remove; + data.call.process_normal = &kt_remove_normal_operate; + data.call.process_remove = &kt_remove_operate_remove; #ifdef _en_kt_default_to_utc_ data.setting.flag |= kt_remove_flag_utc_d; diff --git a/sources/c/program/kevux/tools/remove/rm/main.c b/sources/c/program/kevux/tools/remove/rm/main.c index 29b0f9d..d48f147 100644 --- a/sources/c/program/kevux/tools/remove/rm/main.c +++ b/sources/c/program/kevux/tools/remove/rm/main.c @@ -25,9 +25,8 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) { data.setting.program_name_long = &kt_remove_program_name_long_s; data.call.print_help = &kt_remove_rm_print_message_help; - data.call.process_normal = &kt_remove_process_normal_operate; - data.call.process_operate_directory = &kt_remove_rm_operate_file_remove; - data.call.process_operate_file = &kt_remove_rm_operate_file_remove; + data.call.process_normal = &kt_remove_normal_operate; + data.call.process_remove = &kt_remove_rm_operate_remove; #ifdef _en_kt_default_to_utc_ data.setting.flag |= kt_remove_flag_utc_d; diff --git a/sources/c/program/kevux/tools/remove/rm/rm.c b/sources/c/program/kevux/tools/remove/rm/rm.c index 085875c..138fe5c 100644 --- a/sources/c/program/kevux/tools/remove/rm/rm.c +++ b/sources/c/program/kevux/tools/remove/rm/rm.c @@ -4,8 +4,8 @@ extern "C" { #endif -#ifndef _di_kt_remove_rm_operate_file_remove_ - f_status_t kt_remove_rm_operate_file_remove(kt_remove_main_t * const main, const f_string_static_t path, const uint32_t flag_operate) { +#ifndef _di_kt_remove_rm_operate_remove_ + f_status_t kt_remove_rm_operate_remove(kt_remove_main_t * const main, const f_string_static_t path, const uint32_t flag_operate) { if (!main) return F_status_set_error(F_parameter); @@ -26,9 +26,9 @@ extern "C" { } } - return kt_remove_operate_file_remove(main, path, flag_operate); + return kt_remove_operate_remove(main, path, flag_operate); } -#endif // _di_kt_remove_rm_operate_file_remove_ +#endif // _di_kt_remove_rm_operate_remove_ #ifndef _di_kt_remove_rm_setting_load_ void kt_remove_rm_setting_load(const f_console_arguments_t arguments, kt_remove_main_t * const main) { diff --git a/sources/c/program/kevux/tools/remove/rm/rm.h b/sources/c/program/kevux/tools/remove/rm/rm.h index 0c71225..87f197f 100644 --- a/sources/c/program/kevux/tools/remove/rm/rm.h +++ b/sources/c/program/kevux/tools/remove/rm/rm.h @@ -21,7 +21,7 @@ extern "C" { #endif /** - * Perform rm program file operation. + * Perform rm program remove operation. * * This prints error messages as appropriate. * @@ -33,11 +33,11 @@ extern "C" { * Must not be NULL. * * This alters setting.status: - * Success from: kt_remove_operate_file_remove(). + * Success from: kt_remove_operate_remove(). * * F_no (with error bit) on failure and file is not to be removed or cannot be removed. * - * Errors (with error bit) from: kt_remove_operate_file_remove(). + * Errors (with error bit) from: kt_remove_operate_remove(). * * F_parameter (with error bit) on parameter error. * @param path @@ -46,19 +46,19 @@ extern "C" { * The operate file specific flags from kt_remove_flag_file_operate_*_e. * * @return - * Success from: kt_remove_operate_file_remove(). + * Success from: kt_remove_operate_remove(). * * F_no (with error bit) on failure and file is not to be removed or cannot be removed. * - * Errors (with error bit) from: kt_remove_operate_file_remove(). + * Errors (with error bit) from: kt_remove_operate_remove(). * * F_parameter (with error bit) on parameter error. * - * @see kt_remove_operate_file_remove() + * @see kt_remove_operate_remove() */ -#ifndef _di_kt_remove_rm_operate_file_remove_ - extern f_status_t kt_remove_rm_operate_file_remove(kt_remove_main_t * const main, const f_string_static_t path, const uint32_t flag_operate); -#endif // _di_kt_remove_rm_operate_file_remove_ +#ifndef _di_kt_remove_rm_operate_remove_ + extern f_status_t kt_remove_rm_operate_remove(kt_remove_main_t * const main, const f_string_static_t path, const uint32_t flag_operate); +#endif // _di_kt_remove_rm_operate_remove_ /** * Perform the rm program setting load process. diff --git a/sources/c/program/kevux/tools/remove/rmdir/main.c b/sources/c/program/kevux/tools/remove/rmdir/main.c index e6c29b5..80d9188 100644 --- a/sources/c/program/kevux/tools/remove/rmdir/main.c +++ b/sources/c/program/kevux/tools/remove/rmdir/main.c @@ -25,9 +25,8 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) { data.setting.program_name_long = &kt_remove_program_name_long_s; data.call.print_help = &kt_remove_rmdir_print_message_help; - data.call.process_normal = &kt_remove_process_normal_operate; - data.call.process_operate_directory = &kt_remove_rmdir_operate_file_remove; - data.call.process_operate_file = &kt_remove_rmdir_operate_file_remove; + data.call.process_normal = &kt_remove_normal_operate; + data.call.process_remove = &kt_remove_rmdir_operate_remove; #ifdef _en_kt_default_to_utc_ data.setting.flag |= kt_remove_flag_utc_d; diff --git a/sources/c/program/kevux/tools/remove/rmdir/rmdir.c b/sources/c/program/kevux/tools/remove/rmdir/rmdir.c index d01dba4..010d893 100644 --- a/sources/c/program/kevux/tools/remove/rmdir/rmdir.c +++ b/sources/c/program/kevux/tools/remove/rmdir/rmdir.c @@ -4,22 +4,22 @@ extern "C" { #endif -#ifndef _di_kt_remove_rmdir_operate_file_remove_ - f_status_t kt_remove_rmdir_operate_file_remove(kt_remove_main_t * const main, const f_string_static_t path, const uint32_t flag_operate) { +#ifndef _di_kt_remove_rmdir_operate_remove_ + f_status_t kt_remove_rmdir_operate_remove(kt_remove_main_t * const main, const f_string_static_t path, const uint32_t flag_operate) { if (!main) return F_status_set_error(F_parameter); if (!flag_operate) return F_status_set_error(F_parameter); if (flag_operate & kt_remove_flag_file_operate_directory_d) { - return kt_remove_operate_file_remove(main, path, flag_operate); + return kt_remove_operate_remove(main, path, flag_operate); } kt_remove_rmdir_print_error_directory_not(&main->program.error, path); return F_status_set_error(F_no); } -#endif // _di_kt_remove_rmdir_operate_file_remove_ +#endif // _di_kt_remove_rmdir_operate_remove_ #ifndef _di_kt_remove_rmdir_setting_load_ void kt_remove_rmdir_setting_load(const f_console_arguments_t arguments, kt_remove_main_t * const main) { diff --git a/sources/c/program/kevux/tools/remove/rmdir/rmdir.h b/sources/c/program/kevux/tools/remove/rmdir/rmdir.h index ee2264f..aff6d34 100644 --- a/sources/c/program/kevux/tools/remove/rmdir/rmdir.h +++ b/sources/c/program/kevux/tools/remove/rmdir/rmdir.h @@ -21,7 +21,7 @@ extern "C" { #endif /** - * Perform rmdir program file operation. + * Perform rmdir program remove operation. * * This prints error messages as appropriate. * @@ -33,11 +33,11 @@ extern "C" { * Must not be NULL. * * This alters setting.status: - * Success from: kt_remove_operate_file_remove(). + * Success from: kt_remove_operate_remove(). * * F_no (with error bit) on failure and file is not to be removed or cannot be removed. * - * Errors (with error bit) from: kt_remove_operate_file_remove(). + * Errors (with error bit) from: kt_remove_operate_remove(). * * F_parameter (with error bit) on parameter error. * @param path @@ -46,19 +46,19 @@ extern "C" { * The operate file specific flags from kt_remove_flag_file_operate_*_e. * * @return - * Success from: kt_remove_operate_file_remove(). + * Success from: kt_remove_operate_remove(). * * F_no (with error bit) on failure and file is not to be removed or cannot be removed. * - * Errors (with error bit) from: kt_remove_operate_file_remove(). + * Errors (with error bit) from: kt_remove_operate_remove(). * * F_parameter (with error bit) on parameter error. * - * @see kt_remove_operate_file_remove() + * @see kt_remove_operate_remove() */ -#ifndef _di_kt_remove_rmdir_operate_file_remove_ - extern f_status_t kt_remove_rmdir_operate_file_remove(kt_remove_main_t * const main, const f_string_static_t path, const uint32_t flag_operate); -#endif // _di_kt_remove_rmdir_operate_file_remove_ +#ifndef _di_kt_remove_rmdir_operate_remove_ + extern f_status_t kt_remove_rmdir_operate_remove(kt_remove_main_t * const main, const f_string_static_t path, const uint32_t flag_operate); +#endif // _di_kt_remove_rmdir_operate_remove_ /** * Perform the rmdir program setting load process. diff --git a/sources/c/program/kevux/tools/remove/unlink/main.c b/sources/c/program/kevux/tools/remove/unlink/main.c index 1c0d0c0..a42166e 100644 --- a/sources/c/program/kevux/tools/remove/unlink/main.c +++ b/sources/c/program/kevux/tools/remove/unlink/main.c @@ -25,9 +25,8 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) { data.setting.program_name_long = &kt_remove_program_name_long_s; data.call.print_help = &kt_remove_unlink_print_message_help; - data.call.process_normal = &kt_remove_process_normal_operate; - data.call.process_operate_directory = &kt_remove_unlink_operate_file_remove; - data.call.process_operate_file = &kt_remove_unlink_operate_file_remove; + data.call.process_normal = &kt_remove_normal_operate; + data.call.process_remove = &kt_remove_unlink_operate_remove; #ifdef _en_kt_default_to_utc_ data.setting.flag |= kt_remove_flag_utc_d; diff --git a/sources/c/program/kevux/tools/remove/unlink/unlink.c b/sources/c/program/kevux/tools/remove/unlink/unlink.c index 5a90dd1..393fec5 100644 --- a/sources/c/program/kevux/tools/remove/unlink/unlink.c +++ b/sources/c/program/kevux/tools/remove/unlink/unlink.c @@ -4,22 +4,22 @@ extern "C" { #endif -#ifndef _di_kt_remove_unlink_operate_file_remove_ - f_status_t kt_remove_unlink_operate_file_remove(kt_remove_main_t * const main, const f_string_static_t path, const uint32_t flag_operate) { +#ifndef _di_kt_remove_unlink_operate_remove_ + f_status_t kt_remove_unlink_operate_remove(kt_remove_main_t * const main, const f_string_static_t path, const uint32_t flag_operate) { if (!main) return F_status_set_error(F_parameter); if (!flag_operate) return F_status_set_error(F_parameter); if (flag_operate & kt_remove_flag_file_operate_link_d) { - return kt_remove_operate_file_remove(main, path, flag_operate); + return kt_remove_operate_remove(main, path, flag_operate); } kt_remove_unlink_print_error_link_not(&main->program.error, path); return F_status_set_error(F_no); } -#endif // _di_kt_remove_unlink_operate_file_remove_ +#endif // _di_kt_remove_unlink_operate_remove_ #ifndef _di_kt_remove_unlink_setting_load_ void kt_remove_unlink_setting_load(const f_console_arguments_t arguments, kt_remove_main_t * const main) { diff --git a/sources/c/program/kevux/tools/remove/unlink/unlink.h b/sources/c/program/kevux/tools/remove/unlink/unlink.h index e87c395..9af7483 100644 --- a/sources/c/program/kevux/tools/remove/unlink/unlink.h +++ b/sources/c/program/kevux/tools/remove/unlink/unlink.h @@ -21,7 +21,7 @@ extern "C" { #endif /** - * Perform unlink program file operation. + * Perform unlink program remove operation. * * This prints error messages as appropriate. * @@ -33,11 +33,11 @@ extern "C" { * Must not be NULL. * * This alters setting.status: - * Success from: kt_remove_operate_file_remove(). + * Success from: kt_remove_operate_remove(). * * F_no (with error bit) on failure and file is not to be removed or cannot be removed. * - * Errors (with error bit) from: kt_remove_operate_file_remove(). + * Errors (with error bit) from: kt_remove_operate_remove(). * * F_parameter (with error bit) on parameter error. * @param path @@ -46,19 +46,19 @@ extern "C" { * The operate file specific flags from kt_remove_flag_file_operate_*_e. * * @return - * Success from: kt_remove_operate_file_remove(). + * Success from: kt_remove_operate_remove(). * * F_no (with error bit) on failure and file is not to be removed or cannot be removed. * - * Errors (with error bit) from: kt_remove_operate_file_remove(). + * Errors (with error bit) from: kt_remove_operate_remove(). * * F_parameter (with error bit) on parameter error. * - * @see kt_remove_operate_file_remove() + * @see kt_remove_operate_remove() */ -#ifndef _di_kt_remove_unlink_operate_file_remove_ - extern f_status_t kt_remove_unlink_operate_file_remove(kt_remove_main_t * const main, const f_string_static_t path, const uint32_t flag_operate); -#endif // _di_kt_remove_unlink_operate_file_remove_ +#ifndef _di_kt_remove_unlink_operate_remove_ + extern f_status_t kt_remove_unlink_operate_remove(kt_remove_main_t * const main, const f_string_static_t path, const uint32_t flag_operate); +#endif // _di_kt_remove_unlink_operate_remove_ /** * Perform the unlink program setting load process.