00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00031 #if !defined(_TIFA_EXIT_CODES_H_)
00032
00036 #define _TIFA_EXIT_CODES_H_
00037
00038 #ifdef __cplusplus
00039 extern "C" {
00040 #endif
00041
00047 enum ecode_enum {
00052 UNKNOWN_FACTORING_MODE,
00058 SOME_FACTORS_FOUND,
00064 SOME_PRIME_FACTORS_FOUND,
00070 SOME_COPRIME_FACTORS_FOUND,
00079 PARTIAL_FACTORIZATION_FOUND,
00084 COMPLETE_FACTORIZATION_FOUND,
00089 NO_FACTOR_FOUND,
00094 FATAL_INTERNAL_ERROR,
00099 QUEUE_OVERFLOW,
00104 NO_PROPER_FORM_FOUND,
00109 GIVING_UP,
00114 INTEGER_TOO_LARGE,
00118 SUCCESS,
00122 FAILURE
00123 };
00124
00129 typedef enum ecode_enum ecode_t;
00130
00134 static const char* const ecode_to_str[14] = {
00135 "unknown factoring mode",
00136 "some factors found",
00137 "some prime factors found",
00138 "some coprime factors found",
00139 "partial factorization found",
00140 "complete factorization found",
00141 "no factor found",
00142 "fatal internal error",
00143 "queue overflow",
00144 "no proper form found",
00145 "giving up",
00146 "number to factor is too large",
00147 "success",
00148 "failure"
00149 };
00150
00156 #define PRINT_ECODE(ECODE) printf("%s\n", ecode_to_str[ECODE]);
00157
00158 #ifdef __cplusplus
00159 }
00160 #endif
00161
00162 #endif