]> Kevux Git Server - fll/commitdiff
Update: add additional error testing macro groups
authorKevin Day <kevin@kevux.org>
Fri, 30 Mar 2012 06:08:40 +0000 (01:08 -0500)
committerKevin Day <kevin@kevux.org>
Fri, 30 Mar 2012 06:08:40 +0000 (01:08 -0500)
This adds additional error testing macro groups that are common.

level_0/f_errors/c/errors.h

index 2f8afee01071996e5f6f8be21effb2709980cf8a..832450dbc481cb5ee9a6e7639b6dd7187ece3a6b 100644 (file)
@@ -92,6 +92,50 @@ extern "C"{
       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_
+
 // use of an enumerator makes more sense here than explicitly defining every error code
 enum {
   #ifndef _di_f_errors_booleans_