common_funcs.h File Reference

Miscellaneous functions and macros used by the "tool" programs. More...

#include "first_primes.h"

Go to the source code of this file.

Defines

#define _TIFA_COMMON_FUNCS_H_
#define PRINT_ABORT_MSG()   fprintf(stderr, "Program aborted\n");
#define PRINT_NAN_ERROR(X)
#define PRINT_BAD_ARGC_ERROR()
#define PRINT_ENTER_NUMBER_MSG()   printf("> Enter the integer to factor: ")
#define PRINT_USAGE_WARNING_MSG()
#define MAX_NDIGITS   256
#define NTRIES_MILLER_RABIN   32
#define NPRIMES_TRIAL_DIV   NFIRST_PRIMES

Functions

void print_hello_msg (char *name)
 Function used by the "tool" programs to print a greeting message.
void print_bye_msg ()
 Function used by the "tool" programs to print a bye-bye message.


Detailed Description

Miscellaneous functions and macros used by the "tool" programs.

Author:
Jerome Milan
Date:
Fri Jun 10 2011
Version:
2011-06-10

Definition in file common_funcs.h.


Define Documentation

#define _TIFA_COMMON_FUNCS_H_

Standard include guard.

Definition at line 33 of file common_funcs.h.

#define MAX_NDIGITS   256

Maximal number of decimal digits of the number to factor.

Definition at line 90 of file common_funcs.h.

#define NPRIMES_TRIAL_DIV   NFIRST_PRIMES

Default number of prime numbers used in trial division of number to factor.

Definition at line 101 of file common_funcs.h.

#define NTRIES_MILLER_RABIN   32

Number of iterations to use in the Miller-Rabin composition tests.

Definition at line 95 of file common_funcs.h.

 
#define PRINT_ABORT_MSG (  )     fprintf(stderr, "Program aborted\n");

Macro printing an "program has aborted" message on the standard error.

Definition at line 50 of file common_funcs.h.

 
#define PRINT_BAD_ARGC_ERROR (  ) 

Value:

do {                           \
    fprintf(stderr, "\nERROR: Bad number of arguments!\n\n"); \
} while (0)
Macro printing a "bad number of argument" error message on the standard error.

Definition at line 67 of file common_funcs.h.

 
#define PRINT_ENTER_NUMBER_MSG (  )     printf("> Enter the integer to factor: ")

Macro displaying a prompt asking the user to enter the integer to factor.

Definition at line 75 of file common_funcs.h.

#define PRINT_NAN_ERROR (  ) 

Value:

do {                             \
    fprintf(stderr, "\nERROR: %s is not an integer!\n", X); \
    PRINT_ABORT_MSG();                                      \
} while (0)
Macro printing a "X is not an integer" error message on the standard error.

Definition at line 57 of file common_funcs.h.

 
#define PRINT_USAGE_WARNING_MSG (  ) 

Value:

do {                                        \
    fprintf(stderr, "Please, use the perl wrapper factorize.pl instead of "); \
    fprintf(stderr, "a direct invocation\nof this program.\n");               \
} while (0)
Macro printing a boilerplate usage warning on the standard error.

Definition at line 81 of file common_funcs.h.


Function Documentation

void print_bye_msg (  ) 

Function used by the "tool" programs to print a bye-bye message.

This function could be used by the "tool" programs to print a bye-bye message (it is not used right now).

void print_hello_msg ( char *  name  ) 

Function used by the "tool" programs to print a greeting message.

Parameters:
[in] name Name of the factoring program.


Generated on Fri Jun 17 11:10:11 2011 for TIFA by Doxygen 1.5.5