[Python-checkins] CVS: python/dist/src/Mac/Modules/res Resmodule.c,1.25,1.26

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


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

Modified Files:
	Resmodule.c 
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: Resmodule.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Mac/Modules/res/Resmodule.c,v
retrieving revision 1.25
retrieving revision 1.26
diff -C2 -r1.25 -r1.26
*** Resmodule.c	2001/03/02 16:32:03	1.25
--- Resmodule.c	2001/05/17 21:57:55	1.26
***************
*** 12,15 ****
--- 12,26 ----
  #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
***************
*** 1679,1682 ****
--- 1690,1697 ----
  
  
+ 		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);