[Python-checkins] CVS: python/dist/src/Mac/Modules/te tesupport.py,1.6,1.7

Jack Jansen jackjansen@users.sourceforge.net
Thu, 17 May 2001 14:58:19 -0700


Update of /cvsroot/python/python/dist/src/Mac/Modules/te
In directory usw-pr-cvs1:/tmp/cvs-serv8623/Python/Mac/Modules/te

Modified Files:
	tesupport.py 
Log Message:
First step in porting MacPython modules to OSX/unix: break all references between modules except for the obj_New() and obj_Convert() routines, the PyArg_Parse and Py_BuildValue helpers. 

And these can now be vectored through glue routines (by defining USE_TOOLBOX_OBJECT_GLUE) which will do the necessary imports, whereupon the module's init routine will tell the glue routine about the real conversion routine address and everything is fine again.

Index: tesupport.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Mac/Modules/te/tesupport.py,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -r1.6 -r1.7
*** tesupport.py	2000/07/14 22:16:44	1.6
--- tesupport.py	2001/05/17 21:58:17	1.7
***************
*** 35,38 ****
--- 35,46 ----
  #include <%s>""" % MACHEADERFILE + """
  
+ #ifdef USE_TOOLBOX_OBJECT_GLUE
+ extern PyObject *_TEObj_New(TEHandle);
+ extern int _TEObj_Convert(PyObject *, TEHandle *);
+ 
+ #define TEObj_New _TEObj_New
+ #define TEObj_Convert _TEObj_Convert
+ #endif
+ 
  #define as_TE(h) ((TEHandle)h)
  #define as_Resource(teh) ((Handle)teh)
***************
*** 64,67 ****
--- 72,80 ----
  	return 1;
  }
+ """
+ 
+ initstuff = initstuff + """
+ 	PyMac_INIT_TOOLBOX_OBJECT_NEW(TEObj_New);
+ 	PyMac_INIT_TOOLBOX_OBJECT_CONVERT(TEObj_Convert);
  """