[Python-checkins] CVS: python/dist/src/Tools/modulator/Templates module_method,1.3,1.4 object_method,1.3,1.4 object_structure,1.2,1.3 object_tp_as_mapping,1.2,1.3 object_tp_as_number,1.2,1.3 object_tp_as_sequence,1.2,1.3 object_tp_call,1.2,1.3 object_tp_compare,1.1,1.2 object_tp_dealloc,1.2,1.3 object_tp_getattr,1.2,1.3 object_tp_hash,1.1,1.2 object_tp_print,1.1,1.2 object_tp_repr,1.2,1.3 object_tp_setattr,1.3,1.4 object_tp_str,1.1,1.2

Jack Jansen jackjansen@users.sourceforge.net
2001年12月27日 15:35:45 -0800


Update of /cvsroot/python/python/dist/src/Tools/modulator/Templates
In directory usw-pr-cvs1:/tmp/cvs-serv25168/Templates
Modified Files:
	module_method object_method object_structure 
	object_tp_as_mapping object_tp_as_number object_tp_as_sequence 
	object_tp_call object_tp_compare object_tp_dealloc 
	object_tp_getattr object_tp_hash object_tp_print 
	object_tp_repr object_tp_setattr object_tp_str 
Log Message:
Patches by Jens B. Jorgensen with small mods by me:
- Converted the templates to use ANSI C prototypes (finally!)
- Use re in stead of deprecated regex
Index: module_method
===================================================================
RCS file: /cvsroot/python/python/dist/src/Tools/modulator/Templates/module_method,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** module_method	1995年06月20日 12:25:59	1.3
--- module_method	2001年12月27日 23:35:42	1.4
***************
*** 5,11 ****
 
 static PyObject *
