summaryrefslogtreecommitdiffstats
path: root/Include/listobject.h
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1995-01-12 11:45:45 (GMT)
committerGuido van Rossum <guido@python.org>1995-01-12 11:45:45 (GMT)
commitcaa63808861d4e92d4dc1005fc01de0f2e4a8fd0 (patch)
tree3771531169ab510aca9b69cdc4d9de2b5c8810c4 /Include/listobject.h
parent94390ec2a6ea5acbea9dead528ce067c396a0301 (diff)
downloadcpython-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/listobject.h')
-rw-r--r--Include/listobject.h36
1 files changed, 18 insertions, 18 deletions
diff --git a/Include/listobject.h b/Include/listobject.h
index f14286e..083a44b 100644
--- a/Include/listobject.h
+++ b/Include/listobject.h
@@ -37,35 +37,35 @@ Another generally useful object type is an list of object pointers.
This is a mutable type: the list items can be changed, and items can be
added or removed. Out-of-range indices or non-list objects are ignored.
-*** WARNING *** setlistitem does not increment the new item's reference
+*** WARNING *** PyList_SetItem does not increment the new item's reference
count, but does decrement the reference count of the item it replaces,
if not nil. It does *decrement* the reference count if it is *not*
-inserted in the list. Similarly, getlistitem does not increment the
+inserted in the list. Similarly, PyList_GetItem does not increment the
returned item's reference count.
*/
typedef struct {
- OB_VARHEAD
- object **ob_item;
-} listobject;
+ PyObject_VAR_HEAD
+ PyObject **ob_item;
+} PyListObject;
-extern DL_IMPORT typeobject Listtype;
+extern DL_IMPORT PyTypeObject PyList_Type;
-#define is_listobject(op) ((op)->ob_type == &Listtype)
+#define PyList_Check(op) ((op)->ob_type == &PyList_Type)
-extern object *newlistobject PROTO((int size));
-extern int getlistsize PROTO((object *));
-extern object *getlistitem PROTO((object *, int));
-extern int setlistitem PROTO((object *, int, object *));
-extern int inslistitem PROTO((object *, int, object *));
-extern int addlistitem PROTO((object *, object *));
-extern object *getlistslice PROTO((object *, int, int));
-extern int setlistslice PROTO((object *, int, int, object *));
-extern int sortlist PROTO((object *));
-extern object *listtuple PROTO((object *));
+extern PyObject *PyList_New Py_PROTO((int size));
+extern int PyList_Size Py_PROTO((PyObject *));
+extern PyObject *PyList_GetItem Py_PROTO((PyObject *, int));
+extern int PyList_SetItem Py_PROTO((PyObject *, int, PyObject *));
+extern int PyList_Insert Py_PROTO((PyObject *, int, PyObject *));
+extern int PyList_Append Py_PROTO((PyObject *, PyObject *));
+extern PyObject *PyList_GetSlice Py_PROTO((PyObject *, int, int));
+extern int PyList_SetSlice Py_PROTO((PyObject *, int, int, PyObject *));
+extern int PyList_Sort Py_PROTO((PyObject *));
+extern PyObject *listtuple Py_PROTO((PyObject *));
/* Macro, trading safety for speed */
-#define GETLISTITEM(op, i) ((op)->ob_item[i])
+#define PyList_GET_ITEM(op, i) ((op)->ob_item[i])
#ifdef __cplusplus
}