Bump version to 0.9.1.
[python/dscho.git] / Include / longobject.h
blobf8a6408106908d1240dc24b2e14886a51f49c938
1 #ifndef Py_LONGOBJECT_H
2 #define Py_LONGOBJECT_H
3 #ifdef __cplusplus
4 extern "C" {
5 #endif
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.
11 All rights reserved.
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 *);
34 #ifdef HAVE_LONG_LONG
36 #ifdef HAVE_LIMITS_H
37 #include <limits.h>
38 #endif
40 /* Hopefully this is portable... */
41 #ifndef LONG_MAX
42 #define LONG_MAX 2147483647L
43 #endif
44 #ifndef ULONG_MAX
45 #define ULONG_MAX 4294967295U
46 #endif
47 #ifndef LONGLONG_MAX
48 #define LONGLONG_MAX 9223372036854775807LL
49 #endif
50 #ifndef ULONGLONG_MAX
51 #define ULONGLONG_MAX 0xffffffffffffffffULL
52 #endif
53 #ifndef LONG_LONG
54 #define LONG_LONG long long
55 #endif
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);
66 #ifdef __cplusplus
68 #endif
69 #endif /* !Py_LONGOBJECT_H */