summaryrefslogtreecommitdiffstats
path: root/Mac/Modules/list/listsupport.py
diff options
context:
space:
mode:
authorJack Jansen <jack.jansen@cwi.nl>2001-05-17 21:58:34 (GMT)
committerJack Jansen <jack.jansen@cwi.nl>2001-05-17 21:58:34 (GMT)
commit0e04eecdbf8467cf3fe055e41e96fa48507b998c (patch)
tree0c3373b79a29ab55b8c542fd06ddbc9d78dd9d39 /Mac/Modules/list/listsupport.py
parent99f9baa33190482784900970fd3e1c76e7cb48d6 (diff)
downloadcpython-0e04eecdbf8467cf3fe055e41e96fa48507b998c.zip
cpython-0e04eecdbf8467cf3fe055e41e96fa48507b998c.tar.gz
cpython-0e04eecdbf8467cf3fe055e41e96fa48507b998c.tar.bz2
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.
Diffstat (limited to 'Mac/Modules/list/listsupport.py')
-rw-r--r--Mac/Modules/list/listsupport.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/Mac/Modules/list/listsupport.py b/Mac/Modules/list/listsupport.py
index ecf8392..751f16b 100644
--- a/Mac/Modules/list/listsupport.py
+++ b/Mac/Modules/list/listsupport.py
@@ -37,6 +37,15 @@ CGrafPtr = OpaqueByValueType("CGrafPtr", "GrafObj")
includestuff = includestuff + """
#include <%s>""" % MACHEADERFILE + """
+
+#ifdef USE_TOOLBOX_OBJECT_GLUE
+extern PyObject *_ListObj_New(ListHandle);
+extern int _ListObj_Convert(PyObject *, ListHandle *);
+
+#define ListObj_New _ListObj_New
+#define ListObj_Convert _ListObj_Convert
+#endif
+
#if !ACCESSOR_CALLS_ARE_FUNCTIONS
#define GetListPort(list) ((CGrafPtr)(*(list))->port)
#define GetListVerticalScrollBar(list) ((*(list))->vScroll)
@@ -66,6 +75,11 @@ includestuff = includestuff + """
#define as_Resource(lh) ((Handle)lh)
"""
+initstuff = initstuff + """
+ PyMac_INIT_TOOLBOX_OBJECT_NEW(ListObj_New);
+ PyMac_INIT_TOOLBOX_OBJECT_CONVERT(ListObj_Convert);
+"""
+
class ListMethodGenerator(MethodGenerator):
"""Similar to MethodGenerator, but has self as last argument"""