summaryrefslogtreecommitdiffstats
path: root/Include/longobject.h
diff options
context:
space:
mode:
authorChristian Heimes <christian@cheimes.de>2007-12-02 16:52:32 (GMT)
committerChristian Heimes <christian@cheimes.de>2007-12-02 16:52:32 (GMT)
commitf78b1c6573a7e4a30f799fd28acd414e5deb140d (patch)
treef9bd6ff9ecca07e3b9365cdb90de24bcfd813602 /Include/longobject.h
parent2137b6aa997209ac3529c439f82383de0219940d (diff)
downloadcpython-f78b1c6573a7e4a30f799fd28acd414e5deb140d.zip
cpython-f78b1c6573a7e4a30f799fd28acd414e5deb140d.tar.gz
cpython-f78b1c6573a7e4a30f799fd28acd414e5deb140d.tar.bz2
I've moved the remains of PyInt_ to the longobject.h header file and removed the inclusing of intobject.h from Python.h. Now the intobject.h exists only to provide some aliases for porters from Python 2.x.
Diffstat (limited to 'Include/longobject.h')
-rw-r--r--Include/longobject.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/Include/longobject.h b/Include/longobject.h
index 688b4e4..5740f98 100644
--- a/Include/longobject.h
+++ b/Include/longobject.h
@@ -14,6 +14,7 @@ PyAPI_DATA(PyTypeObject) PyLong_Type;
#define PyLong_Check(op) \
PyType_FastSubclass(Py_Type(op), Py_TPFLAGS_LONG_SUBCLASS)
#define PyLong_CheckExact(op) (Py_Type(op) == &PyLong_Type)
+#define PyInt_CheckExact(op) (PyLong_CheckExact(op) && _PyLong_FitsInLong(op))
PyAPI_FUNC(PyObject *) PyLong_FromLong(long);
PyAPI_FUNC(PyObject *) PyLong_FromUnsignedLong(unsigned long);
@@ -30,6 +31,8 @@ PyAPI_FUNC(unsigned long) PyLong_AsUnsignedLongMask(PyObject *);
cleanup to keep the extra information. [CH] */
#define PyLong_AS_LONG(op) PyLong_AsLong(op)
+PyAPI_FUNC(long) PyInt_GetMax(void);
+
/* Used by socketmodule.c */
#if SIZEOF_SOCKET_T <= SIZEOF_LONG
#define PyLong_FromSocket_t(fd) PyLong_FromLong((SOCKET_T)(fd))
@@ -127,6 +130,12 @@ PyAPI_FUNC(int) _PyLong_AsByteArray(PyLongObject* v,
appending a base prefix of 0[box] if base is 2, 8 or 16. */
PyAPI_FUNC(PyObject *) _PyLong_Format(PyObject *aa, int base);
+/* These aren't really part of the long object, but they're handy. The
+ functions are in Python/mystrtoul.c.
+ */
+PyAPI_FUNC(unsigned long) PyOS_strtoul(char *, char **, int);
+PyAPI_FUNC(long) PyOS_strtol(char *, char **, int);
+
#ifdef __cplusplus
}
#endif