xref: /titanic_41/usr/src/lib/libmp/common/libmp.h (revision cde2885fdf538266ee2a3b08dee2d5075ce8fa2b)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or http://www.opensolaris.org/os/licensing.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  */
22 /*
23  * Copyright (c) 1997 by Sun Microsystems, Inc.
24  * All rights reserved.
25  */
26 
27 /*
28  * This is where all the interfaces that are internal to libmp
29  * which do not have a better home live
30  */
31 
32 #ifndef _LIBMP_H
33 #define	_LIBMP_H
34 
35 #ident	"%Z%%M%	%I%	%E% SMI"
36 
37 #include <mp.h>
38 #include <stdio.h>
39 
40 #ifdef __cplusplus
41 extern "C" {
42 #endif
43 
44 extern short *_mp_xalloc(int, char *);
45 extern void _mp_xfree(MINT *);
46 extern void _mp_move(MINT *, MINT *);
47 extern void mp_invert(MINT *, MINT *, MINT *);
48 extern void _mp_fatal(char *);
49 extern void _mp_mcan(MINT *);
50 extern char *mtox(MINT *);
51 extern int mp_omin(MINT *);
52 extern void mp_omout(MINT *);
53 extern void mp_fmout(MINT *, FILE *);
54 extern int mp_fmin(MINT *, FILE *);
55 
56 /*
57  * old libmp interfaces
58  */
59 extern void gcd(MINT *, MINT *, MINT *);
60 extern void madd(MINT *, MINT *, MINT *);
61 extern void msub(MINT *, MINT *, MINT *);
62 extern void mdiv(MINT *, MINT *, MINT *, MINT *);
63 extern void sdiv(MINT *, short, MINT *, short *);
64 extern int min(MINT *);
65 extern void mout(MINT *);
66 extern int msqrt(MINT *, MINT *, MINT *);
67 extern void mult(MINT *, MINT *, MINT *);
68 extern void pow(MINT *, MINT *, MINT *, MINT *);
69 extern void rpow(MINT *, short, MINT *);
70 extern MINT *itom(short);
71 extern int mcmp(MINT *, MINT *);
72 extern MINT *xtom(char *);
73 extern char *mtox(MINT *);
74 extern void mfree(MINT *);
75 extern short *xalloc(int, char *);
76 extern void xfree(MINT *);
77 
78 #ifdef __cplusplus
79 }
80 #endif
81 
82 #endif /* _LIBMP_H */
83