! $abbrev$_$method$(self, args)
! 	PyObject *self;	/* Not used */
! 	PyObject *args;
 {
 
--- 5,9 ----
 
 static PyObject *
! $abbrev$_$method$(PyObject *self /* Not used */, PyObject *args)
 {
 
Index: object_method
===================================================================
RCS file: /cvsroot/python/python/dist/src/Tools/modulator/Templates/object_method,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** object_method	1995年06月20日 12:26:02	1.3
--- object_method	2001年12月27日 23:35:42	1.4
***************
*** 5,11 ****
 
 static PyObject *
! $abbrev$_$method$(self, args)
! 	$abbrev$object *self;
! 	PyObject *args;
 {
 	if (!PyArg_ParseTuple(args, ""))
--- 5,9 ----
 
 static PyObject *
! $abbrev$_$method$($abbrev$object *self, PyObject *args)
 {
 	if (!PyArg_ParseTuple(args, ""))
Index: object_structure
===================================================================
RCS file: /cvsroot/python/python/dist/src/Tools/modulator/Templates/object_structure,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** object_structure	1995年05月16日 13:46:55	1.2
--- object_structure	2001年12月27日 23:35:42	1.3
***************
*** 13,19 ****
 
 static PyObject *
! $abbrev$_getattr(self, name)
! 	$abbrev$object *self;
! 	char *name;
 {
 	PyObject *rv;
--- 13,17 ----
 
 static PyObject *
! $abbrev$_getattr($abbrev$object *self, char *name)
 {
 	PyObject *rv;
***************
*** 29,36 ****
 
 static int
! $abbrev$_setattr(self, name, v)
! 	$abbrev$object *self;
! 	char *name;
! 	PyObject *v;
 {
 	/* XXXX Add your own setattr code here */
--- 27,31 ----
 
 static int
! $abbrev$_setattr($abbrev$object *self, char *name, PyObject *v)
 {
 	/* XXXX Add your own setattr code here */
Index: object_tp_as_mapping
===================================================================
RCS file: /cvsroot/python/python/dist/src/Tools/modulator/Templates/object_tp_as_mapping,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** object_tp_as_mapping	1995年05月16日 13:46:57	1.2
--- object_tp_as_mapping	2001年12月27日 23:35:42	1.3
***************
*** 3,8 ****
 
 static int
! $abbrev$_length(self)
! 	$abbrev$object *self;
 {
 	/* XXXX Return the size of the mapping */
--- 3,7 ----
 
 static int
! $abbrev$_length($abbrev$object *self)
 {
 	/* XXXX Return the size of the mapping */
***************
*** 10,16 ****
 
 static PyObject *
! $abbrev$_subscript(self, key)
! 	$abbrev$object *self;
! 	PyObject *key;
 {
 	/* XXXX Return the item of self indexed by key */
--- 9,13 ----
 
 static PyObject *
! $abbrev$_subscript($abbrev$object *self, PyObject *key)
 {
 	/* XXXX Return the item of self indexed by key */
***************
*** 18,24 ****
 
 static int
! $abbrev$_ass_sub(self, v, w)
! 	$abbrev$object *self;
! 	PyObject *v, *w;
 {
 	/* XXXX Put w in self under key v */
--- 15,19 ----
 
 static int
! $abbrev$_ass_sub($abbrev$object *self, PyObject *v, PyObject *w)
 {
 	/* XXXX Put w in self under key v */
Index: object_tp_as_number
===================================================================
RCS file: /cvsroot/python/python/dist/src/Tools/modulator/Templates/object_tp_as_number,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** object_tp_as_number	1995年05月16日 13:46:58	1.2
--- object_tp_as_number	2001年12月27日 23:35:42	1.3
***************
*** 3,9 ****
 
 static PyObject *
! $abbrev$_add(v, w)
! 	$abbrev$object *v;
! 	$abbrev$object *w;
 {
 	/* XXXX Add them */
--- 3,7 ----
 
 static PyObject *
! $abbrev$_add($abbrev$object *v, $abbrev$object *w)
 {
 	/* XXXX Add them */
***************
*** 11,17 ****
 
 static PyObject *
! $abbrev$_sub(v, w)
! 	$abbrev$object *v;
! 	$abbrev$object *w;
 {
 	/* XXXX Subtract them */
--- 9,13 ----
 
 static PyObject *
! $abbrev$_sub($abbrev$object *v, $abbrev$object *w)
 {
 	/* XXXX Subtract them */
***************
*** 19,25 ****
 
 static PyObject *
! $abbrev$_mul(v, w)
! 	$abbrev$object *v;
! 	$abbrev$object *w;
 {
 	/* XXXX Multiply them */
--- 15,19 ----
 
 static PyObject *
! $abbrev$_mul($abbrev$object *v, $abbrev$object *w)
 {
 	/* XXXX Multiply them */
***************
*** 27,33 ****
 
 static PyObject *
! $abbrev$_div(x, y)
! 	$abbrev$object *x;
! 	$abbrev$object *y;
 {
 	/* XXXX Divide them */
--- 21,25 ----
 
 static PyObject *
! $abbrev$_div($abbrev$object *x, $abbrev$object *y)
 {
 	/* XXXX Divide them */
***************
*** 35,41 ****
 
 static PyObject *
! $abbrev$_mod(x, y)
! 	$abbrev$object *x;
! 	$abbrev$object *y;
 {
 	/* XXXX Modulo them */
--- 27,31 ----
 
 static PyObject *
! $abbrev$_mod($abbrev$object *x, $abbrev$object *y)
 {
 	/* XXXX Modulo them */
***************
*** 43,49 ****
 
 static PyObject *
! $abbrev$_divmod(x, y)
! 	$abbrev$object *x;
! 	$abbrev$object *y;
 {
 	/* XXXX Return 2-tuple with div and mod */
--- 33,37 ----
 
 static PyObject *
! $abbrev$_divmod($abbrev$object *x, $abbrev$object *y)
 {
 	/* XXXX Return 2-tuple with div and mod */
***************
*** 51,58 ****
 
 static PyObject *
! $abbrev$_pow(v, w, z)
! 	$abbrev$object *v;
! 	$abbrev$object *w;
! 	$abbrev$object *z;
 {
 	/* XXXX */
--- 39,43 ----
 
 static PyObject *
! $abbrev$_pow($abbrev$object *v, $abbrev$object *w, $abbrev$object *z)
 {
 	/* XXXX */
***************
*** 60,65 ****
 
 static PyObject *
! $abbrev$_neg(v)
! 	$abbrev$object *v;
 {
 	/* XXXX */
--- 45,49 ----
 
 static PyObject *
! $abbrev$_neg($abbrev$object *v)
 {
 	/* XXXX */
***************
*** 67,72 ****
 
 static PyObject *
! $abbrev$_pos(v)
! 	$abbrev$object *v;
 {
 	/* XXXX */
--- 51,55 ----
 
 static PyObject *
! $abbrev$_pos($abbrev$object *v)
 {
 	/* XXXX */
***************
*** 74,79 ****
 
 static PyObject *
! $abbrev$_abs(v)
! 	$abbrev$object *v;
 {
 	/* XXXX */
--- 57,61 ----
 
 static PyObject *
! $abbrev$_abs($abbrev$object *v)
 {
 	/* XXXX */
***************
*** 81,86 ****
 
 static int
! $abbrev$_nonzero(v)
! 	$abbrev$object *v;
 {
 	/* XXXX Return 1 if non-zero */
--- 63,67 ----
 
 static int
! $abbrev$_nonzero($abbrev$object *v)
 {
 	/* XXXX Return 1 if non-zero */
***************
*** 88,93 ****
 
 static PyObject *
! $abbrev$_invert(v)
! 	$abbrev$object *v;
 {
 	/* XXXX */
--- 69,73 ----
 
 static PyObject *
! $abbrev$_invert($abbrev$object *v)
 {
 	/* XXXX */
***************
*** 95,101 ****
 
 static PyObject *
! $abbrev$_lshift(v, w)
! 	$abbrev$object *v;
! 	$abbrev$object *w;
 {
 	/* XXXX */
--- 75,79 ----
 
 static PyObject *
! $abbrev$_lshift($abbrev$object *v, $abbrev$object *w)
 {
 	/* XXXX */
***************
*** 103,109 ****
 
 static PyObject *
! $abbrev$_rshift(v, w)
! 	$abbrev$object *v;
! 	$abbrev$object *w;
 {
 	/* XXXX */
--- 81,85 ----
 
 static PyObject *
! $abbrev$_rshift($abbrev$object *v, $abbrev$object *w)
 {
 	/* XXXX */
***************
*** 111,117 ****
 
 static PyObject *
! $abbrev$_and(v, w)
! 	$abbrev$object *v;
! 	$abbrev$object *w;
 {
 	/* XXXX */
--- 87,91 ----
 
 static PyObject *
! $abbrev$_and($abbrev$object *v, $abbrev$object *w)
 {
 	/* XXXX */
***************
*** 119,125 ****
 
 static PyObject *
! $abbrev$_xor(v, w)
! 	$abbrev$object *v;
! 	$abbrev$object *w;
 {
 	/* XXXX */
--- 93,97 ----
 
 static PyObject *
! $abbrev$_xor($abbrev$object *v, $abbrev$object *w)
 {
 	/* XXXX */
***************
*** 127,133 ****
 
 static PyObject *
! $abbrev$_or(v, w)
! 	$abbrev$object *v;
! 	$abbrev$object *w;
 {
 	/* XXXX */
--- 99,103 ----
 
 static PyObject *
! $abbrev$_or($abbrev$object *v, $abbrev$object *w)
 {
 	/* XXXX */
***************
*** 135,141 ****
 
 static int
! $abbrev$_coerce(pv, pw)
! 	PyObject **pv;
! 	PyObject **pw;
 {
 	/* XXXX I haven't a clue... */
--- 105,109 ----
 
 static int
! $abbrev$_coerce(PyObject **pv, PyObject **pw)
 {
 	/* XXXX I haven't a clue... */
***************
*** 144,149 ****
 
 static PyObject *
! $abbrev$_int(v)
! 	$abbrev$object *v;
 {
 	/* XXXX */
--- 112,116 ----
 
 static PyObject *
! $abbrev$_int($abbrev$object *v)
 {
 	/* XXXX */
***************
*** 151,156 ****
 
 static PyObject *
! $abbrev$_long(v)
! 	$abbrev$object *v;
 {
 	/* XXXX */
--- 118,122 ----
 
 static PyObject *
! $abbrev$_long($abbrev$object *v)
 {
 	/* XXXX */
***************
*** 158,163 ****
 
 static PyObject *
! $abbrev$_float(v)
! 	$abbrev$object *v;
 {
 	/* XXXX */
--- 124,128 ----
 
 static PyObject *
! $abbrev$_float($abbrev$object *v)
 {
 	/* XXXX */
***************
*** 165,170 ****
 
 static PyObject *
! $abbrev$_oct(v)
! 	$abbrev$object *v;
 {
 	/* XXXX Return object as octal stringobject */
--- 130,134 ----
 
 static PyObject *
! $abbrev$_oct($abbrev$object *v)
 {
 	/* XXXX Return object as octal stringobject */
***************
*** 172,177 ****
 
 static PyObject *
! $abbrev$_hex(v)
! 	$abbrev$object *v;
 {
 	/* XXXX Return object as hex stringobject */
--- 136,140 ----
 
 static PyObject *
! $abbrev$_hex($abbrev$object *v)
 {
 	/* XXXX Return object as hex stringobject */
Index: object_tp_as_sequence
===================================================================
RCS file: /cvsroot/python/python/dist/src/Tools/modulator/Templates/object_tp_as_sequence,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** object_tp_as_sequence	1995年05月16日 13:46:59	1.2
--- object_tp_as_sequence	2001年12月27日 23:35:42	1.3
***************
*** 3,8 ****
 
 static int
! $abbrev$_length(self)
! 	$abbrev$object *self;
 {
 	/* XXXX Return the size of the object */
--- 3,7 ----
 
 static int
! $abbrev$_length($abbrev$object *self)
 {
 	/* XXXX Return the size of the object */
***************
*** 10,16 ****
 
 static PyObject *
! $abbrev$_concat(self, bb)
! 	$abbrev$object *self;
! 	PyObject *bb;
 {
 	/* XXXX Return the concatenation of self and bb */
--- 9,13 ----
 
 static PyObject *
! $abbrev$_concat($abbrev$object *self, PyObject *bb)
 {
 	/* XXXX Return the concatenation of self and bb */
***************
*** 18,24 ****
 
 static PyObject *
! $abbrev$_repeat(self, n)
! 	$abbrev$object *self;
! 	int n;
 {
 	/* XXXX Return a new object that is n times self */
--- 15,19 ----
 
 static PyObject *
! $abbrev$_repeat($abbrev$object *self, int n)
 {
 	/* XXXX Return a new object that is n times self */
***************
*** 26,32 ****
 
 static PyObject *
! $abbrev$_item(self, i)
! 	$abbrev$object *self;
! 	int i;
 {
 	/* XXXX Return the i-th object of self */
--- 21,25 ----
 
 static PyObject *
! $abbrev$_item($abbrev$object *self, int i)
 {
 	/* XXXX Return the i-th object of self */
***************
*** 34,40 ****
 
 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 */
--- 27,31 ----
 
 static PyObject *
! $abbrev$_slice($abbrev$object *self, int ilow, int ihigh)
 {
 	/* XXXX Return the ilow..ihigh slice of self in a new object */
***************
*** 42,49 ****
 
 static int
! $abbrev$_ass_item(self, i, v)
! 	$abbrev$object *self;
! 	int i;
! 	PyObject *v;
 {
 	/* XXXX Assign to the i-th element of self */
--- 33,37 ----
 
 static int
! $abbrev$_ass_item($abbrev$object *self, int i, PyObject *v)
 {
 	/* XXXX Assign to the i-th element of self */
***************
*** 52,59 ****
 
 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 */
--- 40,44 ----
 
 static int
! $abbrev$_ass_slice(PyListObject *self, int ilow, int ihigh, PyObject *v)
 {
 	/* XXXX Replace ilow..ihigh slice of self with v */
Index: object_tp_call
===================================================================
RCS file: /cvsroot/python/python/dist/src/Tools/modulator/Templates/object_tp_call,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** object_tp_call	1995年10月12日 13:45:25	1.2
--- object_tp_call	2001年12月27日 23:35:42	1.3
***************
*** 1,8 ****
 
 static PyObject *
! $abbrev$_call(self, args, kwargs)
! 	$abbrev$object *self;
! 	PyObject *args;
! 	PyObject *kwargs;
 {
 	/* XXXX Return the result of calling self with argument args */
--- 1,5 ----
 
 static PyObject *
! $abbrev$_call($abbrev$object *self, PyObject *args, PyObject *kwargs)
 {
 	/* XXXX Return the result of calling self with argument args */
Index: object_tp_compare
===================================================================
RCS file: /cvsroot/python/python/dist/src/Tools/modulator/Templates/object_tp_compare,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** object_tp_compare	1995年03月02日 14:05:23	1.1
--- object_tp_compare	2001年12月27日 23:35:42	1.2
***************
*** 1,6 ****
 
 static int
! $abbrev$_compare(v, w)
! 	$abbrev$object *v, *w;
 {
 	/* XXXX Compare objects and return -1, 0 or 1 */
--- 1,5 ----
 
 static int
! $abbrev$_compare($abbrev$object *v, $abbrev$object *w)
 {
 	/* XXXX Compare objects and return -1, 0 or 1 */
Index: object_tp_dealloc
===================================================================
RCS file: /cvsroot/python/python/dist/src/Tools/modulator/Templates/object_tp_dealloc,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** object_tp_dealloc	1995年05月16日 13:47:00	1.2
--- object_tp_dealloc	2001年12月27日 23:35:43	1.3
***************
*** 1,6 ****
 
 static void
! $abbrev$_dealloc(self)
! 	$abbrev$object *self;
 {
 	/* XXXX Add your own cleanup code here */
--- 1,5 ----
 
 static void
! $abbrev$_dealloc($abbrev$object *self)
 {
 	/* XXXX Add your own cleanup code here */
Index: object_tp_getattr
===================================================================
RCS file: /cvsroot/python/python/dist/src/Tools/modulator/Templates/object_tp_getattr,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** object_tp_getattr	1995年05月16日 13:47:01	1.2
--- object_tp_getattr	2001年12月27日 23:35:43	1.3
***************
*** 1,7 ****
 
 static PyObject *
! $abbrev$_getattr(self, name)
! 	$abbrev$object *self;
! 	char *name;
 {
 	/* XXXX Add your own getattr code here */
--- 1,5 ----
 
 static PyObject *
! $abbrev$_getattr($abbrev$object *self, char *name)
 {
 	/* XXXX Add your own getattr code here */
Index: object_tp_hash
===================================================================
RCS file: /cvsroot/python/python/dist/src/Tools/modulator/Templates/object_tp_hash,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** object_tp_hash	1995年03月02日 14:05:26	1.1
--- object_tp_hash	2001年12月27日 23:35:43	1.2
***************
*** 1,6 ****
 
 static long
! $abbrev$_hash(self)
! 	$abbrev$object *self;
 {
 	/* XXXX Return a hash of self (or -1) */
--- 1,5 ----
 
 static long
! $abbrev$_hash($abbrev$object *self)
 {
 	/* XXXX Return a hash of self (or -1) */
Index: object_tp_print
===================================================================
RCS file: /cvsroot/python/python/dist/src/Tools/modulator/Templates/object_tp_print,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** object_tp_print	1995年03月02日 14:05:27	1.1
--- object_tp_print	2001年12月27日 23:35:43	1.2
***************
*** 1,8 ****
 
 static int
! $abbrev$_print(self, fp, flags)
! 	$abbrev$object *self;
! 	FILE *fp;
! 	int flags;
 {
 	/* XXXX Add code here to print self to fp */
--- 1,5 ----
 
 static int
! $abbrev$_print($abbrev$object *self, FILE *fp, int flags)
 {
 	/* XXXX Add code here to print self to fp */
Index: object_tp_repr
===================================================================
RCS file: /cvsroot/python/python/dist/src/Tools/modulator/Templates/object_tp_repr,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** object_tp_repr	1995年05月16日 13:47:02	1.2
--- object_tp_repr	2001年12月27日 23:35:43	1.3
***************
*** 1,6 ****
 
 static PyObject *
! $abbrev$_repr(self)
! 	$abbrev$object *self;
 {
 	PyObject *s;
--- 1,5 ----
 
 static PyObject *
! $abbrev$_repr($abbrev$object *self)
 {
 	PyObject *s;
Index: object_tp_setattr
===================================================================
RCS file: /cvsroot/python/python/dist/src/Tools/modulator/Templates/object_tp_setattr,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** object_tp_setattr	1995年10月23日 13:52:52	1.3
--- object_tp_setattr	2001年12月27日 23:35:43	1.4
***************
*** 1,8 ****
 
 static int
! $abbrev$_setattr(self, name, v)
! 	$abbrev$object *self;
! 	char *name;
! 	PyObject *v;
 {
 	/* Set attribute 'name' to value 'v'. v==NULL means delete */
--- 1,5 ----
 
 static int
! $abbrev$_setattr($abbrev$object *self, char *name, PyObject *v)
 {
 	/* Set attribute 'name' to value 'v'. v==NULL means delete */
Index: object_tp_str
===================================================================
RCS file: /cvsroot/python/python/dist/src/Tools/modulator/Templates/object_tp_str,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** object_tp_str	1995年06月20日 12:42:39	1.1
--- object_tp_str	2001年12月27日 23:35:43	1.2
***************
*** 1,6 ****
 
 static PyObject *
! $abbrev$_str(self)
! 	$abbrev$object *self;
 {
 	PyObject *s;
--- 1,5 ----
 
 static PyObject *
! $abbrev$_str($abbrev$object *self)
 {
 	PyObject *s;

AltStyle によって変換されたページ (->オリジナル) /