Annotation of OpenXM_contrib/gmp/tests/tests.h, Revision 1.1
1.1 ! ohara 1: /* Tests support prototypes etc.
! 2:
! 3: Copyright 2000, 2001, 2002 Free Software Foundation, Inc.
! 4:
! 5: This file is part of the GNU MP Library.
! 6:
! 7: The GNU MP Library is free software; you can redistribute it and/or modify
! 8: it under the terms of the GNU Lesser General Public License as published by
! 9: the Free Software Foundation; either version 2.1 of the License, or (at your
! 10: option) any later version.
! 11:
! 12: The GNU MP Library is distributed in the hope that it will be useful, but
! 13: WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
! 14: or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
! 15: License for more details.
! 16:
! 17: You should have received a copy of the GNU Lesser General Public License
! 18: along with the GNU MP Library; see the file COPYING.LIB. If not, write to
! 19: the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
! 20: MA 02111-1307, USA. */
! 21:
! 22:
! 23: #ifndef __TESTS_H__
! 24: #define __TESTS_H__
! 25:
! 26: #if defined (__cplusplus)
! 27: extern "C" {
! 28: #endif
! 29:
! 30:
! 31: #ifdef __cplusplus
! 32: #define ANYARGS ...
! 33: #else
! 34: #define ANYARGS
! 35: #endif
! 36:
! 37:
! 38: void tests_start __GMP_PROTO ((void));
! 39: void tests_end __GMP_PROTO ((void));
! 40:
! 41: void tests_memory_start __GMP_PROTO ((void));
! 42: void tests_memory_end __GMP_PROTO ((void));
! 43: void *tests_allocate __GMP_PROTO ((size_t size));
! 44: void *tests_reallocate __GMP_PROTO ((void *ptr, size_t old_size, size_t new_size));
! 45: void tests_free __GMP_PROTO ((void *ptr, size_t size));
! 46: void tests_free_nosize __GMP_PROTO ((void *ptr));
! 47: int tests_memory_valid __GMP_PROTO ((void *ptr));
! 48:
! 49: void tests_rand_start __GMP_PROTO ((void));
! 50: void tests_rand_end __GMP_PROTO ((void));
! 51:
! 52:
! 53: #if HAVE_CALLING_CONVENTIONS
! 54: extern mp_limb_t (*calling_conventions_function) __GMP_PROTO ((ANYARGS));
! 55: mp_limb_t calling_conventions __GMP_PROTO ((ANYARGS));
! 56: int calling_conventions_check __GMP_PROTO ((void));
! 57: #define CALLING_CONVENTIONS(function) \
! 58: (calling_conventions_function = (function), calling_conventions)
! 59: #define CALLING_CONVENTIONS_CHECK() (calling_conventions_check())
! 60: #else
! 61: #define CALLING_CONVENTIONS(function) (function)
! 62: #define CALLING_CONVENTIONS_CHECK() 1 /* always ok */
! 63: #endif
! 64:
! 65:
! 66: extern int mp_trace_base;
! 67: void mpn_trace __GMP_PROTO ((const char *name, mp_srcptr ptr, mp_size_t size));
! 68: void mpn_tracea __GMP_PROTO ((const char *name, const mp_ptr *a, int count,
! 69: mp_size_t size));
! 70: void mpn_tracen __GMP_PROTO ((const char *name, int num, mp_srcptr ptr,
! 71: mp_size_t size));
! 72: void mpn_trace_file __GMP_PROTO ((const char *filename,
! 73: mp_srcptr ptr, mp_size_t size));
! 74: void mpn_tracea_file __GMP_PROTO ((const char *filename,
! 75: const mp_ptr *a, int count, mp_size_t size));
! 76: void mpf_trace __GMP_PROTO ((const char *name, mpf_srcptr z));
! 77: void mpq_trace __GMP_PROTO ((const char *name, mpq_srcptr q));
! 78: void mpz_trace __GMP_PROTO ((const char *name, mpz_srcptr z));
! 79: void mpz_tracen __GMP_PROTO ((const char *name, int num, mpz_srcptr z));
! 80: void byte_trace __GMP_PROTO ((const char *, const void *, mp_size_t));
! 81: void byte_tracen __GMP_PROTO ((const char *, int, const void *, mp_size_t));
! 82:
! 83:
! 84: void spinner __GMP_PROTO ((void));
! 85: extern unsigned long spinner_count;
! 86: extern int spinner_wanted;
! 87: extern int spinner_tick;
! 88:
! 89:
! 90: void *align_pointer __GMP_PROTO ((void *p, size_t align));
! 91: void *__gmp_allocate_func_aligned __GMP_PROTO ((size_t bytes, size_t align));
! 92: void *__gmp_allocate_or_reallocate __GMP_PROTO ((void *ptr,
! 93: size_t oldsize, size_t newsize));
! 94: char *__gmp_allocate_strdup __GMP_PROTO ((const char *s));
! 95: char *strtoupper __GMP_PROTO ((char *s_orig));
! 96: mp_limb_t urandom __GMP_PROTO ((void));
! 97:
! 98:
! 99: void mpf_set_str_or_abort __GMP_PROTO ((mpf_ptr f, const char *str, int base));
! 100:
! 101:
! 102: void mpq_set_str_or_abort __GMP_PROTO ((mpq_ptr q, const char *str, int base));
! 103:
! 104:
! 105: void mpz_erandomb __GMP_PROTO ((mpz_ptr rop, gmp_randstate_t rstate,
! 106: unsigned long nbits));
! 107: void mpz_erandomb_nonzero __GMP_PROTO ((mpz_ptr rop, gmp_randstate_t rstate,
! 108: unsigned long nbits));
! 109: void mpz_errandomb __GMP_PROTO ((mpz_ptr rop, gmp_randstate_t rstate,
! 110: unsigned long nbits));
! 111: void mpz_errandomb_nonzero __GMP_PROTO ((mpz_ptr rop, gmp_randstate_t rstate,
! 112: unsigned long nbits));
! 113: void mpz_flipbit __GMP_PROTO ((mpz_ptr r, unsigned long bit));
! 114: void mpz_init_set_n __GMP_PROTO ((mpz_ptr z, mp_srcptr p, mp_size_t size));
! 115: void mpz_negrandom __GMP_PROTO ((mpz_ptr rop, gmp_randstate_t rstate));
! 116: int mpz_pow2abs_p __GMP_PROTO ((mpz_srcptr z)) __GMP_ATTRIBUTE_PURE;
! 117: void mpz_set_n __GMP_PROTO ((mpz_ptr z, mp_srcptr p, mp_size_t size));
! 118: void mpz_set_str_or_abort __GMP_PROTO ((mpz_ptr z, const char *str, int base));
! 119:
! 120: mp_size_t mpn_diff_highest __GMP_PROTO ((mp_srcptr p1, mp_srcptr p2, mp_size_t n)) __GMP_ATTRIBUTE_PURE;
! 121: mp_size_t mpn_diff_lowest __GMP_PROTO ((mp_srcptr p1, mp_srcptr p2, mp_size_t n)) __GMP_ATTRIBUTE_PURE;
! 122: mp_size_t byte_diff_highest __GMP_PROTO ((const void *p1, const void *p2, mp_size_t size)) __GMP_ATTRIBUTE_PURE;
! 123: mp_size_t byte_diff_lowest __GMP_PROTO ((const void *p1, const void *p2, mp_size_t size)) __GMP_ATTRIBUTE_PURE;
! 124:
! 125:
! 126: void refmpf_add __GMP_PROTO ((mpf_ptr, mpf_srcptr, mpf_srcptr));
! 127: void refmpf_sub __GMP_PROTO ((mpf_ptr, mpf_srcptr, mpf_srcptr));
! 128:
! 129:
! 130: mp_limb_t refmpn_add __GMP_PROTO ((mp_ptr rp,
! 131: mp_srcptr s1p, mp_size_t s1size,
! 132: mp_srcptr s2p, mp_size_t s2size));
! 133: mp_limb_t refmpn_add_1 __GMP_PROTO ((mp_ptr rp, mp_srcptr sp, mp_size_t size,
! 134: mp_limb_t n));
! 135: mp_limb_t refmpn_add_n __GMP_PROTO ((mp_ptr wp, mp_srcptr xp, mp_srcptr yp,
! 136: mp_size_t size));
! 137: mp_limb_t refmpn_add_nc __GMP_PROTO ((mp_ptr wp, mp_srcptr xp, mp_srcptr yp,
! 138: mp_size_t size, mp_limb_t carry));
! 139: mp_limb_t refmpn_addmul_1 __GMP_PROTO ((mp_ptr wp, mp_srcptr xp, mp_size_t size,
! 140: mp_limb_t multiplier));
! 141: mp_limb_t refmpn_addmul_1c __GMP_PROTO ((mp_ptr wp, mp_srcptr xp, mp_size_t size,
! 142: mp_limb_t multiplier, mp_limb_t carry));
! 143: mp_limb_t refmpn_addsub_n __GMP_PROTO ((mp_ptr r1p, mp_ptr r2p,
! 144: mp_srcptr s1p, mp_srcptr s2p,
! 145: mp_size_t size));
! 146: mp_limb_t refmpn_addsub_nc __GMP_PROTO ((mp_ptr r1p, mp_ptr r2p,
! 147: mp_srcptr s1p, mp_srcptr s2p,
! 148: mp_size_t size, mp_limb_t carry));
! 149:
! 150: void refmpn_and_n __GMP_PROTO ((mp_ptr wp, mp_srcptr xp, mp_srcptr yp,
! 151: mp_size_t size));
! 152: void refmpn_andn_n __GMP_PROTO ((mp_ptr wp, mp_srcptr xp, mp_srcptr yp,
! 153: mp_size_t size));
! 154:
! 155: mp_limb_t refmpn_bswap_limb __GMP_PROTO ((mp_limb_t src));
! 156:
! 157: void refmpn_clrbit __GMP_PROTO ((mp_ptr, unsigned long));
! 158: int refmpn_cmp __GMP_PROTO ((mp_srcptr s1p, mp_srcptr s2p, mp_size_t size));
! 159: int refmpn_cmp_allowzero __GMP_PROTO ((mp_srcptr, mp_srcptr, mp_size_t));
! 160: int refmpn_cmp_twosizes __GMP_PROTO ((mp_srcptr xp, mp_size_t xsize,
! 161: mp_srcptr yp, mp_size_t ysize));
! 162:
! 163: void refmpn_com_n __GMP_PROTO ((mp_ptr rp, mp_srcptr sp, mp_size_t size));
! 164: void refmpn_copy __GMP_PROTO ((mp_ptr rp, mp_srcptr sp, mp_size_t size));
! 165: void refmpn_copyi __GMP_PROTO ((mp_ptr rp, mp_srcptr sp, mp_size_t size));
! 166: void refmpn_copyd __GMP_PROTO ((mp_ptr rp, mp_srcptr sp, mp_size_t size));
! 167:
! 168: unsigned refmpn_count_leading_zeros __GMP_PROTO ((mp_limb_t x));
! 169: unsigned refmpn_count_trailing_zeros __GMP_PROTO ((mp_limb_t x));
! 170:
! 171: mp_limb_t refmpn_divexact_by3 __GMP_PROTO ((mp_ptr rp, mp_srcptr sp,
! 172: mp_size_t size));
! 173: mp_limb_t refmpn_divexact_by3c __GMP_PROTO ((mp_ptr rp, mp_srcptr sp,
! 174: mp_size_t size, mp_limb_t carry));
! 175:
! 176: mp_limb_t refmpn_divmod_1 __GMP_PROTO ((mp_ptr rp, mp_srcptr sp, mp_size_t size,
! 177: mp_limb_t divisor));
! 178: mp_limb_t refmpn_divmod_1c __GMP_PROTO ((mp_ptr rp, mp_srcptr sp, mp_size_t size,
! 179: mp_limb_t divisor, mp_limb_t carry));
! 180: mp_limb_t refmpn_divrem_1 __GMP_PROTO ((mp_ptr rp, mp_size_t xsize,
! 181: mp_srcptr sp, mp_size_t size,
! 182: mp_limb_t divisor));
! 183: mp_limb_t refmpn_divrem_1c __GMP_PROTO ((mp_ptr rp, mp_size_t xsize,
! 184: mp_srcptr sp, mp_size_t size,
! 185: mp_limb_t divisor, mp_limb_t carry));
! 186:
! 187: int refmpn_equal_anynail __GMP_PROTO ((mp_srcptr, mp_srcptr, mp_size_t));
! 188:
! 189: void refmpn_fill __GMP_PROTO ((mp_ptr p, mp_size_t s, mp_limb_t v));
! 190:
! 191: mp_limb_t refmpn_gcd_1 __GMP_PROTO ((mp_srcptr xp, mp_size_t xsize, mp_limb_t y));
! 192: mp_limb_t refmpn_gcd __GMP_PROTO ((mp_ptr gp, mp_ptr xp, mp_size_t xsize,
! 193: mp_ptr yp, mp_size_t ysize));
! 194: mp_limb_t refmpn_gcd_finda __GMP_PROTO ((const mp_limb_t c[2]));
! 195:
! 196: size_t refmpn_get_str __GMP_PROTO ((unsigned char *, int, mp_ptr, mp_size_t));
! 197:
! 198: unsigned long refmpn_hamdist __GMP_PROTO ((mp_srcptr s1p, mp_srcptr s2p,
! 199: mp_size_t size));
! 200:
! 201: mp_limb_t refmpn_invert_limb __GMP_PROTO ((mp_limb_t d));
! 202: void refmpn_ior_n __GMP_PROTO ((mp_ptr wp, mp_srcptr xp, mp_srcptr yp,
! 203: mp_size_t size));
! 204: void refmpn_iorn_n __GMP_PROTO ((mp_ptr wp, mp_srcptr xp, mp_srcptr yp,
! 205: mp_size_t size));
! 206:
! 207: mp_limb_t refmpn_lshift __GMP_PROTO ((mp_ptr wp, mp_srcptr xp, mp_size_t size,
! 208: unsigned shift));
! 209: mp_limb_t refmpn_lshift_or_copy __GMP_PROTO ((mp_ptr wp,
! 210: mp_srcptr xp, mp_size_t size,
! 211: unsigned shift));
! 212:
! 213: mp_ptr refmpn_malloc_limbs __GMP_PROTO ((mp_size_t size));
! 214: mp_ptr refmpn_malloc_limbs_aligned __GMP_PROTO ((size_t n, size_t m));
! 215: mp_limb_t refmpn_msbone __GMP_PROTO ((mp_limb_t x));
! 216: mp_limb_t refmpn_msbone_mask __GMP_PROTO ((mp_limb_t x));
! 217: mp_ptr refmpn_memdup_limbs __GMP_PROTO ((mp_srcptr ptr, mp_size_t size));
! 218:
! 219: mp_limb_t refmpn_mod_1 __GMP_PROTO ((mp_srcptr sp, mp_size_t size,
! 220: mp_limb_t divisor));
! 221: mp_limb_t refmpn_mod_1c __GMP_PROTO ((mp_srcptr sp, mp_size_t size,
! 222: mp_limb_t divisor, mp_limb_t carry));
! 223: mp_limb_t refmpn_mod_34lsub1 __GMP_PROTO ((mp_srcptr p, mp_size_t n));
! 224:
! 225: mp_limb_t refmpn_mul_1 __GMP_PROTO ((mp_ptr wp, mp_srcptr xp, mp_size_t size,
! 226: mp_limb_t multiplier));
! 227: mp_limb_t refmpn_mul_1c __GMP_PROTO ((mp_ptr wp, mp_srcptr xp, mp_size_t size,
! 228: mp_limb_t multiplier, mp_limb_t carry));
! 229: mp_limb_t refmpn_mul_2 __GMP_PROTO ((mp_ptr dst, mp_srcptr src, mp_size_t size,
! 230: mp_srcptr mult));
! 231:
! 232: void refmpn_mul_basecase __GMP_PROTO ((mp_ptr prodp,
! 233: mp_srcptr up, mp_size_t usize,
! 234: mp_srcptr vp, mp_size_t vsize));
! 235: void refmpn_mul_any __GMP_PROTO ((mp_ptr prodp,
! 236: mp_srcptr up, mp_size_t usize,
! 237: mp_srcptr vp, mp_size_t vsize));
! 238: void refmpn_mul_n __GMP_PROTO ((mp_ptr prodp, mp_srcptr up, mp_srcptr vp,
! 239: mp_size_t size));
! 240:
! 241: void refmpn_nand_n __GMP_PROTO ((mp_ptr wp, mp_srcptr xp, mp_srcptr yp,
! 242: mp_size_t size));
! 243: void refmpn_nior_n __GMP_PROTO ((mp_ptr wp, mp_srcptr xp, mp_srcptr yp,
! 244: mp_size_t size));
! 245: mp_limb_t refmpn_neg_n __GMP_PROTO ((mp_ptr dst, mp_srcptr src, mp_size_t size));
! 246:
! 247: unsigned long refmpn_popcount __GMP_PROTO ((mp_srcptr sp, mp_size_t size));
! 248: mp_limb_t refmpn_preinv_divrem_1 __GMP_PROTO ((mp_ptr rp, mp_size_t xsize,
! 249: mp_srcptr sp, mp_size_t size,
! 250: mp_limb_t divisor,
! 251: mp_limb_t inverse, unsigned shift));
! 252: mp_limb_t refmpn_preinv_mod_1 __GMP_PROTO ((mp_srcptr sp, mp_size_t size,
! 253: mp_limb_t divisor,
! 254: mp_limb_t divisor_inverse));
! 255:
! 256: void refmpn_random __GMP_PROTO ((mp_ptr, mp_size_t));
! 257: void refmpn_random2 __GMP_PROTO ((mp_ptr, mp_size_t));
! 258: mp_limb_t refmpn_random_limb __GMP_PROTO ((void));
! 259:
! 260: mp_limb_t refmpn_rshift __GMP_PROTO ((mp_ptr wp, mp_srcptr xp, mp_size_t size,
! 261: unsigned shift));
! 262: mp_limb_t refmpn_rshift_or_copy __GMP_PROTO ((mp_ptr wp,
! 263: mp_srcptr xp, mp_size_t size,
! 264: unsigned shift));
! 265:
! 266: mp_limb_t refmpn_sb_divrem_mn __GMP_PROTO ((mp_ptr qp,
! 267: mp_ptr np, mp_size_t nsize,
! 268: mp_srcptr dp, mp_size_t dsize));
! 269: unsigned long refmpn_scan0 __GMP_PROTO ((mp_srcptr, unsigned long));
! 270: unsigned long refmpn_scan1 __GMP_PROTO ((mp_srcptr, unsigned long));
! 271: void refmpn_setbit __GMP_PROTO ((mp_ptr, unsigned long));
! 272: void refmpn_sqr __GMP_PROTO ((mp_ptr dst, mp_srcptr src, mp_size_t size));
! 273:
! 274: mp_limb_t refmpn_sub __GMP_PROTO ((mp_ptr rp,
! 275: mp_srcptr s1p, mp_size_t s1size,
! 276: mp_srcptr s2p, mp_size_t s2size));
! 277: mp_limb_t refmpn_sub_1 __GMP_PROTO ((mp_ptr rp, mp_srcptr sp, mp_size_t size,
! 278: mp_limb_t n));
! 279: mp_limb_t refmpn_sub_n __GMP_PROTO ((mp_ptr wp, mp_srcptr xp, mp_srcptr yp,
! 280: mp_size_t size));
! 281: mp_limb_t refmpn_sub_nc __GMP_PROTO ((mp_ptr wp, mp_srcptr xp, mp_srcptr yp,
! 282: mp_size_t size, mp_limb_t carry));
! 283: mp_limb_t refmpn_submul_1 __GMP_PROTO ((mp_ptr wp, mp_srcptr xp, mp_size_t size,
! 284: mp_limb_t multiplier));
! 285: mp_limb_t refmpn_submul_1c __GMP_PROTO ((mp_ptr wp, mp_srcptr xp, mp_size_t size,
! 286: mp_limb_t multiplier, mp_limb_t carry));
! 287:
! 288: void refmpn_tdiv_qr __GMP_PROTO ((mp_ptr qp, mp_ptr rp, mp_size_t qxn,
! 289: mp_ptr np, mp_size_t nsize,
! 290: mp_srcptr dp, mp_size_t dsize));
! 291: int refmpn_tstbit __GMP_PROTO ((mp_srcptr, unsigned long));
! 292:
! 293: mp_limb_t refmpn_udiv_qrnnd __GMP_PROTO ((mp_limb_t *, mp_limb_t, mp_limb_t, mp_limb_t));
! 294: mp_limb_t refmpn_udiv_qrnnd_r __GMP_PROTO ((mp_limb_t, mp_limb_t, mp_limb_t, mp_limb_t *));
! 295: mp_limb_t refmpn_umul_ppmm __GMP_PROTO ((mp_limb_t *, mp_limb_t, mp_limb_t));
! 296: mp_limb_t refmpn_umul_ppmm_r __GMP_PROTO ((mp_limb_t, mp_limb_t, mp_limb_t *));
! 297:
! 298: void refmpn_xnor_n __GMP_PROTO ((mp_ptr wp, mp_srcptr xp, mp_srcptr yp,
! 299: mp_size_t size));
! 300: void refmpn_xor_n __GMP_PROTO ((mp_ptr wp, mp_srcptr xp, mp_srcptr yp,
! 301: mp_size_t size));
! 302:
! 303: void refmpn_zero __GMP_PROTO ((mp_ptr p, mp_size_t s));
! 304: int refmpn_zero_p __GMP_PROTO ((mp_srcptr ptr, mp_size_t size));
! 305:
! 306:
! 307: void refmpq_add __GMP_PROTO ((mpq_ptr w, mpq_srcptr x, mpq_srcptr y));
! 308: void refmpq_sub __GMP_PROTO ((mpq_ptr w, mpq_srcptr x, mpq_srcptr y));
! 309:
! 310:
! 311: unsigned long refmpz_hamdist __GMP_PROTO ((mpz_srcptr x, mpz_srcptr y));
! 312: int refmpz_kronecker __GMP_PROTO ((mpz_srcptr a_orig, mpz_srcptr b_orig));
! 313: int refmpz_jacobi __GMP_PROTO ((mpz_srcptr a_orig, mpz_srcptr b_orig));
! 314: int refmpz_legendre __GMP_PROTO ((mpz_srcptr a_orig, mpz_srcptr b_orig));
! 315: int refmpz_kronecker_si __GMP_PROTO ((mpz_srcptr, long));
! 316: int refmpz_kronecker_ui __GMP_PROTO ((mpz_srcptr, unsigned long));
! 317: int refmpz_si_kronecker __GMP_PROTO ((long, mpz_srcptr));
! 318: int refmpz_ui_kronecker __GMP_PROTO ((unsigned long, mpz_srcptr));
! 319:
! 320: void refmpz_pow_ui __GMP_PROTO ((mpz_ptr w, mpz_srcptr b, unsigned long e));
! 321:
! 322:
! 323: #if defined (__cplusplus)
! 324: }
! 325: #endif
! 326:
! 327: #endif /* __TESTS_H__ */
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>