1 #ifndef Py_LONGOBJECT_H
2 #define Py_LONGOBJECT_H
14 #define PyLong_Check(op) \
15 PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_LONG_SUBCLASS)
16 #define PyLong_CheckExact(op) (Py_TYPE(op) == &PyLong_Type)
24 PyAPI_FUNC(
long) PyLong_AsLongAndOverflow(PyObject *,
int *);
25 PyAPI_FUNC(
unsigned long) PyLong_AsUnsignedLong(PyObject *);
26 PyAPI_FUNC(
unsigned long) PyLong_AsUnsignedLongMask(PyObject *);
27 PyAPI_FUNC(Py_ssize_t) PyLong_AsSsize_t(PyObject *);
32 #define _PyLong_AsSsize_t PyLong_AsSsize_t
33 #define _PyLong_FromSize_t PyLong_FromSize_t
34 #define _PyLong_FromSsize_t PyLong_FromSsize_t
45 PyAPI_FUNC(
double) PyLong_AsDouble(PyObject *);
46 PyAPI_FUNC(PyObject *) PyLong_FromVoidPtr(
void *);
47 PyAPI_FUNC(
void *) PyLong_AsVoidPtr(PyObject *);
51 PyAPI_FUNC(PyObject *) PyLong_FromUnsignedLongLong(
unsigned PY_LONG_LONG);
52 PyAPI_FUNC(PY_LONG_LONG) PyLong_AsLongLong(PyObject *);
53 PyAPI_FUNC(
unsigned PY_LONG_LONG) PyLong_AsUnsignedLongLong(PyObject *);
54 PyAPI_FUNC(
unsigned PY_LONG_LONG) PyLong_AsUnsignedLongLongMask(PyObject *);
55 PyAPI_FUNC(PY_LONG_LONG) PyLong_AsLongLongAndOverflow(PyObject *,
int *);
58 PyAPI_FUNC(PyObject *) PyLong_FromString(
char *,
char **,
int);
59 #ifdef Py_USING_UNICODE
60 PyAPI_FUNC(PyObject *) PyLong_FromUnicode(Py_UNICODE*, Py_ssize_t,
int);
77 PyAPI_FUNC(
size_t) _PyLong_NumBits(PyObject *v);
93 const
unsigned char*
bytes,
size_t n,
116 unsigned char* bytes,
size_t n,
117 int little_endian,
int is_signed);