1 /* mp.h -- Definitions for Berkeley compatible multiple precision functions.
3 Copyright (C) 1991, 1993, 1994, 1995, 1996, 2000 Free Software Foundation,
6 This file is part of the GNU MP Library.
8 The GNU MP Library is free software; you can redistribute it and/or modify
9 it under the terms of the GNU Lesser General Public License as published by
10 the Free Software Foundation; either version 2.1 of the License, or (at your
11 option) any later version.
13 The GNU MP Library is distributed in the hope that it will be useful, but
14 WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
15 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
16 License for more details.
18 You should have received a copy of the GNU Lesser General Public License
19 along with the GNU MP Library; see the file COPYING.LIB. If not, write to
20 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
21 MA 02111-1307, USA. */
25 #ifndef __GNU_MP__ /* to allow inclusion of both gmp.h and mp.h */
31 #if defined (__STDC__) || defined (__cplusplus)
32 #define __gmp_const const
37 #if defined (__GNUC__)
38 #define __gmp_inline __inline__
43 #ifndef _EXTERN_INLINE
45 #define _EXTERN_INLINE extern __inline__
47 #define _EXTERN_INLINE static
52 typedef unsigned int mp_limb_t;
53 typedef int mp_limb_signed_t;
55 #ifdef _LONG_LONG_LIMB
56 typedef unsigned long long int mp_limb_t;
57 typedef long long int mp_limb_signed_t;
59 typedef unsigned long int mp_limb_t;
60 typedef long int mp_limb_signed_t;
64 typedef mp_limb_t * mp_ptr;
65 typedef __gmp_const mp_limb_t * mp_srcptr;
66 typedef int mp_size_t;
67 typedef long int mp_exp_t;
71 int _mp_alloc; /* Number of *limbs* allocated and pointed
73 int _mp_size; /* abs(SIZE) is the number of limbs
74 the last field points to. If SIZE
75 is negative this is a negative
77 mp_limb_t *_mp_d; /* Pointer to the limbs. */
79 #endif /* __GNU_MP__ */
81 /* User-visible types. */
82 typedef __mpz_struct MINT;
86 #if (__STDC__-0) || defined (__cplusplus)
93 #if defined (__cplusplus)
97 #define mp_set_memory_functions __gmp_set_memory_functions
98 void mp_set_memory_functions _PROTO ((void *(*) (size_t),
99 void *(*) (void *, size_t, size_t),
100 void (*) (void *, size_t)));
101 MINT *itom _PROTO ((signed short int));
102 MINT *xtom _PROTO ((const char *));
103 void move _PROTO ((const MINT *, MINT *));
104 void madd _PROTO ((const MINT *, const MINT *, MINT *));
105 void msub _PROTO ((const MINT *, const MINT *, MINT *));
106 void mult _PROTO ((const MINT *, const MINT *, MINT *));
107 void mdiv _PROTO ((const MINT *, const MINT *, MINT *, MINT *));
108 void sdiv _PROTO ((const MINT *, signed short int, MINT *, signed short int *));
109 void msqrt _PROTO ((const MINT *, MINT *, MINT *));
110 void pow _PROTO ((const MINT *, const MINT *, const MINT *, MINT *));
111 void rpow _PROTO ((const MINT *, signed short int, MINT *));
112 void gcd _PROTO ((const MINT *, const MINT *, MINT *));
113 int mcmp _PROTO ((const MINT *, const MINT *));
114 void min _PROTO ((MINT *));
115 void mout _PROTO ((const MINT *));
116 char *mtox _PROTO ((const MINT *));
117 void mfree _PROTO ((MINT *));
119 #if defined (__cplusplus)
124 #endif /* __MP_H__ */