00001 // Copyright (C) 2011 CNRS - Ecole Polytechnique - INRIA. 00002 // 00003 // This file is part of TIFA. 00004 // 00005 // TIFA is free software; you can redistribute it and/or modify it under the 00006 // terms of the GNU Lesser General Public License as published by the Free 00007 // Software Foundation; either version 2.1 of the License, or (at your option) 00008 // any later version. 00009 // 00010 // TIFA is distributed in the hope that it will be useful, but WITHOUT ANY 00011 // WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 00012 // FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for 00013 // more details. 00014 // 00015 // You should have received a copy of the GNU Lesser General Public License 00016 // along with this library; if not, write to the Free Software Foundation, 00017 // Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 00018 00028 #if !defined(_TIFA_FACTORING_PROGRAM_H_) 00029 00033 #define _TIFA_FACTORING_PROGRAM_H_ 00034 00035 #ifdef __cplusplus 00036 extern "C" { 00037 #endif 00038 00039 #include <gmp.h> 00040 00041 #include "array.h" 00042 #include "exit_codes.h" 00043 #include "factoring_machine.h" 00044 00058 struct struct_factoring_program { 00062 int argc; 00066 char** argv; 00070 mpz_t n; 00074 factoring_mode_t mode; 00078 int verbose; 00083 int timing; 00087 uint32_t nprimes_tdiv; 00092 uint32_t nfactors; 00096 char* algo_name; 00100 void* params; 00108 void (*print_usage_func) (struct struct_factoring_program* const); 00116 void (*print_params_func) (struct struct_factoring_program* const); 00124 void (*process_args_func) (struct struct_factoring_program* const); 00136 ecode_t (*factoring_algo_func) (mpz_array_t* const factors, 00137 uint32_array_t* const multis, 00138 const mpz_t n, 00139 const void* const params, 00140 factoring_mode_t mode); 00148 void (*set_params_to_default_func) (struct struct_factoring_program* const); 00149 00150 }; 00155 typedef struct struct_factoring_program factoring_program_t; 00156 00164 ecode_t run_program(factoring_program_t* const program); 00165 00166 #ifdef __cplusplus 00167 } 00168 #endif 00169 00170 #endif 00171