#include <catacomb/mpmont.h>
#include <catacomb/mpbarrett.h>
#include <catacomb/mpreduce.h>
#include <catacomb/mpmont.h>
#include <catacomb/mpbarrett.h>
#include <catacomb/mpreduce.h>
#define VALERR(str) EXCERR(PyExc_ValueError, str)
#define TYERR(str) EXCERR(PyExc_TypeError, str)
#define ZDIVERR(str) EXCERR(PyExc_ZeroDivisionError, str)
#define VALERR(str) EXCERR(PyExc_ValueError, str)
#define TYERR(str) EXCERR(PyExc_TypeError, str)
#define ZDIVERR(str) EXCERR(PyExc_ZeroDivisionError, str)
#define SYSERR(str) EXCERR(PyExc_SystemError, str)
#define NIERR(str) EXCERR(PyExc_NotImplementedError, str)
#define INDEXERR(idx) do { \
#define SYSERR(str) EXCERR(PyExc_SystemError, str)
#define NIERR(str) EXCERR(PyExc_NotImplementedError, str)
#define INDEXERR(idx) do { \
{ #name, ty, offsetof(MEMBERSTRUCT, name), f, doc },
#define MODULES(_) \
{ #name, ty, offsetof(MEMBERSTRUCT, name), f, doc },
#define MODULES(_) \
_(bytestring) _(buffer) \
_(rand) _(algorithms) _(pubkey) _(pgen) \
_(mp) _(field) _(ec) _(group) \
_(bytestring) _(buffer) \
_(rand) _(algorithms) _(pubkey) _(pgen) \
_(mp) _(field) _(ec) _(group) \
#define DOMODINIT(m) m##_pyinit();
#define DOMODINSERT(m) m##_pyinsert(mod);
#define INIT_MODULES do { MODULES(DOMODINIT) } while (0)
#define DOMODINIT(m) m##_pyinit();
#define DOMODINSERT(m) m##_pyinsert(mod);
#define INIT_MODULES do { MODULES(DOMODINIT) } while (0)
extern PyObject *getulong(unsigned long);
extern void *newtype(PyTypeObject *, const PyTypeObject *, const char *);
extern PyObject *getulong(unsigned long);
extern void *newtype(PyTypeObject *, const PyTypeObject *, const char *);
-extern PyObject * mkexc(PyObject *, PyObject *, const char *, PyMethodDef *);
+extern PyObject *mkexc(PyObject *, PyObject *, const char *, PyMethodDef *);
+extern void typeready(PyTypeObject *);
extern PyTypeObject *inittype(PyTypeObject *);
extern void addmethods(const PyMethodDef *);
extern PyMethodDef *donemethods(void);
extern PyTypeObject *inittype(PyTypeObject *);
extern void addmethods(const PyMethodDef *);
extern PyMethodDef *donemethods(void);
GMAP_DOMETHODS(GMAP_METHDECL, GMAP_KWMETHDECL)
#define GMAP_ROMETHODS GMAP_DOROMETHODS(GMAP_METH, GMAP_KWMETH)
#define GMAP_METHODS GMAP_DOMETHODS(GMAP_METH, GMAP_KWMETH)
GMAP_DOMETHODS(GMAP_METHDECL, GMAP_KWMETHDECL)
#define GMAP_ROMETHODS GMAP_DOROMETHODS(GMAP_METH, GMAP_KWMETH)
#define GMAP_METHODS GMAP_DOMETHODS(GMAP_METH, GMAP_KWMETH)
extern mp *mp_frompyobject(PyObject *, int);
extern PyObject *mp_topystring(mp *, int,
const char *, const char *, const char *);
extern mp *mp_frompyobject(PyObject *, int);
extern PyObject *mp_topystring(mp *, int,
const char *, const char *, const char *);