]> Kevux Git Server - fll/commitdiff
Cleanup: remove error test macros
authorKevin Day <thekevinday@gmail.com>
Thu, 29 Aug 2019 20:40:03 +0000 (15:40 -0500)
committerKevin Day <thekevinday@gmail.com>
Thu, 29 Aug 2019 20:40:03 +0000 (15:40 -0500)
This is legacy behavior that is no longer needed.
Update any existing uses of these deleted macros.

18 files changed:
level_0/f_errors/c/errors.h
level_1/fl_colors/c/colors.c
level_1/fl_fss/c/fss_errors.h
level_2/fll_fss/c/fss_basic.c
level_2/fll_fss/c/fss_basic_list.c
level_2/fll_fss/c/fss_extended.c
level_3/firewall/c/firewall.c
level_3/firewall/c/private-firewall.c
level_3/fss_basic_list_read/c/fss_basic_list_read.c
level_3/fss_basic_list_write/c/fss_basic_list_write.c
level_3/fss_basic_read/c/fss_basic_read.c
level_3/fss_basic_write/c/fss_basic_write.c
level_3/fss_extended_read/c/fss_extended_read.c
level_3/fss_extended_write/c/fss_extended_write.c
level_3/fss_status_code/c/fss_status_code.c
level_3/init/c/init.c
level_3/init/c/private-init.c
level_3/status_code/c/status_code.c

