[Python-checkins] CVS: python/dist/src/Mac/Modules/res ressupport.py,1.13,1.14

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


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

Modified Files:
	ressupport.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: ressupport.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Mac/Modules/res/ressupport.py,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -r1.13 -r1.14
*** ressupport.py	2000/12/12 22:10:19	1.13
--- ressupport.py	2001/05/17 21:58:02	1.14
***************
*** 27,30 ****
--- 27,41 ----
  #include <string.h>
  
+ #ifdef USE_TOOLBOX_OBJECT_GLUE
+ extern PyObject *_ResObj_New(Handle);
+ extern int _ResObj_Convert(PyObject *, Handle *);
+ extern PyObject *_OptResObj_New(Handle);
+ extern int _OptResObj_Convert(PyObject *, Handle *);
+ #define ResObj_New _ResObj_New
+ #define ResObj_Convert _ResObj_Convert
+ #define OptResObj_New _OptResObj_New
+ #define OptResObj_Convert _OptResObj_Convert
+ #endif
+ 
  /* Function to dispose a resource, with a "normal" calling sequence */
  static void
***************
*** 76,79 ****
--- 87,94 ----
  
  initstuff = initstuff + """
+ 	PyMac_INIT_TOOLBOX_OBJECT_NEW(ResObj_New);
+ 	PyMac_INIT_TOOLBOX_OBJECT_CONVERT(ResObj_Convert);
+ 	PyMac_INIT_TOOLBOX_OBJECT_NEW(OptResObj_New);
+ 	PyMac_INIT_TOOLBOX_OBJECT_CONVERT(OptResObj_Convert);
  """