| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
#ifndef Py_INTOBJECT_H |
| 18 |
#define Py_INTOBJECT_H |
| 19 |
#ifdef __cplusplus |
| 20 |
extern "C" { |
| 21 |
#endif |
| 22 |
|
| 23 |
typedef struct { |
| 24 |
PyObject_HEAD |
| 25 |
long ob_ival; |
| 26 |
} PyIntObject; |
| 27 |
|
| 28 |
PyAPI_DATA(PyTypeObject) PyInt_Type; |
| 29 |
|
| 30 |
#define PyInt_Check(op) \ |
| 31 |
PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_INT_SUBCLASS) |
| 32 |
#define PyInt_CheckExact(op) (Py_TYPE(op) == &PyInt_Type) |
| 33 |
|
| 34 |
#define _PyAnyInt_Check(op) (PyInt_Check(op) || PyLong_Check(op)) |
| 35 |
#define _PyAnyInt_CheckExact(op) (PyInt_CheckExact(op) || PyLong_CheckExact(op)) |
| 36 |
|
| 37 |
PyAPI_FUNC(PyObject *) PyInt_FromString(char*, char**, int); |
| 38 |
#ifdef Py_USING_UNICODE |
| 39 |
PyAPI_FUNC(PyObject *) PyInt_FromUnicode(Py_UNICODE*, Py_ssize_t, int); |
| 40 |
#endif |
| 41 |
PyAPI_FUNC(PyObject *) PyInt_FromLong(long); |
| 42 |
PyAPI_FUNC(PyObject *) PyInt_FromSize_t(size_t); |
| 43 |
PyAPI_FUNC(PyObject *) PyInt_FromSsize_t(Py_ssize_t); |
| 44 |
PyAPI_FUNC(long) PyInt_AsLong(PyObject *); |
| 45 |
PyAPI_FUNC(Py_ssize_t) PyInt_AsSsize_t(PyObject *); |
| 46 |
PyAPI_FUNC(int) _PyInt_AsInt(PyObject *); |
| 47 |
PyAPI_FUNC(unsigned long) PyInt_AsUnsignedLongMask(PyObject *); |
| 48 |
#ifdef HAVE_LONG_LONG |
| 49 |
PyAPI_FUNC(unsigned PY_LONG_LONG) PyInt_AsUnsignedLongLongMask(PyObject *); |
| 50 |
#endif |
| 51 |
|
| 52 |
PyAPI_FUNC(long) PyInt_GetMax(void); |
| 53 |
|
| 54 |
|
| 55 |
#define PyInt_AS_LONG(op) (((PyIntObject *)(op))->ob_ival) |
| 56 |
|
| 57 |
|
| 58 |
|
| 59 |
|
| 60 |
|
| 61 |
|
| 62 |
|
| 63 |
PyAPI_FUNC(unsigned long) PyOS_strtoul(char *, char **, int); |
| 64 |
PyAPI_FUNC(long) PyOS_strtol(char *, char **, int); |
| 65 |
|
| 66 |
|
| 67 |
PyAPI_FUNC(int) PyInt_ClearFreeList(void); |
| 68 |
|
| 69 |
|
| 70 |
|
| 71 |
|
| 72 |
|
| 73 |
PyAPI_FUNC(PyObject*) _PyInt_Format(PyIntObject* v, int base, int newstyle); |
| 74 |
|
| 75 |
|
| 76 |
|
| 77 |
PyAPI_FUNC(PyObject *) _PyInt_FormatAdvanced(PyObject *obj, |
| 78 |
char *format_spec, |
| 79 |
Py_ssize_t format_spec_len); |
| 80 |
|
| 81 |
#ifdef __cplusplus |
| 82 |
} |
| 83 |
#endif |
| 84 |
#endif |