index bf4556101c8088b6a1a692a5cc0f42f70ad90474..e452418c8bd857c3dfa0bc2d056c9e0e272ee059 100644 (file)
 extern "C" {
 #endif
 
-#ifndef _di_f_macro_test_for_basic_errors_
-  #define f_macro_test_for_basic_errors(potential_error) \
-    ( potential_error == f_critical          || \
-      potential_error == f_unknown           || \
-      potential_error == f_unsupported       || \
-      potential_error == f_invalid_parameter || \
-      potential_error == f_invalid_syntax    || \
-      potential_error == f_invalid_data      || \
-      potential_error == f_output_error      || \
-      potential_error == f_does_not_exist    || \
-      potential_error == f_failure)
-#endif // _di_f_macro_test_for_basic_errors_
-
-#ifndef _di_f_macro_test_for_allocation_errors_
-  // FIXME: invalid_parameter was temporarily added here so that parameter checking could be corrected for all allocations and deallocations
-  #define f_macro_test_for_allocation_errors(potential_error) \
-    ( potential_error == f_allocation_error           || \
-      potential_error == f_reallocation_error         || \
-      potential_error == f_file_allocation_error      || \
-      potential_error == f_file_reallocation_error    || \
-      potential_error == f_directory_allocation_error || \
-      potential_error == f_invalid_parameter || \
-      potential_error == f_directory_reallocation_error )
-#endif // _di_f_macro_test_for_allocation_errors_
-
-#ifndef _di_f_macro_test_for_non_errors_
-  #define f_macro_test_for_non_errors(potential_error) \
-    ( potential_error == f_true                     || \
-      potential_error == f_false                    || \
-      potential_error == f_warn                     || \
-      potential_error == f_no_data                  || \
-      potential_error == f_no_data_on_eos           || \
-      potential_error == f_no_data_on_eof           || \
-      potential_error == f_no_data_on_stop          || \
-      potential_error == f_none_on_eof              || \
-      potential_error == f_none_on_eos              || \
-      potential_error == f_none_on_stop             || \
-      potential_error == f_less_than                || \
-      potential_error == f_equal_to                 || \
-      potential_error == f_not_equal_to             || \
-      potential_error == f_greater_than             || \
-      potential_error == f_none )
-#endif // _di_f_macro_test_for_non_errors_
-
-#ifndef _di_macro_f_test_for_file_errors_
-  #define f_macro_test_for_file_errors(potential_error) \
-    ( potential_error == f_file_seek_error        || \
-      potential_error == f_file_read_error        || \
-      potential_error == f_file_write_error       || \
-      potential_error == f_file_flush_error       || \
-      potential_error == f_file_purge_error       || \
-      potential_error == f_file_open_error        || \
-      potential_error == f_file_close_error       || \
-      potential_error == f_file_synchronize_error || \
-      potential_error == f_file_descriptor_error  || \
-      potential_error == f_file_not_found         || \
-      potential_error == f_file_is_empty          || \
-      potential_error == f_file_not_open )
-#endif // _di_f_macro_test_for_file_errors_
-
-#ifndef _di_f_macro_test_for_directory_errors_
-  #define f_macro_test_for_directory_errors(parameter) \
-    ( potential_error == f_directory_seek_error        || \
-      potential_error == f_directory_read_error        || \
-      potential_error == f_directory_write_error       || \
-      potential_error == f_directory_flush_error       || \
-      potential_error == f_directory_purge_error       || \
-      potential_error == f_directory_open_error        || \
-      potential_error == f_directory_close_error       || \
-      potential_error == f_directory_synchronize_error || \
-      potential_error == f_directory_descriptor_error  || \
-      potential_error == f_directory_not_found         || \
-      potential_error == f_directory_is_empty          || \
-      potential_error == f_directory_not_open )
-#endif // _di_f_macro_test_for_directory_errors_
-
-#ifndef _di_f_macro_test_for_none_errors_
-  #define f_macro_test_for_none_errors(potential_error) \
-    ( potential_error == f_none        || \
-      potential_error == f_none_on_eof || \
-      potential_error == f_none_on_eol || \
-      potential_error == f_none_on_eos || \
-      potential_error == f_none_on_stop)
-#endif // _di_f_macro_test_for_none_errors_
-
-#ifndef _di_f_macro_test_for_no_data_errors_
-  #define f_macro_test_for_no_data_errors(potential_error) \
-    ( potential_error == f_no_data        || \
-      potential_error == f_no_data_on_eof || \
-      potential_error == f_no_data_on_eol || \
-      potential_error == f_no_data_on_eos || \
-      potential_error == f_no_data_on_stop)
-#endif // _di_f_macro_test_for_no_data_errors_
-
-#ifndef _di_f_macro_test_for_on_errors_
-  #define f_macro_test_for_on_errors(potential_error) \
-    ( potential_error == f_error_on_eof || \
-      potential_error == f_error_on_eol || \
-      potential_error == f_error_on_eos || \
-      potential_error == f_error_on_stop)
-#endif // _di_f_macro_test_for_on_errors_
-
-#ifndef _di_f_macro_test_for_unterminated_nest_errors_
-  #define f_macro_test_for_unterminated_nest_errors(potential_error) \
-    ( potential_error == f_unterminated_nest        || \
-      potential_error == f_unterminated_nest_on_eof || \
-      potential_error == f_unterminated_nest_on_eol || \
-      potential_error == f_unterminated_nest_on_eos || \
-      potential_error == f_unterminated_nest_on_stop)
-#endif // _di_f_macro_test_for_unterminated_nest_errors_
-
-#ifndef _di_f_macro_test_for_unterminated_group_errors_
-  #define f_macro_test_for_unterminated_group_errors(potential_error) \
-    ( potential_error == f_unterminated_group        || \
-      potential_error == f_unterminated_group_on_eof || \
-      potential_error == f_unterminated_group_on_eol || \
-      potential_error == f_unterminated_group_on_eos || \
-      potential_error == f_unterminated_group_on_stop)
-#endif // _di_f_macro_test_for_unterminated_group_errors_
-
 #ifndef _di_f_error_masks_
   // f_status is required to be exactly 16 bits, the first two high order bits represent error and warning respectively.
   #define f_error_bit_error   0x8000 // 1000 0000 0000 0000
index 736e7be442e14734727bbbd604f9608f322ee742..e86a93d381acfd22f0cecf9924663bec50778ae1 100644 (file)
@@ -52,7 +52,7 @@ extern "C" {
 
       f_resize_dynamic_string(status, (*buffer), buffer->used + string_size + 1); // the additional 1 is the EOS
 
-      if (f_macro_test_for_allocation_errors(status)) {
+      if (f_error_is_error(status)) {
         return status;
       }
     }
index 1a13404400974ed3368266057c7fe398e32cef44..03187e1ec093f9deceb08df86aa56becba52d402 100644 (file)
 extern "C" {
 #endif
 
-#ifndef _di_fl_macro_test_for_fss_errors_
-  #define fl_macro_test_for_fss_errors(potential_error) \
-    ( !f_macro_test_for_non_errors(potential_error)  && \
-      potential_error != fl_fss_no_header            && \
-      potential_error != fl_fss_no_header_eos        && \
-      potential_error != fl_fss_accepted_but_invalid && \
-      potential_error != fl_fss_accepted_but_invalid_eos )
-#endif // _di_fl_macro_test_for_fss_errors_
-
 enum {
   fl_fss_error_start = f_last_error_code,
 
index 095d3110078ffdf30bc248dd15fdb72003e3b5f6..65123e828b01842f5bc31140dada8ce8733bca7a 100644 (file)
@@ -149,17 +149,17 @@ extern "C" {
 
     status = fl_fss_basic_object_write(buffer, object, &location);
 
-    if (f_macro_test_for_no_data_errors(status)) {
+    if (f_error_is_error(status) || status == f_no_data_on_stop || status == f_no_data_on_eos) {
       return status;
     }
 
-    if (f_macro_test_for_none_errors(status)) {
+    if (status == f_none || status == f_none_on_stop || status == f_none_on_eos || status == f_none_on_eol) {
       if (contents.used > 0) {
         location.start = 0;
         location.stop = contents.array[0].used - 1;
         status = fl_fss_basic_content_write(buffer, contents.array[0], &location);
 
-        if (f_macro_test_for_no_data_errors(status)) {
+        if (f_error_is_error(status)) {
           return status;
         }
       }
index bda34b51a20148ca5aef1473ea26dd991192aaf7..8d5c3bdf0fb69201e2558d0c44b07f44950e10f0 100644 (file)
@@ -149,17 +149,17 @@ extern "C" {
 
     status = fl_fss_basic_list_object_write(object, &location, buffer);
 
-    if (f_macro_test_for_no_data_errors(status)) {
+    if (f_error_is_error(status) || status == f_no_data_on_stop || status == f_no_data_on_eos) {
       return status;
     }
 
-    if (f_macro_test_for_none_errors(status)) {
+    if (status == f_none || status == f_none_on_stop || status == f_none_on_eos || status == f_none_on_eol) {
       if (contents.used > 0) {
         location.start = 0;
         location.stop = contents.array[0].used - 1;
         status = fl_fss_basic_list_content_write(contents.array[0], &location, buffer);
 
-        if (f_macro_test_for_no_data_errors(status)) {
+        if (f_error_is_error(status) || status == f_no_data_on_stop || status == f_no_data_on_eos) {
           return status;
         }
       }
index 42092f7184ef9284fbe31c7c69f73a4c3a395021..d8e3b6bdceb74a8c657eebbbcbbe367915758ac0 100644 (file)
@@ -148,17 +148,17 @@ extern "C" {
 
     status = fl_fss_extended_object_write(object, &location, buffer);
 
-    if (f_macro_test_for_no_data_errors(status)) {
+    if (f_error_is_error(status) || status == f_no_data_on_stop || status == f_no_data_on_eos) {
       return status;
     }
 
-    if (f_macro_test_for_none_errors(status)) {
+    if (status == f_none || status == f_none_on_stop || status == f_none_on_eos || status == f_none_on_eol) {
       while (current < contents.used) {
         location.start = 0;
         location.stop = contents.array[current].used - 1;
         status = fl_fss_extended_content_write(contents.array[current], &location, buffer);
 
-        if (f_macro_test_for_no_data_errors(status)) {
+        if (f_error_is_error(status) || status == f_no_data_on_stop || status == f_no_data_on_eos) {
           return status;
         }
 
index 16a7658a4a1d356f95fb28a410d0e6436ed1724a..2d9cf98554d7d277033ac7e61bcaa8a9c6410c9d 100644 (file)
@@ -136,7 +136,7 @@ extern "C" {
         //       to do this, one must look for any "has_additional" and then see if the "additional" location is set to 0
         //       nothing can be 0 as that represents the program name, unless argv[] is improperly created
       }
-      else if (f_macro_test_for_allocation_errors(status)) {
+      else if (status == f_allocation_error || status == f_reallocation_error) {
         fl_print_color_line(f_standard_error, data->context.error, data->context.reset, "CRITICAL ERROR: unable to allocate memory");
       }
       else if (f_error_set_fine(status) == f_invalid_parameter) {
@@ -348,7 +348,7 @@ extern "C" {
           if (f_error_is_error(status)) {
             status = f_error_set_fine(status);
 
-            if (f_macro_test_for_allocation_errors(status)) {
+            if (status == f_allocation_error || status == f_reallocation_error) {
               fl_print_color_line(f_standard_error, data->context.error, data->context.reset, "CRITICAL ERROR: unable to allocate memory");
             }
             else {
@@ -398,7 +398,7 @@ extern "C" {
         if (f_error_is_error(status)) {
           status = f_error_set_fine(status);
 
-          if (f_macro_test_for_allocation_errors(status)) {
+          if (status == f_allocation_error || status == f_reallocation_error) {
             fl_print_color_line(f_standard_error, data->context.error, data->context.reset, "CRITICAL ERROR: unable to allocate memory");
           }
           else if (status == f_no_data) {
index 34aaf0161f5b19393972675788ad5e80f75755ff..cd60e6c8f840bb6cc29109a0c410fdd01871c4e1 100644 (file)
@@ -596,7 +596,7 @@ f_return_status firewall_perform_commands(const firewall_local_data local, const
             else if (status == f_file_descriptor_error) {
               fl_print_color_line(f_standard_error, data.context.error, data.context.reset, "ERROR: File descriptor error while trying to open the file '%.*s'", file_path.used, file_path.string);
             }
-            else if (f_macro_test_for_allocation_errors(status)) {
+            else if (status == f_allocation_error || status == f_reallocation_error) {
               fl_print_color_line(f_standard_error, data.context.error, data.context.reset, "CRITICAL ERROR: unable to allocate memory");
             }
             else {
@@ -638,7 +638,7 @@ f_return_status firewall_perform_commands(const firewall_local_data local, const
               else if (status == f_file_read_error) {
                 fl_print_color_line(f_standard_error, data.context.error, data.context.reset, "ERROR: A read error occurred while accessing the file '%.*s'", file_path.used, file_path.string);
               }
-              else if (f_macro_test_for_allocation_errors(status)) {
+              else if (status == f_allocation_error || status == f_reallocation_error) {
                 fl_print_color_line(f_standard_error, data.context.error, data.context.reset, "CRITICAL ERROR: unable to allocate memory");
               }
               else {
@@ -665,7 +665,7 @@ f_return_status firewall_perform_commands(const firewall_local_data local, const
                 else if (status == f_no_data_on_eos || status == f_no_data || status == f_no_data_on_stop) {
                   // empty files are to be silently ignored
                 }
-                else if (f_macro_test_for_allocation_errors(status)) {
+                else if (status == f_allocation_error || status == f_reallocation_error) {
                   fl_print_color_line(f_standard_error, data.context.error, data.context.reset, "CRITICAL ERROR: unable to allocate memory");
                 }
                 else {
@@ -1397,7 +1397,7 @@ f_return_status firewall_buffer_rules(const f_string filename, const f_bool opti
     else if (status == f_file_read_error) {
       fl_print_color_line(f_standard_error, data->context.error, data->context.reset, "ERROR: A read error occurred while accessing the file '%s'.", filename);
     }
-    else if (f_macro_test_for_allocation_errors(status)) {
+    else if (status == f_allocation_error || status == f_reallocation_error) {
       fl_print_color_line(f_standard_error, data->context.error, data->context.reset, "CRITICAL ERROR: unable to allocate memory.");
     }
     else {
@@ -1423,7 +1423,7 @@ f_return_status firewall_buffer_rules(const f_string filename, const f_bool opti
     else if (status == f_no_data_on_eos || status == f_no_data || status == f_no_data_on_stop) {
       fl_print_color_line(f_standard_error, data->context.error, data->context.reset, "ERROR: No relevant data was found within the file '%s'.", filename);
     }
-    else if (f_macro_test_for_allocation_errors(status)) {
+    else if (status == f_allocation_error || status == f_reallocation_error) {
       fl_print_color_line(f_standard_error, data->context.error, data->context.reset, "CRITICAL ERROR: unable to allocate memory.");
     }
     else {
@@ -1448,7 +1448,7 @@ f_return_status firewall_process_rules(f_string_location *input, firewall_local_
     if (f_error_is_error(status)) {
       status = f_error_set_fine(status);
 
-      if (f_macro_test_for_allocation_errors(status)) {
+      if (status == f_allocation_error || status == f_reallocation_error) {
         fl_print_color_line(f_standard_error, data->context.error, data->context.reset, "CRITICAL ERROR: unable to allocate memory.");
       }
       else if (status == f_failure) {
index 141694fb8be4f824ab2b43af7a78942ed7a3743f..f9885fede39f678921f4418f989c43661bafdde6 100644 (file)
@@ -145,7 +145,7 @@ extern "C" {
         //       to do this, one must look for any "has_additional" and then see if the "additional" location is set to 0
         //       nothing can be 0 as that represents the program name, unless argv[] is improperly created
       }
-      else if (f_macro_test_for_allocation_errors(status)) {
+      else if (status == f_allocation_error || status == f_reallocation_error) {
         fl_print_color_line(f_standard_error, data->context.error, data->context.reset, "CRITICAL ERROR: unable to allocate memory");
       }
       else if (status == f_invalid_parameter) {
@@ -283,7 +283,7 @@ extern "C" {
           else if (status == f_file_read_error) {
             fl_print_color_line(f_standard_error, data->context.error, data->context.reset, "ERROR: A read error occurred while accessing the file '%s'", argv[data->remaining.array[counter]]);
           }
-          else if (f_macro_test_for_allocation_errors(status)) {
+          else if (status == f_allocation_error || status == f_reallocation_error) {
             fl_print_color_line(f_standard_error, data->context.error, data->context.reset, "CRITICAL ERROR: unable to allocate memory");
           }
           else {
@@ -336,7 +336,7 @@ extern "C" {
         if (status == f_invalid_parameter) {
           fl_print_color_line(f_standard_error, data->context.error, data->context.reset, "INTERNAL ERROR: Invalid parameter when calling fll_fss_basic_list_read() for the file '%s'", filename);
         }
-        else if (f_macro_test_for_allocation_errors(status)) {
+        else if (status == f_allocation_error || status == f_reallocation_error) {
           fl_print_color_line(f_standard_error, data->context.error, data->context.reset, "CRITICAL ERROR: unable to allocate memory");
         }
         else if (status == f_incomplete_utf_on_stop) {
@@ -352,7 +352,7 @@ extern "C" {
         fss_basic_list_read_delete_data(data);
         return f_error_set_error(status);
       }
-      else if (f_macro_test_for_no_data_errors(status)) {
+      else if (status == f_no_data_on_stop || status == f_no_data_on_eos) {
         // clear buffers, then attempt the next file
         f_delete_fss_contents(status2, data->contents);
         f_delete_fss_objects(status2, data->objects);
index 2a53f1b952c845f83e9cdd1dee3e90de3d3130f3..e67a81ba7e684106915ebed004aee45a4d9931a0 100644 (file)
@@ -117,7 +117,7 @@ extern "C" {
         //       to do this, one must look for any "has_additional" and then see if the "additional" location is set to 0
         //       nothing can be 0 as that represents the program name, unless argv[] is improperly created
       }
-      else if (f_macro_test_for_allocation_errors(status)) {
+      else if (status == f_allocation_error || status == f_reallocation_error) {
         fl_print_color_line(f_standard_error, data->context.error, data->context.reset, "CRITICAL ERROR: unable to allocate memory.");
       }
       else if (status == f_invalid_parameter) {
@@ -183,14 +183,14 @@ extern "C" {
         if (object) {
           status = fl_fss_basic_list_object_write(input, &location, &buffer);
 
-          if (f_error_is_error(status) || f_macro_test_for_no_data_errors(status)) {
+          if (f_error_is_error(status) || status == f_no_data_on_stop || status == f_no_data_on_eos || status == f_no_data_on_eol) {
             return f_error_set_error(status);
           }
         }
         else {
           status = fl_fss_basic_list_content_write(input, &location, &buffer);
 
-          if (f_error_is_error(status) || f_macro_test_for_no_data_errors(status)) {
+          if (f_error_is_error(status) || status == f_no_data_on_stop || status == f_no_data_on_eos || status == f_no_data_on_eol) {
             return f_error_set_error(status);
           }
         }
@@ -209,14 +209,14 @@ extern "C" {
         if (object) {
           status = fl_fss_basic_list_object_write(input, &location, &buffer);
 
-          if (f_error_is_error(status) || f_macro_test_for_no_data_errors(status)) {
+          if (f_error_is_error(status) || status == f_no_data_on_stop || status == f_no_data_on_eos || status == f_no_data_on_eol) {
             return f_error_set_error(status);
           }
         }
         else {
           status = fl_fss_basic_list_content_write(input, &location, &buffer);
 
-          if (f_error_is_error(status) || f_macro_test_for_no_data_errors(status)) {
+          if (f_error_is_error(status) || status == f_no_data_on_stop || status == f_no_data_on_eos || status == f_no_data_on_eol) {
             return f_error_set_error(status);
           }
         }
index ce1770f48ea15d4b08e80040fc39c811dafde3c9..1da3d300823c7c2391ea4fe3d742240139066117 100644 (file)
@@ -131,7 +131,7 @@ extern "C" {
         //       to do this, one must look for any "has_additional" and then see if the "additional" location is set to 0
         //       nothing can be 0 as that represents the program name, unless argv[] is improperly created
       }
-      else if (f_macro_test_for_allocation_errors(status)) {
+      else if (status == f_allocation_error || status == f_reallocation_error) {
         fl_print_color_line(f_standard_error, data->context.error, data->context.reset, "CRITICAL ERROR: unable to allocate memory");
       }
       else if (status == f_invalid_parameter) {
@@ -186,7 +186,7 @@ extern "C" {
           else if (status == f_file_read_error) {
             fl_print_color_line(f_standard_error, data->context.error, data->context.reset, "ERROR: A read error occurred while accessing the file '%s'", "-");
           }
-          else if (f_macro_test_for_allocation_errors(status)) {
+          else if (status == f_allocation_error || status == f_reallocation_error) {
             fl_print_color_line(f_standard_error, data->context.error, data->context.reset, "CRITICAL ERROR: unable to allocate memory");
           }
           else {
@@ -276,7 +276,7 @@ extern "C" {
             else if (status == f_file_read_error) {
               fl_print_color_line(f_standard_error, data->context.error, data->context.reset, "ERROR: A read error occurred while accessing the file '%s'", argv[data->remaining.array[counter]]);
             }
-            else if (f_macro_test_for_allocation_errors(status)) {
+            else if (status == f_allocation_error || status == f_reallocation_error) {
               fl_print_color_line(f_standard_error, data->context.error, data->context.reset, "CRITICAL ERROR: unable to allocate memory");
             }
             else {
@@ -330,7 +330,7 @@ extern "C" {
         if (status == f_invalid_parameter) {
           fl_print_color_line(f_standard_error, data->context.error, data->context.reset, "INTERNAL ERROR: Invalid parameter when calling fll_fss_basic_list_read() for the file '%s'", filename);
         }
-        else if (f_macro_test_for_allocation_errors(status)) {
+        else if (status == f_allocation_error || status == f_reallocation_error) {
           fl_print_color_line(f_standard_error, data->context.error, data->context.reset, "CRITICAL ERROR: unable to allocate memory");
         }
         else if (status == f_incomplete_utf_on_stop) {
@@ -346,7 +346,7 @@ extern "C" {
         fss_basic_read_delete_data(data);
         return f_error_set_error(status);
       }
-      else if (f_macro_test_for_no_data_errors(status)) {
+      else if (status == f_no_data_on_stop || status == f_no_data_on_eos) {
         // clear buffers, then attempt the next file
         f_delete_fss_contents(status2, data->contents);
         f_delete_fss_objects(status2, data->objects);
index 8607d53a39cb9e8009995b50a93dde8aaae35ff4..9a678d60448319b46ef55fd198affe3272a210a6 100644 (file)
@@ -117,7 +117,7 @@ extern "C" {
         //       to do this, one must look for any "has_additional" and then see if the "additional" location is set to 0
         //       nothing can be 0 as that represents the program name, unless argv[] is improperly created
       }
-      else if (f_macro_test_for_allocation_errors(status)) {
+      else if (status == f_allocation_error || status == f_reallocation_error) {
         fl_print_color_line(f_standard_error, data->context.error, data->context.reset, "CRITICAL ERROR: unable to allocate memory.");
       }
       else if (status == f_invalid_parameter) {
@@ -183,14 +183,14 @@ extern "C" {
         if (object) {
           status = fl_fss_basic_object_write(&buffer, input, &location);
 
-          if (f_error_is_error(status) || f_macro_test_for_no_data_errors(status)) {
+          if (f_error_is_error(status) || status == f_no_data_on_stop || status == f_no_data_on_eos) {
             return f_error_set_error(status);
           }
         }
         else {
           status = fl_fss_basic_content_write(&buffer, input, &location);
 
-          if (f_error_is_error(status) || f_macro_test_for_no_data_errors(status)) {
+          if (f_error_is_error(status) || status == f_no_data_on_stop || status == f_no_data_on_eos) {
             return f_error_set_error(status);
           }
         }
@@ -209,14 +209,14 @@ extern "C" {
         if (object) {
           status = fl_fss_basic_object_write(&buffer, input, &location);
 
-          if (f_error_is_error(status) || f_macro_test_for_no_data_errors(status)) {
+          if (f_error_is_error(status) || status == f_no_data_on_stop || status == f_no_data_on_eos) {
             return f_error_set_error(status);
           }
         }
         else {
           status = fl_fss_basic_content_write(&buffer, input, &location);
 
-          if (f_error_is_error(status) || f_macro_test_for_no_data_errors(status)) {
+          if (f_error_is_error(status) || status == f_no_data_on_stop || status == f_no_data_on_eos) {
             return f_error_set_error(status);
           }
         }
index 0043fe90e37bf00918c4ca68cc04dae09fa91a87..a95207a007f2af6ea8408d2a6e4a9c1c23d69697 100644 (file)
@@ -138,7 +138,7 @@ extern "C" {
         //       to do this, one must look for any "has_additional" and then see if the "additional" location is set to 0
         //       nothing can be 0 as that represents the program name, unless argv[] is improperly created
       }
-      else if (f_macro_test_for_allocation_errors(status)) {
+      else if (status == f_allocation_error || status == f_reallocation_error) {
         fl_print_color_line(f_standard_error, data->context.error, data->context.reset, "CRITICAL ERROR: unable to allocate memory");
       }
       else if (status == f_invalid_parameter) {
@@ -245,14 +245,6 @@ extern "C" {
           fss_extended_read_delete_data(data);
           return f_error_set_error(status);
         }
-        else if (f_macro_test_for_no_data_errors(status)) {
-          // clear buffers, then attempt the next file
-          f_delete_fss_contents(status2, data->contents);
-          f_delete_fss_objects(status2, data->objects);
-          f_delete_dynamic_string(status2, data->buffer);
-
-          return f_error_set_warning(status);
-        }
 
         if (data->file_position.total_elements == 0) {
           fseek(file.file, 0, SEEK_END);
@@ -290,7 +282,7 @@ extern "C" {
           else if (status == f_file_read_error) {
             fl_print_color_line(f_standard_error, data->context.error, data->context.reset, "ERROR: A read error occurred while accessing the file '%s'", argv[data->remaining.array[counter]]);
           }
-          else if (f_macro_test_for_allocation_errors(status)) {
+          else if (status == f_allocation_error || status == f_reallocation_error) {
             fl_print_color_line(f_standard_error, data->context.error, data->context.reset, "CRITICAL ERROR: unable to allocate memory");
           }
           else {
@@ -343,7 +335,7 @@ extern "C" {
         if (status == f_invalid_parameter) {
           fl_print_color_line(f_standard_error, data->context.error, data->context.reset, "INTERNAL ERROR: Invalid parameter when calling fll_fss_extended_read() for the file '%s'", filename);
         }
-        else if (f_macro_test_for_allocation_errors(status)) {
+        else if (status == f_allocation_error || status == f_reallocation_error) {
           fl_print_color_line(f_standard_error, data->context.error, data->context.reset, "CRITICAL ERROR: unable to allocate memory");
         }
         else if (status == f_incomplete_utf_on_stop) {
@@ -359,7 +351,7 @@ extern "C" {
         fss_extended_read_delete_data(data);
         return f_error_set_error(status);
       }
-      else if (f_macro_test_for_no_data_errors(status)) {
+      else if (status == f_no_data_on_stop || status == f_no_data_on_eos) {
         // clear buffers, then attempt the next file
         f_delete_fss_contents(status2, data->contents);
         f_delete_fss_objects(status2, data->objects);
index a7282e9e173f0bb7383d2a66ca55d829094e296f..5f35cbe6e8b7947e6e44aa54a97c20e628e8e8c8 100644 (file)
@@ -124,7 +124,7 @@ extern "C" {
         //       to do this, one must look for any "has_additional" and then see if the "additional" location is set to 0
         //       nothing can be 0 as that represents the program name, unless argv[] is improperly created
       }
-      else if (f_macro_test_for_allocation_errors(status)) {
+      else if (status == f_allocation_error || status == f_reallocation_error) {
         fl_print_color_line(f_standard_error, data->context.error, data->context.reset, "CRITICAL ERROR: unable to allocate memory.");
       }
       else if (status == f_invalid_parameter) {
@@ -190,14 +190,14 @@ extern "C" {
         if (object) {
           status = fl_fss_extended_object_write(input, &location, &buffer);
 
-          if (f_error_is_error(status) || f_macro_test_for_no_data_errors(status)) {
+          if (f_error_is_error(status) || status == f_no_data_on_stop || status == f_no_data_on_eos) {
             return f_error_set_error(status);
           }
         }
         else {
           status = fl_fss_extended_content_write(input, &location, &buffer);
 
-          if (f_error_is_error(status) || f_macro_test_for_no_data_errors(status)) {
+          if (f_error_is_error(status) || status == f_no_data_on_stop || status == f_no_data_on_eos) {
             return f_error_set_error(status);
           }
 
@@ -229,7 +229,7 @@ extern "C" {
 
           status = fl_fss_extended_object_write(input, &location, &buffer);
 
-          if (f_error_is_error(status) || f_macro_test_for_no_data_errors(status)) {
+          if (f_error_is_error(status) || status == f_no_data_on_stop || status == f_no_data_on_eos) {
             return f_error_set_error(status);
           }
         }
@@ -245,7 +245,7 @@ extern "C" {
 
             status = fl_fss_extended_content_write(input, &location, &buffer);
 
-            if (f_error_is_error(status) || f_macro_test_for_no_data_errors(status)) {
+            if (f_error_is_error(status) || status == f_no_data_on_stop || status == f_no_data_on_eos) {
               return f_error_set_error(status);
             }
 
index 4ab2d35c2270bea0adaf3e63c6f590d3ea0645af..c66fe8fa70f7022de4cb6105e739367edcfd795e 100644 (file)
@@ -136,7 +136,7 @@ extern "C" {
         //       to do this, one must look for any "has_additional" and then see if the "additional" location is set to 0
         //       nothing can be 0 as that represents the program name, unless argv[] is improperly created
       }
-      else if (f_macro_test_for_allocation_errors(status)) {
+      else if (status == f_allocation_error || status == f_reallocation_error) {
         fl_print_color_line(f_standard_error, data->context.error, data->context.reset, "CRITICAL ERROR: unable to allocate memory.");
       }
       else if (status == f_invalid_parameter) {
index 5b7d7d5282e20c628b85e7aee2ab80d08e03eacd..0504c3eb95b23a7148e2bf16fc0ca4a0f49ed896 100644 (file)
@@ -132,7 +132,7 @@ extern "C" {
         // TODO: there is a way to identify which parameter is incorrect
         //       to do this, one must look for any "has_additional" and then see if the "additional" location is set to 0
         //       nothing can be 0 as that represents the program name, unless argv[] is improperly created
-      } else if (f_macro_test_for_allocation_errors(status)) {
+      } else if (status == f_allocation_error || status == f_reallocation_error) {
         fl_print_color_line(f_standard_error, argument->context.error, argument->context.reset, "CRITICAL ERROR: unable to allocate memory");
       } else if (f_error_set_fine(status) == f_invalid_parameter) {
         fl_print_color_line(f_standard_error, argument->context.error, argument->context.reset, "INTERNAL ERROR: Invalid parameter when calling fl_process_parameters()");
index 026fb75659feb3d1ea40b2148758d757aa0e11ad..4d60b862c9384632715ea072640d4b8b08a8183f 100644 (file)
@@ -58,7 +58,7 @@
         fl_print_color_line(f_standard_error, data->context.error, data->context.reset, "ERROR: A seek error occurred while accessing the file '%s'.", filename);
       } else if (status == f_file_read_error) {
         fl_print_color_line(f_standard_error, data->context.error, data->context.reset, "ERROR: A read error occurred while accessing the file '%s'.", filename);
-      } else if (f_macro_test_for_allocation_errors(status)) {
+      } else if (status == f_allocation_error || status == f_reallocation_error) {
         fl_print_color_line(f_standard_error, data->context.error, data->context.reset, "CRITICAL ERROR: unable to allocate memory.");
       } else {
         fl_print_color_line(f_standard_error, data->context.error, data->context.reset, "INTERNAL ERROR: An unhandled error (%u) has occured while calling fl_file_read().", f_error_set_error(status));
@@ -80,7 +80,7 @@
         fl_print_color_line(f_standard_error, data->context.error, data->context.reset, "INTERNAL ERROR: Invalid parameter when calling fll_fss_basic_list_read() for the file '%s'.", filename);
       } else if (status == f_no_data_on_eos || status == f_no_data || status == f_no_data_on_stop) {
         fl_print_color_line(f_standard_error, data->context.error, data->context.reset, "ERROR: No relevant data was found within the file '%s'.", filename);
-      } else if (f_macro_test_for_allocation_errors(status)) {
+      } else if (status == f_allocation_error || status == f_reallocation_error) {
         fl_print_color_line(f_standard_error, data->context.error, data->context.reset, "CRITICAL ERROR: unable to allocate memory.");
       } else {
         fl_print_color_line(f_standard_error, data->context.error, data->context.reset, "INTERNAL ERROR: An unhandled error (%u) has occured while calling fll_fss_basic_list_read() for the file '%s'.", f_error_set_error(status), filename);
       if (f_error_is_error(status)) {
         status = f_error_set_fine(status);
 
-        if (f_macro_test_for_allocation_errors(status)) {
+        if (status == f_allocation_error || status == f_reallocation_error) {
           fl_print_color_line(f_standard_error, data->context.error, data->context.reset, "CRITICAL ERROR: unable to allocate memory.");
         } else if (status == f_failure) {
           // the error message has already been displayed.
         fl_print_color_line(f_standard_error, argument.context.error, argument.context.reset, "INTERNAL ERROR: Invalid parameter when calling fll_fss_basic_list_read() for the file '%s'.", init_rule_core_file);
       } else if (status == f_no_data_on_eos || status == f_no_data || status == f_no_data_on_stop) {
         fl_print_color_line(f_standard_error, argument.context.error, argument.context.reset, "ERROR: No relevant data was found within the file '%s'.", init_rule_core_file);
-      } else if (f_macro_test_for_allocation_errors(status)) {
+      } else if (status == f_allocation_error || status == f_reallocation_error) {
         fl_print_color_line(f_standard_error, argument.context.error, argument.context.reset, "CRITICAL ERROR: unable to allocate memory.");
       } else {
         fl_print_color_line(f_standard_error, argument.context.error, argument.context.reset, "INTERNAL ERROR: An unhandled error (%u) has occured while calling fll_fss_basic_list_read() for the file '%s'.", f_error_set_error(status), init_rule_core_file);
     status = fll_fss_extended_read(&buffer, &location, &objects, &contents);
 
     if (f_error_is_error(status_process)) {
-      if (f_macro_test_for_allocation_errors(status)) {
+      if (status == f_allocation_error || status == f_reallocation_error) {
         fl_print_color_line(f_standard_error, argument->context.error, argument->context.reset, "CRITICAL ERROR: unable to allocate memory.");
       }
       else {
       if (f_error_is_error(status)) {
         status = f_error_set_fine(status);
 
-        if (f_macro_test_for_allocation_errors(status)) {
+        if (status == f_allocation_error || status == f_reallocation_error) {
           fl_print_color_line(f_standard_error, data->context.error, context.reset, "CRITICAL ERROR: unable to allocate memory.");
         } else if (status == f_failure) {
           // the error message has already been displayed.
       }
     }
     else {
-      if (f_macro_test_for_allocation_errors(status)) {
+      if (status == f_allocation_error || status == f_reallocation_error) {
         fl_print_color_line(f_standard_error, context.error, context.reset, "CRITICAL ERROR: unable to allocate memory.");
       }
       else {
index 7feaffcbc510508132204a2329448345627bca5d..9e4fae0c5734cc5224f9e4ec673a9ae9f8989b95 100644 (file)
@@ -136,7 +136,7 @@ extern "C" {
         //       to do this, one must look for any "has_additional" and then see if the "additional" location is set to 0
         //       nothing can be 0 as that represents the program name, unless argv[] is improperly created
       }
-      else if (f_macro_test_for_allocation_errors(status)) {
+      else if (status == f_allocation_error || status == f_reallocation_error) {
         fl_print_color_line(f_standard_error, data->context.error, data->context.reset, "CRITICAL ERROR: unable to allocate memory.");
       }
       else if (status == f_invalid_parameter) {