00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00028 #if !defined(_TIFA_COMMON_FUNCS_H_)
00029
00033 #define _TIFA_COMMON_FUNCS_H_
00034
00035 #ifdef __cplusplus
00036 extern "C" {
00037 #endif
00038
00039 #include "first_primes.h"
00040
00041
00042
00043
00044
00045
00050 #define PRINT_ABORT_MSG() fprintf(stderr, "Program aborted\n");
00051
00057 #define PRINT_NAN_ERROR(X) do { \
00058 fprintf(stderr, "\nERROR: %s is not an integer!\n", X); \
00059 PRINT_ABORT_MSG(); \
00060 } while (0)
00061
00067 #define PRINT_BAD_ARGC_ERROR() do { \
00068 fprintf(stderr, "\nERROR: Bad number of arguments!\n\n"); \
00069 } while (0)
00070
00075 #define PRINT_ENTER_NUMBER_MSG() printf("> Enter the integer to factor: ")
00076
00081 #define PRINT_USAGE_WARNING_MSG() do { \
00082 fprintf(stderr, "Please, use the perl wrapper factorize.pl instead of "); \
00083 fprintf(stderr, "a direct invocation\nof this program.\n"); \
00084 } while (0)
00085
00090 #define MAX_NDIGITS 256
00091
00095 #define NTRIES_MILLER_RABIN 32
00096
00101 #define NPRIMES_TRIAL_DIV NFIRST_PRIMES
00102
00108 void print_hello_msg(char* name);
00109
00116 void print_bye_msg();
00117
00118 #ifdef __cplusplus
00119 }
00120 #endif
00121
00122 #endif
00123