[Python-checkins] CVS: python/dist/src/Mac/Modules/mlte Mltemodule.c,NONE,1.1
Jack Jansen
jackjansen@users.sourceforge.net
Fri, 13 Jul 2001 13:56:45 -0700
Update of /cvsroot/python/python/dist/src/Mac/Modules/mlte
In directory usw-pr-cvs1:/tmp/cvs-serv8106/Python/Mac/Modules/mlte
Added Files:
Mltemodule.c
Log Message:
First stab at an interface to the Multi Language Text Editor. It compiles and imports, but that's about all. Apple didn't put const in front of their input-only by-reference args, so that needs fixing first.
--- NEW FILE: Mltemodule.c ---
/* ========================== Module Mlte =========================== */
#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
[...1280 lines suppressed...]
m = Py_InitModule("Mlte", Mlte_methods);
d = PyModule_GetDict(m);
Mlte_Error = PyMac_GetOSErrException();
if (Mlte_Error == NULL ||
PyDict_SetItemString(d, "Error", Mlte_Error) != 0)
return;
TXNObject_Type.ob_type = &PyType_Type;
Py_INCREF(&TXNObject_Type);
if (PyDict_SetItemString(d, "TXNObjectType", (PyObject *)&TXNObject_Type) != 0)
Py_FatalError("can't initialize TXNObjectType");
TXNFontMenuObject_Type.ob_type = &PyType_Type;
Py_INCREF(&TXNFontMenuObject_Type);
if (PyDict_SetItemString(d, "TXNFontMenuObjectType", (PyObject *)&TXNFontMenuObject_Type) != 0)
Py_FatalError("can't initialize TXNFontMenuObjectType");
}
/* ======================== End module Mlte ========================= */