/*
* Use is subject to license terms.
*
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this library; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/* *********************************************************************
*
* The Original Code is the MPI Arbitrary Precision Integer Arithmetic library.
*
* The Initial Developer of the Original Code is
* Michael J. Fromberger.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Netscape Communications Corporation
*
*********************************************************************** */
/* Arbitrary precision integer arithmetic library */
#ifndef _MPI_H
#define _MPI_H
/* $Id: mpi.h,v 1.22 2004/04/27 23:04:36 gerv%gerv.net Exp $ */
#include "mpi-config.h"
#ifndef _WIN32
#endif /* _WIN32 */
#ifdef _KERNEL
#define labs(a) (a >= 0 ? a : -a)
/*
* Generic #define's to cover missing things in the kernel
*/
#ifndef isdigit
#endif
#ifndef isupper
#endif
#ifndef islower
#endif
#ifndef isalpha
#endif
#ifndef toupper
#endif
#ifndef tolower
#endif
#ifndef isspace
((x) == '\t') || ((x) == '\b'))
#endif
#endif /* _KERNEL */
#if MP_DEBUG
#endif
#if MP_IOFUNC
#include <stdio.h>
#include <ctype.h>
#endif
#ifndef _KERNEL
#include <limits.h>
#endif
#if defined(BSDI)
#endif
#if defined( macintosh )
#include <Types.h>
#elif defined( _WIN32_WCE)
#else
#endif
#define MP_ZPOS 0
typedef unsigned int mp_sign;
typedef unsigned int mp_size;
typedef int mp_err;
typedef int mp_flag;
#if !defined(ULONG_MAX)
#error "ULONG_MAX not defined"
#error "UINT_MAX not defined"
#error "USHRT_MAX not defined"
#endif
#if defined(ULONG_LONG_MAX) /* GCC, HPUX */
/* MP_ULONG_LONG_MAX was defined to be ULLONG_MAX */
#endif
/* We only use unsigned long for mp_digit iff long is more than 32 bits. */
typedef unsigned long mp_digit;
typedef unsigned long long mp_digit;
#else
typedef unsigned int mp_digit;
#endif
#if !defined(MP_NO_MP_WORD)
#if defined(MP_USE_UINT_DIGIT) && \
typedef unsigned long mp_word;
typedef long mp_sword;
#else
typedef unsigned long long mp_word;
typedef long long mp_sword;
#endif
#else
#endif
#endif /* !defined(MP_NO_MP_WORD) */
#if !defined(MP_WORD_MAX) && defined(MP_DEFINE_SMALL_WORD)
typedef unsigned int mp_word;
typedef int mp_sword;
#endif
#ifndef CHAR_BIT
#endif
/* MP_HALF_RADIX really ought to be called MP_SQRT_RADIX, but it's named
** MP_HALF_RADIX because it's the radix for MP_HALF_DIGITs, and it's
** consistent with the other _HALF_ names.
*/
/* Macros for accessing the mp_int internals */
/* This defines the maximum I/O base (minimum is 2) */
typedef struct {
} mp_int;
/* Default precision */
mp_size mp_get_prec(void);
/* Memory management */
/* Single digit arithmetic */
/* Sign manipulations */
/* Full arithmetic */
#if MP_SQUARE
#else
#endif
/* Modular arithmetic */
#if MP_MODARITH
#if MP_SQUARE
#else
#endif
#endif /* MP_MODARITH */
/* Comparisons */
/* Number theoretic */
#if MP_NUMTH
#endif /* end MP_NUMTH */
/* Input and output */
#if MP_IOFUNC
#endif /* end MP_IOFUNC */
/* Base conversion */
int mp_tovalue(char ch, int r);
/* Error strings */
/* Octet string conversion functions */
/* Miscellaneous */
#if defined(MP_API_COMPATIBLE)
#if MP_ARGCHK == 1
#define ARGCHK(X,Y) {if(!(X)){return (Y);}}
#ifdef _KERNEL
#else
#include <assert.h>
#endif
#else
#endif
#endif /* defined MP_API_COMPATIBLE */
#endif /* _MPI_H */