diff options
author | Guido van Rossum <guido@python.org> | 1995-01-12 11:45:45 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1995-01-12 11:45:45 (GMT) |
commit | caa63808861d4e92d4dc1005fc01de0f2e4a8fd0 (patch) | |
tree | 3771531169ab510aca9b69cdc4d9de2b5c8810c4 /Include/intobject.h | |
parent | 94390ec2a6ea5acbea9dead528ce067c396a0301 (diff) | |
download | cpython-caa63808861d4e92d4dc1005fc01de0f2e4a8fd0.zip cpython-caa63808861d4e92d4dc1005fc01de0f2e4a8fd0.tar.gz cpython-caa63808861d4e92d4dc1005fc01de0f2e4a8fd0.tar.bz2 |
The great renaming, phase two: all header files have been updated to
use the new names exclusively, and the linker will see the new names.
Files that import "Python.h" also only see the new names. Files that
import "allobjects.h" will continue to be able to use the old names,
due to the inclusion (in allobjects.h) of "rename2.h".
Diffstat (limited to 'Include/intobject.h')
-rw-r--r-- | Include/intobject.h | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/Include/intobject.h b/Include/intobject.h index 91d4c09..6e2344a 100644 --- a/Include/intobject.h +++ b/Include/intobject.h @@ -33,29 +33,29 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. /* 123456789-123456789-123456789-123456789-123456789-123456789-123456789-12 -intobject represents a (long) integer. This is an immutable object; +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 intobject. +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 intobject is (unfortunately) exposed bere so we can declare -TrueObject and FalseObject below; don't use this. +The type PyIntObject is (unfortunately) exposed here so we can declare +_Py_TrueStruct and _Py_ZeroStruct below; don't use this. */ typedef struct { - OB_HEAD + PyObject_HEAD long ob_ival; -} intobject; +} PyIntObject; -extern DL_IMPORT typeobject Inttype; +extern DL_IMPORT PyTypeObject PyInt_Type; -#define is_intobject(op) ((op)->ob_type == &Inttype) +#define PyInt_Check(op) ((op)->ob_type == &PyInt_Type) -extern object *newintobject PROTO((long)); -extern long getintvalue PROTO((object *)); +extern PyObject *PyInt_FromLong Py_PROTO((long)); +extern long PyInt_AsLong Py_PROTO((PyObject *)); /* @@ -66,16 +66,16 @@ All values of type Boolean must point to either of these; but in contexts where integers are required they are integers (valued 0 and 1). Hope these macros don't conflict with other people's. -Don't forget to apply INCREF() when returning True or False!!! +Don't forget to apply Py_INCREF() when returning True or False!!! */ -extern DL_IMPORT intobject FalseObject, TrueObject; /* Don't use these directly */ +extern DL_IMPORT PyIntObject _Py_ZeroStruct, _Py_TrueStruct; /* Don't use these directly */ -#define False ((object *) &FalseObject) -#define True ((object *) &TrueObject) +#define Py_False ((PyObject *) &_Py_ZeroStruct) +#define Py_True ((PyObject *) &_Py_TrueStruct) /* Macro, trading safety for speed */ -#define GETINTVALUE(op) ((op)->ob_ival) +#define PyInt_AS_LONG(op) ((op)->ob_ival) #ifdef __cplusplus } |