From 1d83dc3e58ff5737aa32c681555657860d29e588 Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Fri, 30 Mar 2012 01:08:40 -0500 Subject: [PATCH] Update: add additional error testing macro groups This adds additional error testing macro groups that are common. --- level_0/f_errors/c/errors.h | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/level_0/f_errors/c/errors.h b/level_0/f_errors/c/errors.h index 2f8afee..832450d 100644 --- a/level_0/f_errors/c/errors.h +++ b/level_0/f_errors/c/errors.h @@ -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_ -- 1.8.3.1