Commit c52555e9 authored by Guillaume Melquiond's avatar Guillaume Melquiond

Clean wmp.h a bit.

parent 3c3b7463
#ifndef __WMP_H__
#define __WMP_H__
#include <stdlib.h>
#include <stdint.h>
typedef int32_t wmp_size_t;
......@@ -39,24 +40,26 @@ void wmpz_set_ui (wmpz_ptr, uint64_t);
void wmpz_set_si (wmpz_ptr, int64_t);
uint64_t wmpz_get_ui (wmpz_srcptr);
/* Whitespace, leading base prefix and base detection not supported.
base must be between -36 and 62, and |base| must be >= 2. */
int32_t wmpz_set_str (wmpz_ptr, const char * sp, int32_t base);
char * wmpz_get_str (char *, int32_t, wmpz_srcptr);
// whitespace, leading base prefix, and base detection are not supported.
int32_t wmpz_set_str (wmpz_ptr, char const *, int32_t base);
// not verified when size >= 0x2000000.
// sp == NULL is not supported.
char *wmpz_get_str (char *, int32_t base, wmpz_srcptr);
int32_t wmpz_cmp (wmpz_srcptr, wmpz_ptr);
int32_t wmpz_cmp (wmpz_srcptr, wmpz_srcptr);
int32_t wmpz_cmp_ui (wmpz_srcptr, uint64_t);
int32_t wmpz_cmp_si (wmpz_srcptr, int64_t);
int32_t wmpz_sgn (wmpz_srcptr);
int32_t wmpz_cmpabs (wmpz_srcptr, wmpz_ptr);
int32_t wmpz_cmpabs (wmpz_srcptr, wmpz_srcptr);
int32_t wmpz_cmpabs_ui (wmpz_srcptr, uint64_t);
int32_t wmpz_sgn (wmpz_srcptr);
void wmpz_abs (wmpz_ptr, wmpz_srcptr);
void wmpz_add (wmpz_ptr, wmpz_srcptr, wmpz_ptr);
void wmpz_add (wmpz_ptr, wmpz_srcptr, wmpz_srcptr);
void wmpz_add_ui (wmpz_ptr, wmpz_srcptr, uint64_t);
void wmpz_sub (wmpz_ptr, wmpz_srcptr, wmpz_ptr);
void wmpz_sub (wmpz_ptr, wmpz_srcptr, wmpz_srcptr);
void wmpz_sub_ui (wmpz_ptr, wmpz_srcptr, uint64_t);
void wmpz_ui_sub (wmpz_ptr, uint64_t, wmpz_srcptr);
......@@ -67,8 +70,10 @@ void wmpz_mul_ui (wmpz_ptr, wmpz_srcptr, uint64_t);
void wmpz_mul2exp (wmpz_ptr, wmpz_srcptr, uint64_t);
void wmpz_tdiv_q_2exp (wmpz_ptr, wmpz_srcptr, uint64_t);
void wmpz_tdiv_qr(wmpz_ptr, wmpz_ptr, wmpz_srcptr, wmpz_srcptr);
uint64_t wmpz_tdiv_qr_ui(wmpz_ptr, wmpz_ptr, wmpz_srcptr, uint64_t);
void wmpz_tdiv_qr (wmpz_ptr quot, wmpz_ptr rem, wmpz_srcptr, wmpz_srcptr);
uint64_t wmpz_tdiv_qr_ui (wmpz_ptr quot, wmpz_ptr rem, wmpz_srcptr, uint64_t);
int32_t wmpn_cmp (wmp_srcptr, wmp_srcptr, wmp_size_t);
......@@ -91,9 +96,6 @@ wmp_limb_t wmpn_rshift (wmp_ptr, wmp_srcptr, wmp_size_t, uint64_t);
void wmpn_powm (wmp_ptr, wmp_srcptr, wmp_size_t, wmp_srcptr, wmp_size_t,
wmp_srcptr, wmp_size_t, wmp_ptr);
size_t wmpn_get_str(unsigned char *, int, wmp_srcptr, wmp_size_t);
wmp_size_t wmpn_set_str(wmp_ptr, unsigned const char *, size_t, int);
// not verified when rp and up are aliased.
wmp_limb_t wmpn_add_1 (wmp_ptr rp, wmp_srcptr up, wmp_size_t, wmp_limb_t);
wmp_limb_t wmpn_sub_1 (wmp_ptr rp, wmp_srcptr up, wmp_size_t, wmp_limb_t);
......@@ -111,6 +113,10 @@ void wmpn_tdiv_qr (wmp_ptr qp, wmp_ptr rp, wmp_size_t qxn, wmp_srcptr np,
// not verified when rp and np are aliased.
wmp_size_t wmpn_sqrtrem (wmp_ptr sp, wmp_ptr rp, wmp_srcptr np, wmp_size_t);
wmp_size_t wmpn_set_str (wmp_ptr, unsigned char const *, uint32_t, int32_t base);
// not verified when un >= 0x2000000
wmp_size_t wmpn_get_str (unsigned char *, int32_t base, wmp_srcptr, wmp_size_t);
#ifdef __cplusplus
}
#endif
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment