summaryrefslogtreecommitdiffstats
path: root/Mac/Modules/res/ressupport.py
diff options
context:
space:
mode:
Diffstat (limited to 'Mac/Modules/res/ressupport.py')
-rw-r--r--Mac/Modules/res/ressupport.py19
1 files changed, 18 insertions, 1 deletions
diff --git a/Mac/Modules/res/ressupport.py b/Mac/Modules/res/ressupport.py
index fd4f4e6..8eb6bf4 100644
--- a/Mac/Modules/res/ressupport.py
+++ b/Mac/Modules/res/ressupport.py
@@ -32,7 +32,7 @@ includestuff = includestuff + """
finalstuff = finalstuff + """
/* Alternative version of ResObj_New, which returns None for null argument */
-PyObject *ResObj_OptNew(itself)
+PyObject *OptResObj_New(itself)
Handle itself;
{
ResourceObject *it;
@@ -43,6 +43,23 @@ PyObject *ResObj_OptNew(itself)
return ResObj_New(itself);
}
+OptResObj_Convert(v, p_itself)
+ PyObject *v;
+ Handle *p_itself;
+{
+ if ( v == Py_None ) {
+ *p_itself = NULL;
+ return 1;
+ }
+ if (!ResObj_Check(v))
+ {
+ PyErr_SetString(PyExc_TypeError, "Resource required");
+ return 0;
+ }
+ *p_itself = ((ResourceObject *)v)->ob_itself;
+ return 1;
+}
+
"""
initstuff = initstuff + """