|
| 1 | +/* Integer object interface |
1 | 2 |
|
2 | | -/* Integer object interface */ |
3 | | - |
4 | | -/* |
5 | | -PyIntObject represents a (long) integer. This is an immutable object; |
6 | | -an integer cannot change its value after creation. |
7 | | -
|
8 | | -There are functions to create new integer objects, to test an object |
9 | | -for integer-ness, and to get the integer value. The latter functions |
10 | | -returns -1 and sets errno to EBADF if the object is not an PyIntObject. |
11 | | -None of the functions should be applied to nil objects. |
12 | | -
|
13 | | -The type PyIntObject is (unfortunately) exposed here so we can declare |
14 | | -_Py_TrueStruct and _Py_ZeroStruct in boolobject.h; don't use this. |
15 | | -*/ |
| 3 | + This header files exists to make porting code to Python 3.0 easier. It |
| 4 | + defines aliases from PyInt_* to PyLong_*. Only PyInt_GetMax() and |
| 5 | + PyInt_CheckExact() remain in longobject.h. |
| 6 | + */ |
16 | 7 |
|
17 | 8 | #ifndef Py_INTOBJECT_H |
18 | 9 | #define Py_INTOBJECT_H |
19 | 10 | #ifdef __cplusplus |
20 | 11 | extern "C" { |
21 | 12 | #endif |
22 | 13 |
|
23 | | -/* |
24 | | -typedef struct { |
25 | | - PyObject_HEAD |
26 | | - long ob_ival; |
27 | | -} PyIntObject; |
28 | | -
|
29 | | -PyAPI_DATA(PyTypeObject) PyInt_Type; |
30 | | -*/ |
31 | | - |
32 | | -#define PyInt_CheckExact(op) (PyLong_CheckExact(op) && _PyLong_FitsInLong(op)) |
33 | | - |
34 | | -#if 0 |
35 | | -# define PyInt_Check(op) PyLong_Check(op) |
36 | | -# define PyInt_FromString PyLong_FromString |
37 | | -# define PyInt_FromUnicode PyLong_FromUnicode |
38 | | -# define PyInt_FromLong PyLong_FromLong |
39 | | -# define PyInt_FromSize_t PyLong_FromSize_t |
40 | | -# define PyInt_FromSsize_t PyLong_FromSsize_t |
41 | | -# define PyInt_AsLong PyLong_AsLong |
42 | | -# define PyInt_AsSsize_t PyLong_AsSsize_t |
43 | | -# define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask |
44 | | -# define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask |
45 | | -# define PyInt_AS_LONG PyLong_AS_LONG |
46 | | -#endif |
47 | | - |
48 | | -PyAPI_FUNC(long) PyInt_GetMax(void); |
49 | | - |
50 | | -/* These aren't really part of the Int object, but they're handy; the protos |
51 | | - * are necessary for systems that need the magic of PyAPI_FUNC. |
52 | | - */ |
53 | | -PyAPI_FUNC(unsigned long) PyOS_strtoul(char *, char **, int); |
54 | | -PyAPI_FUNC(long) PyOS_strtol(char *, char **, int); |
| 14 | +#warning "DeprecationWarning: intobject.h is going to be removed in 3.1" |
| 15 | + |
| 16 | +#define PyInt_Check(op) PyLong_Check(op) |
| 17 | +#define PyInt_FromString PyLong_FromString |
| 18 | +#define PyInt_FromUnicode PyLong_FromUnicode |
| 19 | +#define PyInt_FromLong PyLong_FromLong |
| 20 | +#define PyInt_FromSize_t PyLong_FromSize_t |
| 21 | +#define PyInt_FromSsize_t PyLong_FromSsize_t |
| 22 | +#define PyInt_AsLong PyLong_AsLong |
| 23 | +#define PyInt_AsSsize_t PyLong_AsSsize_t |
| 24 | +#define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask |
| 25 | +#define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask |
| 26 | +#define PyInt_AS_LONG PyLong_AS_LONG |
55 | 27 |
|
56 | 28 | #ifdef __cplusplus |
57 | 29 | } |
|
0 commit comments