]> Kevux Git Server - fll/commitdiff
Cleanup: Move the link operation into its own function fake_make_operate_process_type...
authorKevin Day <thekevinday@gmail.com>
Sat, 23 Jul 2022 03:40:28 +0000 (22:40 -0500)
committerKevin Day <thekevinday@gmail.com>
Sat, 23 Jul 2022 03:40:28 +0000 (22:40 -0500)
level_3/fake/c/private-make-operate_process_type.c
level_3/fake/c/private-make-operate_process_type.h

index 35559726c2328d5f2139acc2e45e7b59f76c18e3..e93f8871e367d175ca2a37c89e85e1cf07081136 100644 (file)
@@ -1043,6 +1043,32 @@ extern "C" {
   }
 #endif // _di_fake_make_operate_process_type_if_parameter_
 
+#ifndef _di_fake_make_operate_process_type_link_
+  f_status_t fake_make_operate_process_type_link(fake_make_data_t * const data_make) {
+
+    f_status_t status = F_none;
+
+    status = f_file_link(data_make->cache_arguments.array[0], data_make->cache_arguments.array[1]);
+
+    if (F_status_is_error(status)) {
+      fll_error_file_print(data_make->error, F_status_set_fine(status), "f_file_link", F_true, data_make->cache_arguments.array[1], f_file_operation_link_s, fll_error_file_type_file_e);
+
+      return F_status_set_error(F_failure);
+    }
+
+    if (data_make->main->error.verbosity >= f_console_verbosity_verbose_e) {
+      flockfile(data_make->main->output.to.stream);
+
+      fl_print_format("Created symbolic link from '%[%Q%]", data_make->main->output.to.stream, data_make->main->context.set.notable, data_make->cache_arguments.array[1], data_make->main->context.set.notable);
+      fl_print_format("' to %[%Q%].%r", data_make->main->output.to.stream, data_make->main->context.set.notable, data_make->cache_arguments.array[0], data_make->main->context.set.notable, f_string_eol_s);
+
+      funlockfile(data_make->main->output.to.stream);
+    }
+
+    return F_none;
+  }
+#endif // _di_fake_make_operate_process_type_link_
+
 #ifndef _di_fake_make_operate_process_type_modes_
   f_status_t fake_make_operate_process_type_modes(fake_make_data_t * const data_make, const bool all) {
 
index 7189653b28463c59bdb611350be67ed39b8c2979..3d6c8621103e63f9432ec7751e745c69048c1168 100644 (file)
@@ -261,6 +261,23 @@ extern "C" {
 #endif // _di_fake_make_operate_process_type_if_parameter_
 
 /**
+ * Perform the link operation processes.
+ *
+ * @param data_make
+ *   All make related setting data, including data from the fakefile and the build settings file.
+ *
+ * @return
+ *   F_none on success.
+ *
+ *   F_failure (with error bit) on any error.
+ *
+ * @see f_file_link()
+ */
+#ifndef _di_fake_make_operate_process_type_link_
+  extern f_status_t fake_make_operate_process_type_link(fake_make_data_t * const data_make) F_attribute_visibility_internal_d;
+#endif // _di_fake_make_operate_process_type_link_
+
+/**
  * Perform the mode and modes operation processes.
  *
  * @param data_make