blob: 76cf86d0d9ef2c6b11c7788887256c76ea33b5ee [file] [log] [blame]
Guido van Rossum85a5fbb1990-10-14 12:07:46 +00001/* List object interface */
2
3/*
4123456789-123456789-123456789-123456789-123456789-123456789-123456789-12
5
6Another generally useful object type is an list of object pointers.
7This is a mutable type: the list items can be changed, and items can be
8added or removed. Out-of-range indices or non-list objects are ignored.
9
10*** WARNING *** setlistitem does not increment the new item's reference
11count, but does decrement the reference count of the item it replaces,
12if not nil. It does *decrement* the reference count if it is *not*
13inserted in the list. Similarly, getlistitem does not increment the
14returned item's reference count.
15*/
16
17extern typeobject Listtype;
18
19#define is_listobject(op) ((op)->ob_type == &Listtype)
20
21extern object *newlistobject PROTO((int size));
22extern int getlistsize PROTO((object *));
23extern object *getlistitem PROTO((object *, int));
24extern int setlistitem PROTO((object *, int, object *));
25extern int inslistitem PROTO((object *, int, object *));
26extern int addlistitem PROTO((object *, object *));