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

Jack Jansen jackjansen@users.sourceforge.net
Thu, 23 Aug 2001 06:59:17 -0700


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

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

--- NEW FILE: _Resmodule.c ---

/* ========================== Module _Res =========================== */

#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
[...1548 lines suppressed...]
		PyMac_INIT_TOOLBOX_OBJECT_NEW(Handle, ResObj_New);
		PyMac_INIT_TOOLBOX_OBJECT_CONVERT(Handle, ResObj_Convert);
		PyMac_INIT_TOOLBOX_OBJECT_NEW(Handle, OptResObj_New);
		PyMac_INIT_TOOLBOX_OBJECT_CONVERT(Handle, OptResObj_Convert);


	m = Py_InitModule("_Res", Res_methods);
	d = PyModule_GetDict(m);
	Res_Error = PyMac_GetOSErrException();
	if (Res_Error == NULL ||
	    PyDict_SetItemString(d, "Error", Res_Error) != 0)
		return;
	Resource_Type.ob_type = &PyType_Type;
	Py_INCREF(&Resource_Type);
	if (PyDict_SetItemString(d, "ResourceType", (PyObject *)&Resource_Type) != 0)
		Py_FatalError("can't initialize ResourceType");
}

/* ======================== End module _Res ========================= */