version 1.1.1.1, 2000/01/10 15:35:22 |
version 1.1.1.3, 2000/12/01 05:44:39 |
|
|
/* mp.h -- Definitions for Berkeley compatible multiple precision functions. |
/* mp.h -- Definitions for Berkeley compatible multiple precision functions. |
|
|
Copyright (C) 1991, 1993, 1994, 1995, 1996 Free Software Foundation, Inc. |
Copyright (C) 1991, 1993, 1994, 1995, 1996, 2000 Free Software Foundation, |
|
Inc. |
|
|
This file is part of the GNU MP Library. |
This file is part of the GNU MP Library. |
|
|
The GNU MP Library is free software; you can redistribute it and/or modify |
The GNU MP Library is free software; you can redistribute it and/or modify |
it under the terms of the GNU Library General Public License as published by |
it under the terms of the GNU Lesser General Public License as published by |
the Free Software Foundation; either version 2 of the License, or (at your |
the Free Software Foundation; either version 2.1 of the License, or (at your |
option) any later version. |
option) any later version. |
|
|
The GNU MP Library is distributed in the hope that it will be useful, but |
The GNU MP Library is distributed in the hope that it will be useful, but |
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY |
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY |
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public |
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public |
License for more details. |
License for more details. |
|
|
You should have received a copy of the GNU Library General Public License |
You should have received a copy of the GNU Lesser General Public License |
along with the GNU MP Library; see the file COPYING.LIB. If not, write to |
along with the GNU MP Library; see the file COPYING.LIB. If not, write to |
the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, |
the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, |
MA 02111-1307, USA. */ |
MA 02111-1307, USA. */ |
|
|
#ifndef __MP_H__ |
#ifndef __MP_H__ |
|
|
#ifndef __GNU_MP__ |
#ifndef __GNU_MP__ /* to allow inclusion of both gmp.h and mp.h */ |
#define __GNU_MP__ 2 |
#define __GNU_MP__ 3 |
#define __need_size_t |
#define __need_size_t |
#include <stddef.h> |
#include <stddef.h> |
#undef __need_size_t |
#undef __need_size_t |
Line 65 typedef __gmp_const mp_limb_t * mp_srcptr; |
|
Line 66 typedef __gmp_const mp_limb_t * mp_srcptr; |
|
typedef int mp_size_t; |
typedef int mp_size_t; |
typedef long int mp_exp_t; |
typedef long int mp_exp_t; |
|
|
#ifndef __MP_SMALL__ |
|
typedef struct |
typedef struct |
{ |
{ |
mp_size_t _mp_alloc; /* Number of *limbs* allocated and pointed |
int _mp_alloc; /* Number of *limbs* allocated and pointed |
to by the D field. */ |
to by the D field. */ |
mp_size_t _mp_size; /* abs(SIZE) is the number of limbs |
int _mp_size; /* abs(SIZE) is the number of limbs |
the last field points to. If SIZE |
the last field points to. If SIZE |
is negative this is a negative |
is negative this is a negative |
number. */ |
number. */ |
mp_limb_t *_mp_d; /* Pointer to the limbs. */ |
|
} __mpz_struct; |
|
#else |
|
typedef struct |
|
{ |
|
short int _mp_alloc; /* Number of *limbs* allocated and pointed |
|
to by the D field. */ |
|
short int _mp_size; /* abs(SIZE) is the number of limbs |
|
the last field points to. If SIZE |
|
is negative this is a negative |
|
number. */ |
|
mp_limb_t *_mp_d; /* Pointer to the limbs. */ |
mp_limb_t *_mp_d; /* Pointer to the limbs. */ |
} __mpz_struct; |
} __mpz_struct; |
#endif |
|
#endif /* __GNU_MP__ */ |
#endif /* __GNU_MP__ */ |
|
|
/* User-visible types. */ |
/* User-visible types. */ |
typedef __mpz_struct MINT; |
typedef __mpz_struct MINT; |
|
|
#ifdef __STDC__ |
|
void mp_set_memory_functions (void *(*) (size_t), |
|
void *(*) (void *, size_t, size_t), |
|
void (*) (void *, size_t)); |
|
MINT *itom (signed short int); |
|
MINT *xtom (const char *); |
|
void move (const MINT *, MINT *); |
|
void madd (const MINT *, const MINT *, MINT *); |
|
void msub (const MINT *, const MINT *, MINT *); |
|
void mult (const MINT *, const MINT *, MINT *); |
|
void mdiv (const MINT *, const MINT *, MINT *, MINT *); |
|
void sdiv (const MINT *, signed short int, MINT *, signed short int *); |
|
void msqrt (const MINT *, MINT *, MINT *); |
|
void pow (const MINT *, const MINT *, const MINT *, MINT *); |
|
void rpow (const MINT *, signed short int, MINT *); |
|
void gcd (const MINT *, const MINT *, MINT *); |
|
int mcmp (const MINT *, const MINT *); |
|
void min (MINT *); |
|
void mout (const MINT *); |
|
char *mtox (const MINT *); |
|
void mfree (MINT *); |
|
|
|
|
#ifndef _PROTO |
|
#if (__STDC__-0) || defined (__cplusplus) |
|
#define _PROTO(x) x |
#else |
#else |
|
#define _PROTO(x) () |
|
#endif |
|
#endif |
|
|
void mp_set_memory_functions (); |
#if defined (__cplusplus) |
MINT *itom (); |
extern "C" { |
MINT *xtom (); |
#endif |
void move (); |
|
void madd (); |
#define mp_set_memory_functions __gmp_set_memory_functions |
void msub (); |
void mp_set_memory_functions _PROTO ((void *(*) (size_t), |
void mult (); |
void *(*) (void *, size_t, size_t), |
void mdiv (); |
void (*) (void *, size_t))); |
void sdiv (); |
MINT *itom _PROTO ((signed short int)); |
void msqrt (); |
MINT *xtom _PROTO ((const char *)); |
void pow (); |
void move _PROTO ((const MINT *, MINT *)); |
void rpow (); |
void madd _PROTO ((const MINT *, const MINT *, MINT *)); |
void gcd (); |
void msub _PROTO ((const MINT *, const MINT *, MINT *)); |
int mcmp (); |
void mult _PROTO ((const MINT *, const MINT *, MINT *)); |
void min (); |
void mdiv _PROTO ((const MINT *, const MINT *, MINT *, MINT *)); |
void mout (); |
void sdiv _PROTO ((const MINT *, signed short int, MINT *, signed short int *)); |
char *mtox (); |
void msqrt _PROTO ((const MINT *, MINT *, MINT *)); |
void mfree (); |
void pow _PROTO ((const MINT *, const MINT *, const MINT *, MINT *)); |
|
void rpow _PROTO ((const MINT *, signed short int, MINT *)); |
|
void gcd _PROTO ((const MINT *, const MINT *, MINT *)); |
|
int mcmp _PROTO ((const MINT *, const MINT *)); |
|
void min _PROTO ((MINT *)); |
|
void mout _PROTO ((const MINT *)); |
|
char *mtox _PROTO ((const MINT *)); |
|
void mfree _PROTO ((MINT *)); |
|
|
|
#if defined (__cplusplus) |
|
} |
#endif |
#endif |
|
|
#define __MP_H__ |
#define __MP_H__ |