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

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


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

Modified Files:
	Menumodule.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: Menumodule.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Mac/Modules/menu/Menumodule.c,v
retrieving revision 1.25
retrieving revision 1.26
diff -C2 -r1.25 -r1.26
*** Menumodule.c	2001/01/29 13:32:10	1.25
--- Menumodule.c	2001/05/17 21:56:18	1.26
***************
*** 12,15 ****
--- 12,24 ----
  #include <Menus.h>
  
+ #ifdef USE_TOOLBOX_OBJECT_GLUE
+ 
+ extern PyObject *_MenuObj_New(MenuHandle);
+ extern int _MenuObj_Convert(PyObject *, MenuHandle *);
+ 
+ #define MenuObj_New _MenuObj_New
+ #define MenuObj_Convert _MenuObj_Convert 
+ #endif
+ 
  #if !ACCESSOR_CALLS_ARE_FUNCTIONS
  #define GetMenuID(menu) ((*(menu))->menuID)
***************
*** 2780,2783 ****
--- 2789,2795 ----
  
  
+ 
+ 		PyMac_INIT_TOOLBOX_OBJECT_NEW(MenuObj_New);
+ 		PyMac_INIT_TOOLBOX_OBJECT_CONVERT(MenuObj_Convert);