[Python-checkins] CVS: python/dist/src/Mac/Modules/menu _Menumodule.c,NONE,1.1

Jack Jansen jackjansen@users.sourceforge.net
Thu, 23 Aug 2001 07:00:29 -0700


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

Added Files:
	_Menumodule.c 
Log Message:
Renamed the Mac toolbox modules to have an initial _ in their name.

--- NEW FILE: _Menumodule.c ---

/* ========================== Module _Menu ========================== */

#include "Python.h"



#include "macglue.h"
#include "pymactoolbox.h"

/* Macro to test whether a weak-loaded CFM function exists */
#define PyMac_PRECHECK(rtn) do { if ( &rtn == NULL )  {\
    	PyErr_SetString(PyExc_NotImplementedError, \
    	"Not available in this shared library/OS version"); \
    	return NULL; \
    }} while(0)


#ifdef WITHOUT_FRAMEWORKS
[...2527 lines suppressed...]


		PyMac_INIT_TOOLBOX_OBJECT_NEW(MenuHandle, MenuObj_New);
		PyMac_INIT_TOOLBOX_OBJECT_CONVERT(MenuHandle, MenuObj_Convert);


	m = Py_InitModule("_Menu", Menu_methods);
	d = PyModule_GetDict(m);
	Menu_Error = PyMac_GetOSErrException();
	if (Menu_Error == NULL ||
	    PyDict_SetItemString(d, "Error", Menu_Error) != 0)
		return;
	Menu_Type.ob_type = &PyType_Type;
	Py_INCREF(&Menu_Type);
	if (PyDict_SetItemString(d, "MenuType", (PyObject *)&Menu_Type) != 0)
		Py_FatalError("can't initialize MenuType");
}

/* ======================== End module _Menu ======================== */