summaryrefslogtreecommitdiffstats
path: root/Tools/modulator/Templates/object_tp_as_sequence
blob: bc0f470262d9b2e1d7cc7797b25c8e4d2af00a5b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73

/* Code to handle accessing $name$ objects as sequence objects */

static int
$abbrev$_length(self)
	$abbrev$object *self;
{
	/* XXXX Return the size of the object */
}

static PyObject *
$abbrev$_concat(self, bb)
	$abbrev$object *self;
	PyObject *bb;
{
	/* XXXX Return the concatenation of self and bb */
}

static PyObject *
$abbrev$_repeat(self, n)
	$abbrev$object *self;
	int n;
{
	/* XXXX Return a new object that is n times self */
}

static PyObject *
$abbrev$_item(self, i)
	$abbrev$object *self;
	int i;
{
	/* XXXX Return the i-th object of self */
}

static PyObject *
$abbrev$_slice(self, ilow, ihigh)
	$abbrev$object *self;
	int ilow, ihigh;
{
	/* XXXX Return the ilow..ihigh slice of self in a new object */
}

static int
$abbrev$_ass_item(self, i, v)
	$abbrev$object *self;
	int i;
	PyObject *v;
{
	/* XXXX Assign to the i-th element of self */
	return 0;
}

static int
$abbrev$_ass_slice(self, ilow, ihigh, v)
	PyListObject *self;
	int ilow, ihigh;
	PyObject *v;
{
	/* XXXX Replace ilow..ihigh slice of self with v */
	return 0;
}

static PySequenceMethods $abbrev$_as_sequence = {
	(inquiry)$abbrev$_length,		/*sq_length*/
	(binaryfunc)$abbrev$_concat,		/*sq_concat*/
	(intargfunc)$abbrev$_repeat,		/*sq_repeat*/
	(intargfunc)$abbrev$_item,		/*sq_item*/
	(intintargfunc)$abbrev$_slice,		/*sq_slice*/
	(intobjargproc)$abbrev$_ass_item,	/*sq_ass_item*/
	(intintobjargproc)$abbrev$_ass_slice,	/*sq_ass_slice*/
};

/* -------------------------------------------------------------- */