PageRenderTime 16ms CodeModel.GetById 13ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/Tools/modulator/Templates/object_tp_as_sequence

http://unladen-swallow.googlecode.com/
#! | 58 lines | 48 code | 10 blank | 0 comment | 0 complexity | 900a179388ec208afc3b316e75a4181b MD5 | raw file
 1
 2/* Code to handle accessing $name$ objects as sequence objects */
 3
 4static int
 5$abbrev$_length($abbrev$object *self)
 6{
 7	/* XXXX Return the size of the object */
 8}
 9
10static PyObject *
11$abbrev$_concat($abbrev$object *self, PyObject *bb)
12{
13	/* XXXX Return the concatenation of self and bb */
14}
15
16static PyObject *
17$abbrev$_repeat($abbrev$object *self, int n)
18{
19	/* XXXX Return a new object that is n times self */
20}
21
22static PyObject *
23$abbrev$_item($abbrev$object *self, int i)
24{
25	/* XXXX Return the i-th object of self */
26}
27
28static PyObject *
29$abbrev$_slice($abbrev$object *self, int ilow, int ihigh)
30{
31	/* XXXX Return the ilow..ihigh slice of self in a new object */
32}
33
34static int
35$abbrev$_ass_item($abbrev$object *self, int i, PyObject *v)
36{
37	/* XXXX Assign to the i-th element of self */
38	return 0;
39}
40
41static int
42$abbrev$_ass_slice(PyListObject *self, int ilow, int ihigh, PyObject *v)
43{
44	/* XXXX Replace ilow..ihigh slice of self with v */
45	return 0;
46}
47
48static PySequenceMethods $abbrev$_as_sequence = {
49	(inquiry)$abbrev$_length,		/*sq_length*/
50	(binaryfunc)$abbrev$_concat,		/*sq_concat*/
51	(intargfunc)$abbrev$_repeat,		/*sq_repeat*/
52	(intargfunc)$abbrev$_item,		/*sq_item*/
53	(intintargfunc)$abbrev$_slice,		/*sq_slice*/
54	(intobjargproc)$abbrev$_ass_item,	/*sq_ass_item*/
55	(intintobjargproc)$abbrev$_ass_slice,	/*sq_ass_slice*/
56};
57
58/* -------------------------------------------------------------- */