#ifndef MPN_PYLONG_H1#define MPN_PYLONG_H23#include <Python.h>4#include <gmp.h>56/************************************************************/78/* Python internals for pylong */910#include <longintrepr.h>11typedef int py_size_t; /* what python uses for ob_size */1213/************************************************************/1415/* mpn -> pylong conversion */1617int mpn_pylong_size (mp_ptr up, mp_size_t un);1819/* Assume digits points to a chunk of size size20* where size >= mpn_pylong_size(up, un)21*/22void mpn_get_pylong (digit *digits, py_size_t size, mp_ptr up, mp_size_t un);2324/************************************************************/2526/* pylong -> mpn conversion */2728mp_size_t mpn_size_from_pylong (digit *digits, py_size_t size);2930/* Assume up points to a chunk of size un31* where un >= mpn_size_from_pylong(digits, size)32*/33void mpn_set_pylong (mp_ptr up, mp_size_t un, digit *digits, py_size_t size);3435/************************************************************/3637/* Python hashing */3839/*40* for an mpz, this number has to be multiplied by the sign41* also remember to catch -1 and map it to -2 !42*/4344long mpn_pythonhash (mp_ptr up, mp_size_t un);4546/************************************************************/4748#endif495051