1 #ifndef Py_LONGOBJECT_H
2 #define Py_LONGOBJECT_H
7 /***********************************************************
8 Copyright (c) 2000, BeOpen.com.
9 Copyright (c) 1995-2000, Corporation for National Research Initiatives.
10 Copyright (c) 1990-1995, Stichting Mathematisch Centrum.
13 See the file "Misc/COPYRIGHT" for information on usage and
14 redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
15 ******************************************************************/
17 /* Long (arbitrary precision) integer object interface */
19 typedef struct _longobject PyLongObject
; /* Revealed in longintrepr.h */
21 extern DL_IMPORT(PyTypeObject
) PyLong_Type
;
23 #define PyLong_Check(op) ((op)->ob_type == &PyLong_Type)
25 extern DL_IMPORT(PyObject
*) PyLong_FromLong(long);
26 extern DL_IMPORT(PyObject
*) PyLong_FromUnsignedLong(unsigned long);
27 extern DL_IMPORT(PyObject
*) PyLong_FromDouble(double);
28 extern DL_IMPORT(long) PyLong_AsLong(PyObject
*);
29 extern DL_IMPORT(unsigned long) PyLong_AsUnsignedLong(PyObject
*);
30 extern DL_IMPORT(double) PyLong_AsDouble(PyObject
*);
31 extern DL_IMPORT(PyObject
*) PyLong_FromVoidPtr(void *);
32 extern DL_IMPORT(void *) PyLong_AsVoidPtr(PyObject
*);
40 /* Hopefully this is portable... */
42 #define LONG_MAX 2147483647L
45 #define ULONG_MAX 4294967295U
48 #define LONGLONG_MAX 9223372036854775807LL
51 #define ULONGLONG_MAX 0xffffffffffffffffULL
54 #define LONG_LONG long long
57 extern DL_IMPORT(PyObject
*) PyLong_FromLongLong(LONG_LONG
);
58 extern DL_IMPORT(PyObject
*) PyLong_FromUnsignedLongLong(unsigned LONG_LONG
);
59 extern DL_IMPORT(LONG_LONG
) PyLong_AsLongLong(PyObject
*);
60 extern DL_IMPORT(unsigned LONG_LONG
) PyLong_AsUnsignedLongLong(PyObject
*);
61 #endif /* HAVE_LONG_LONG */
63 DL_IMPORT(PyObject
*) PyLong_FromString(char *, char **, int);
64 DL_IMPORT(PyObject
*) PyLong_FromUnicode(Py_UNICODE
*, int, int);
69 #endif /* !Py_LONGOBJECT_H */