#ifdef GMP /****************************************************************** * Interface to translate MPUTIL calls into calls to GMP *****************************************************************/ #include "gmp.h" #include #include /* CVS info */ /* $Date: 2005/01/10 20:57:47 $ */ /* $Revision: 1.2 $ */ /* $RCSfile: wrap.c,v $ */ /* $Name: rel_5 $ */ static char cvs_info[] = "BMARKGRP $Date: 2005/01/10 20:57:47 $ $Revision: 1.2 $ $RCSfile: wrap.c,v $ $Name: rel_5 $"; mpadd ( MP_INT *sum, MP_INT *u, MP_INT *v ) { mpz_add ( sum, u, v ); } mpmult ( MP_INT *prod, MP_INT *u, MP_INT *v ) { mpz_mul ( prod, u, v ); } mpmod ( MP_INT *rem, MP_INT *dividend, MP_INT *modulus ) { mpz_mod ( rem, dividend, modulus ); } mpclear ( MP_INT *num ) { mpz_clear ( num); } mpset ( MP_INT *dest, MP_INT *source ) { mpz_set ( dest, source ); } mpfromstring ( MP_INT *X, char * string ) { mpz_set_str ( X, string, 10 ); } mpread ( MP_INT *X ) { mpz_inp_str ( X, stdin, 10 ); return; } mpwrite ( MP_INT *X ) { mpz_out_str ( stdout, 10, X ); /* on some systems we need this newline */ printf("\n"); } #else #ifdef SW_LEADZ initlz_ () { initlz (); } leadz_ ( long x ) { return leadz ( *(long*)x ); } /* OY! */ #endif void dummy() { return; } #endif