exit_codes.h File Reference
Exit codes used by/in some of the TIFA functions.
More...
Go to the source code of this file.
|
Defines |
#define | _TIFA_EXIT_CODES_H_ |
#define | PRINT_ECODE(ECODE) printf("%s\n", ecode_to_str[ECODE]); |
Typedefs |
typedef enum ecode_enum | ecode_t |
| Equivalent to enum ecode_enum .
|
Enumerations |
enum | ecode_enum {
UNKNOWN_FACTORING_MODE,
SOME_FACTORS_FOUND,
SOME_PRIME_FACTORS_FOUND,
SOME_COPRIME_FACTORS_FOUND,
PARTIAL_FACTORIZATION_FOUND,
COMPLETE_FACTORIZATION_FOUND,
NO_FACTOR_FOUND,
FATAL_INTERNAL_ERROR,
QUEUE_OVERFLOW,
NO_PROPER_FORM_FOUND,
GIVING_UP,
INTEGER_TOO_LARGE,
SUCCESS,
FAILURE
} |
Variables |
static const char *const | ecode_to_str [14] |
Detailed Description
Exit codes used by/in some of the TIFA functions.
- Author:
- Jerome Milan
- Date:
- Fri Jun 10 2011
- Version:
- 2011-06-10
Defines several exit codes used by/in some of the TIFA functions together with their string representations.
Definition in file exit_codes.h.
Define Documentation
#define _TIFA_EXIT_CODES_H_ |
#define PRINT_ECODE |
( |
ECODE |
|
) |
printf("%s\n", ecode_to_str[ECODE]); |
Macro printing the string representation of the exit code ECODE
on the standard output, followed by a newline.
Definition at line 156 of file exit_codes.h.
Enumeration Type Documentation
An enumeration of the possible exit codes used by/in some TIFA functions.
- Enumerator:
-
UNKNOWN_FACTORING_MODE |
Used by a factoring_machine_t to indicate that the factoring_mode_t passed as parameter is not valid. |
SOME_FACTORS_FOUND |
Used by the factorization algorithm to indicate that some factors were found. In that case, the factors' multiplicities are not computed. |
SOME_PRIME_FACTORS_FOUND |
Used by the factorization algorithm to indicate that some prime factors were found. In that case, the factors' multiplicities are not computed. |
SOME_COPRIME_FACTORS_FOUND |
Used by the factorization algorithm to indicate that some coprime factors were found. In that case, the factors' multiplicities are not computed. |
PARTIAL_FACTORIZATION_FOUND |
Used by the factorization algorithm to indicate that a partial factorization (in terms of a set of coprimes and multiplicities) was found. The term "partial" refers to the fact that some found factors may not be prime. However the product of the found factors (taking into account their associated multiplicities) does yield the original number to factor. |
COMPLETE_FACTORIZATION_FOUND |
Used by the factorization algorithm to indicate that a complete factorization (in terms of primes and multiplicities) was found. |
NO_FACTOR_FOUND |
Used by the factorization algorithm to indicate that no factor was found. |
FATAL_INTERNAL_ERROR |
Generic exit code used to indicate a serious internal error, possibly leading to an unpredictable behavior. |
QUEUE_OVERFLOW |
Used by the SQUFOF algorithm to indicate that the queue overflowed, thus leading to give up the factorization process. |
NO_PROPER_FORM_FOUND |
Used by the SQUFOF algorithm to indicate that no proper form was found, thus leading to give up the factorization process. |
GIVING_UP |
Used to indicate that an abort limit has been reached leading to give up the current operation. |
INTEGER_TOO_LARGE |
Used by the SQUFOF and Fermat/McKee implementations to indicate that the integer to factor is too large and cannot be processed. |
SUCCESS |
Generic exit code used to indicate that an operation succeeded. |
FAILURE |
Generic exit code used to indicate that an operation failed. |
Definition at line 47 of file exit_codes.h.
Variable Documentation
Initial value:
{
"unknown factoring mode",
"some factors found",
"some prime factors found",
"some coprime factors found",
"partial factorization found",
"complete factorization found",
"no factor found",
"fatal internal error",
"queue overflow",
"no proper form found",
"giving up",
"number to factor is too large",
"success",
"failure"
}
Global constant array mapping exit codes to their string representations.
Definition at line 134 of file exit_codes.h.