annotate Tools/modulator/Templates/object_tp_as_sequence @ 54294:dba767bc3155 legacy-trunk

remove mention of old ctypes version
author Benjamin Peterson <benjamin@python.org>
date Sat, 23 May 2009 20:59:09 +0000
parents 847425d5bca8
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2466
322fc596f1c4 checkin of Jack's original version
Guido van Rossum <guido@python.org>
parents:
diff changeset
1
322fc596f1c4 checkin of Jack's original version
Guido van Rossum <guido@python.org>
parents:
diff changeset
2 /* Code to handle accessing $name$ objects as sequence objects */
322fc596f1c4 checkin of Jack's original version
Guido van Rossum <guido@python.org>
parents:
diff changeset
3
322fc596f1c4 checkin of Jack's original version
Guido van Rossum <guido@python.org>
parents:
diff changeset
4 static int
21561
847425d5bca8 Patches by Jens B. Jorgensen with small mods by me:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2713
diff changeset
5 $abbrev$_length($abbrev$object *self)
2466
322fc596f1c4 checkin of Jack's original version
Guido van Rossum <guido@python.org>
parents:
diff changeset
6 {
322fc596f1c4 checkin of Jack's original version
Guido van Rossum <guido@python.org>
parents:
diff changeset
7 /* XXXX Return the size of the object */
322fc596f1c4 checkin of Jack's original version
Guido van Rossum <guido@python.org>
parents:
diff changeset
8 }
322fc596f1c4 checkin of Jack's original version
Guido van Rossum <guido@python.org>
parents:
diff changeset
9
2713
cd9d86ecc175 Templates converted to new naming conventions (thanks to Chak Tan)
Jack Jansen <jack.jansen@cwi.nl>
parents: 2466
diff changeset
10 static PyObject *
21561
847425d5bca8 Patches by Jens B. Jorgensen with small mods by me:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2713
diff changeset
11 $abbrev$_concat($abbrev$object *self, PyObject *bb)
2466
322fc596f1c4 checkin of Jack's original version
Guido van Rossum <guido@python.org>
parents:
diff changeset
12 {
322fc596f1c4 checkin of Jack's original version
Guido van Rossum <guido@python.org>
parents:
diff changeset
13 /* XXXX Return the concatenation of self and bb */
322fc596f1c4 checkin of Jack's original version
Guido van Rossum <guido@python.org>
parents:
diff changeset
14 }
322fc596f1c4 checkin of Jack's original version
Guido van Rossum <guido@python.org>
parents:
diff changeset
15
2713
cd9d86ecc175 Templates converted to new naming conventions (thanks to Chak Tan)
Jack Jansen <jack.jansen@cwi.nl>
parents: 2466
diff changeset
16 static PyObject *
21561
847425d5bca8 Patches by Jens B. Jorgensen with small mods by me:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2713
diff changeset
17 $abbrev$_repeat($abbrev$object *self, int n)
2466
322fc596f1c4 checkin of Jack's original version
Guido van Rossum <guido@python.org>
parents:
diff changeset
18 {
322fc596f1c4 checkin of Jack's original version
Guido van Rossum <guido@python.org>
parents:
diff changeset
19 /* XXXX Return a new object that is n times self */
322fc596f1c4 checkin of Jack's original version
Guido van Rossum <guido@python.org>
parents:
diff changeset
20 }
322fc596f1c4 checkin of Jack's original version
Guido van Rossum <guido@python.org>
parents:
diff changeset
21
2713
cd9d86ecc175 Templates converted to new naming conventions (thanks to Chak Tan)
Jack Jansen <jack.jansen@cwi.nl>
parents: 2466
diff changeset
22 static PyObject *
21561
847425d5bca8 Patches by Jens B. Jorgensen with small mods by me:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2713
diff changeset
23 $abbrev$_item($abbrev$object *self, int i)
2466
322fc596f1c4 checkin of Jack's original version
Guido van Rossum <guido@python.org>
parents:
diff changeset
24 {
322fc596f1c4 checkin of Jack's original version
Guido van Rossum <guido@python.org>
parents:
diff changeset
25 /* XXXX Return the i-th object of self */
322fc596f1c4 checkin of Jack's original version
Guido van Rossum <guido@python.org>
parents:
diff changeset
26 }
322fc596f1c4 checkin of Jack's original version
Guido van Rossum <guido@python.org>
parents:
diff changeset
27
2713
cd9d86ecc175 Templates converted to new naming conventions (thanks to Chak Tan)
Jack Jansen <jack.jansen@cwi.nl>
parents: 2466
diff changeset
28 static PyObject *
21561
847425d5bca8 Patches by Jens B. Jorgensen with small mods by me:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2713
diff changeset
29 $abbrev$_slice($abbrev$object *self, int ilow, int ihigh)
2466
322fc596f1c4 checkin of Jack's original version
Guido van Rossum <guido@python.org>
parents:
diff changeset
30 {
322fc596f1c4 checkin of Jack's original version
Guido van Rossum <guido@python.org>
parents:
diff changeset
31 /* XXXX Return the ilow..ihigh slice of self in a new object */
322fc596f1c4 checkin of Jack's original version
Guido van Rossum <guido@python.org>
parents:
diff changeset
32 }
322fc596f1c4 checkin of Jack's original version
Guido van Rossum <guido@python.org>
parents:
diff changeset
33
322fc596f1c4 checkin of Jack's original version
Guido van Rossum <guido@python.org>
parents:
diff changeset
34 static int
21561
847425d5bca8 Patches by Jens B. Jorgensen with small mods by me:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2713
diff changeset
35 $abbrev$_ass_item($abbrev$object *self, int i, PyObject *v)
2466
322fc596f1c4 checkin of Jack's original version
Guido van Rossum <guido@python.org>
parents:
diff changeset
36 {
322fc596f1c4 checkin of Jack's original version
Guido van Rossum <guido@python.org>
parents:
diff changeset
37 /* XXXX Assign to the i-th element of self */
322fc596f1c4 checkin of Jack's original version
Guido van Rossum <guido@python.org>
parents:
diff changeset
38 return 0;
322fc596f1c4 checkin of Jack's original version
Guido van Rossum <guido@python.org>
parents:
diff changeset
39 }
322fc596f1c4 checkin of Jack's original version
Guido van Rossum <guido@python.org>
parents:
diff changeset
40
322fc596f1c4 checkin of Jack's original version
Guido van Rossum <guido@python.org>
parents:
diff changeset
41 static int
21561
847425d5bca8 Patches by Jens B. Jorgensen with small mods by me:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2713
diff changeset
42 $abbrev$_ass_slice(PyListObject *self, int ilow, int ihigh, PyObject *v)
2466
322fc596f1c4 checkin of Jack's original version
Guido van Rossum <guido@python.org>
parents:
diff changeset
43 {
322fc596f1c4 checkin of Jack's original version
Guido van Rossum <guido@python.org>
parents:
diff changeset
44 /* XXXX Replace ilow..ihigh slice of self with v */
322fc596f1c4 checkin of Jack's original version
Guido van Rossum <guido@python.org>
parents:
diff changeset
45 return 0;
322fc596f1c4 checkin of Jack's original version
Guido van Rossum <guido@python.org>
parents:
diff changeset
46 }
322fc596f1c4 checkin of Jack's original version
Guido van Rossum <guido@python.org>
parents:
diff changeset
47
2713
cd9d86ecc175 Templates converted to new naming conventions (thanks to Chak Tan)
Jack Jansen <jack.jansen@cwi.nl>
parents: 2466
diff changeset
48 static PySequenceMethods $abbrev$_as_sequence = {
2466
322fc596f1c4 checkin of Jack's original version
Guido van Rossum <guido@python.org>
parents:
diff changeset
49 (inquiry)$abbrev$_length, /*sq_length*/
322fc596f1c4 checkin of Jack's original version
Guido van Rossum <guido@python.org>
parents:
diff changeset
50 (binaryfunc)$abbrev$_concat, /*sq_concat*/
322fc596f1c4 checkin of Jack's original version
Guido van Rossum <guido@python.org>
parents:
diff changeset
51 (intargfunc)$abbrev$_repeat, /*sq_repeat*/
322fc596f1c4 checkin of Jack's original version
Guido van Rossum <guido@python.org>
parents:
diff changeset
52 (intargfunc)$abbrev$_item, /*sq_item*/
322fc596f1c4 checkin of Jack's original version
Guido van Rossum <guido@python.org>
parents:
diff changeset
53 (intintargfunc)$abbrev$_slice, /*sq_slice*/
322fc596f1c4 checkin of Jack's original version
Guido van Rossum <guido@python.org>
parents:
diff changeset
54 (intobjargproc)$abbrev$_ass_item, /*sq_ass_item*/
322fc596f1c4 checkin of Jack's original version
Guido van Rossum <guido@python.org>
parents:
diff changeset
55 (intintobjargproc)$abbrev$_ass_slice, /*sq_ass_slice*/
322fc596f1c4 checkin of Jack's original version
Guido van Rossum <guido@python.org>
parents:
diff changeset
56 };
322fc596f1c4 checkin of Jack's original version
Guido van Rossum <guido@python.org>
parents:
diff changeset
57
322fc596f1c4 checkin of Jack's original version
Guido van Rossum <guido@python.org>
parents:
diff changeset
58 /* -------------------------------------------------------------- */