[Python-checkins] CVS: python/dist/src/Mac/Modules/carbonevt CarbonEvtscan.py,1.4,1.5 CarbonEvtsupport.py,1.8,1.9 _CarbonEvtmodule.c,1.5,1.6

Just van Rossum jvr@users.sourceforge.net
Thu, 03 Jan 2002 12:45:49 -0800


Update of /cvsroot/python/python/dist/src/Mac/Modules/carbonevt
In directory usw-pr-cvs1:/tmp/cvs-serv16912

Modified Files:
	CarbonEvtscan.py CarbonEvtsupport.py _CarbonEvtmodule.c 
Log Message:
fixed SetEventParameter() signature: removed unneccesary length arg.

Index: CarbonEvtscan.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Mac/Modules/carbonevt/CarbonEvtscan.py,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** CarbonEvtscan.py	2001/12/14 23:16:04	1.4
--- CarbonEvtscan.py	2002/01/03 20:45:47	1.5
***************
*** 108,112 ****
  
  	def makerepairinstructions(self):
! 		return []
  		
  if __name__ == "__main__":
--- 108,115 ----
  
  	def makerepairinstructions(self):
! 		return [
! 			([("UInt32", 'inSize', "InMode"), ("void_ptr", 'inDataPtr', "InMode")],
! 				[("MyInBuffer", 'inDataPtr', "InMode")])
! 		]
  		
  if __name__ == "__main__":

Index: CarbonEvtsupport.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Mac/Modules/carbonevt/CarbonEvtsupport.py,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** CarbonEvtsupport.py	2001/12/18 12:35:57	1.8
--- CarbonEvtsupport.py	2002/01/03 20:45:47	1.9
***************
*** 35,38 ****
--- 35,44 ----
  # here are some types that are really other types
  
+ class MyVarInputBufferType(VarInputBufferType):
+ 	def passInput(self, name):
+ 		return "%s__len__, %s__in__" % (name, name)
+ 
+ MyInBuffer = MyVarInputBufferType('char', 'long', 'l')		# (buf, len)
+ 
  EventTime = double
  EventTimeout = EventTime

Index: _CarbonEvtmodule.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Mac/Modules/carbonevt/_CarbonEvtmodule.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** _CarbonEvtmodule.c	2001/12/18 12:35:57	1.5
--- _CarbonEvtmodule.c	2002/01/03 20:45:47	1.6
***************
*** 216,232 ****
  	OSType inName;
  	OSType inType;
! 	UInt32 inSize;
! 	char* inDataPtr;
! 	if (!PyArg_ParseTuple(_args, "O&O&ls",
  	                      PyMac_GetOSType, &inName,
  	                      PyMac_GetOSType, &inType,
! 	                      &inSize,
! 	                      &inDataPtr))
  		return NULL;
  	_err = SetEventParameter(_self->ob_itself,
  	                         inName,
  	                         inType,
! 	                         inSize,
! 	                         inDataPtr);
  	if (_err != noErr) return PyMac_Error(_err);
  	Py_INCREF(Py_None);
--- 216,232 ----
  	OSType inName;
  	OSType inType;
! 	char *inDataPtr__in__;
! 	long inDataPtr__len__;
! 	int inDataPtr__in_len__;
! 	if (!PyArg_ParseTuple(_args, "O&O&s#",
  	                      PyMac_GetOSType, &inName,
  	                      PyMac_GetOSType, &inType,
! 	                      &inDataPtr__in__, &inDataPtr__in_len__))
  		return NULL;
+ 	inDataPtr__len__ = inDataPtr__in_len__;
  	_err = SetEventParameter(_self->ob_itself,
  	                         inName,
  	                         inType,
! 	                         inDataPtr__len__, inDataPtr__in__);
  	if (_err != noErr) return PyMac_Error(_err);
  	Py_INCREF(Py_None);
***************
*** 387,391 ****
  	 "() -> None"},
  	{"SetEventParameter", (PyCFunction)EventRef_SetEventParameter, 1,
! 	 "(OSType inName, OSType inType, UInt32 inSize, char* inDataPtr) -> None"},
  	{"GetEventClass", (PyCFunction)EventRef_GetEventClass, 1,
  	 "() -> (UInt32 _rv)"},
--- 387,391 ----
  	 "() -> None"},
  	{"SetEventParameter", (PyCFunction)EventRef_SetEventParameter, 1,
! 	 "(OSType inName, OSType inType, Buffer inDataPtr) -> None"},
  	{"GetEventClass", (PyCFunction)EventRef_GetEventClass, 1,
  	 "() -> (UInt32 _rv)"},