mirror of
https://github.com/python/cpython.git
synced 2024-11-28 04:15:11 +08:00
ebe3e16600
svn+ssh://pythondev@svn.python.org/python/branches/p3yk ........ r55360 | guido.van.rossum | 2007-05-15 14:57:59 -0700 (Tue, 15 May 2007) | 2 lines obcheckin. ........ r55361 | guido.van.rossum | 2007-05-15 14:59:18 -0700 (Tue, 15 May 2007) | 2 lines Get rid of strop module. ........ r55367 | brett.cannon | 2007-05-15 21:06:28 -0700 (Tue, 15 May 2007) | 2 lines Remove the 'pure' module. ........ r55369 | brett.cannon | 2007-05-15 21:07:31 -0700 (Tue, 15 May 2007) | 2 lines Remove the lib-old directory (already empty). ........ r55370 | neal.norwitz | 2007-05-15 21:30:40 -0700 (Tue, 15 May 2007) | 1 line Get rid of a bunch more references to strop ........ r55374 | brett.cannon | 2007-05-15 21:39:00 -0700 (Tue, 15 May 2007) | 2 lines Complete the removal of IRIX-specific modules. ........ r55379 | brett.cannon | 2007-05-15 22:31:54 -0700 (Tue, 15 May 2007) | 2 lines Update removed IRIX modules based on what is gone from removing plat-irix6. ........ r55388 | brett.cannon | 2007-05-16 14:34:52 -0700 (Wed, 16 May 2007) | 2 lines Clean up the docstring for the compiler resource. ........ r55406 | brett.cannon | 2007-05-17 11:05:37 -0700 (Thu, 17 May 2007) | 2 lines Remove BaseException.message (deprecated in Python 2.6). ........
59 lines
1.7 KiB
C
59 lines
1.7 KiB
C
|
|
/* Integer object interface */
|
|
|
|
/*
|
|
PyIntObject represents a (long) integer. This is an immutable object;
|
|
an integer cannot change its value after creation.
|
|
|
|
There are functions to create new integer objects, to test an object
|
|
for integer-ness, and to get the integer value. The latter functions
|
|
returns -1 and sets errno to EBADF if the object is not an PyIntObject.
|
|
None of the functions should be applied to nil objects.
|
|
|
|
The type PyIntObject is (unfortunately) exposed here so we can declare
|
|
_Py_TrueStruct and _Py_ZeroStruct in boolobject.h; don't use this.
|
|
*/
|
|
|
|
#ifndef Py_INTOBJECT_H
|
|
#define Py_INTOBJECT_H
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
/*
|
|
typedef struct {
|
|
PyObject_HEAD
|
|
long ob_ival;
|
|
} PyIntObject;
|
|
|
|
PyAPI_DATA(PyTypeObject) PyInt_Type;
|
|
*/
|
|
|
|
#define PyInt_Check(op) PyLong_Check(op)
|
|
#define PyInt_CheckExact(op) (PyLong_CheckExact(op) && _PyLong_FitsInLong(op))
|
|
|
|
#define PyInt_FromString PyLong_FromString
|
|
#define PyInt_FromUnicode PyLong_FromUnicode
|
|
#define PyInt_FromLong PyLong_FromLong
|
|
#define PyInt_FromSize_t PyLong_FromSize_t
|
|
#define PyInt_FromSsize_t PyLong_FromSsize_t
|
|
#define PyInt_AsLong PyLong_AsLong
|
|
#define PyInt_AsSsize_t PyLong_AsSsize_t
|
|
#define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
|
|
#define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
|
|
|
|
PyAPI_FUNC(long) PyInt_GetMax(void);
|
|
|
|
#define PyInt_AS_LONG(op) PyLong_AsLong(op)
|
|
|
|
/* These aren't really part of the Int object, but they're handy; the protos
|
|
* are necessary for systems that need the magic of PyAPI_FUNC.
|
|
*/
|
|
PyAPI_FUNC(unsigned long) PyOS_strtoul(char *, char **, int);
|
|
PyAPI_FUNC(long) PyOS_strtol(char *, char **, int);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
#endif /* !Py_INTOBJECT_H */
|