[Python-checkins] CVS: python/dist/src/Mac/Modules macfsmodule.c,1.52,1.53
Jack Jansen
jackjansen@users.sourceforge.net
Fri, 18 Jan 2002 08:13:17 -0800
Update of /cvsroot/python/python/dist/src/Mac/Modules
In directory usw-pr-cvs1:/tmp/cvs-serv21053
Modified Files:
macfsmodule.c
Log Message:
Added as_pathname() method to FSRef objects.
Index: macfsmodule.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Mac/Modules/macfsmodule.c,v
retrieving revision 1.52
retrieving revision 1.53
diff -C2 -d -r1.52 -r1.53
*** macfsmodule.c 2002/01/13 23:16:32 1.52
--- macfsmodule.c 2002/01/18 16:13:15 1.53
***************
*** 774,781 ****
}
static struct PyMethodDef mfsr_methods[] = {
{"as_fsspec", (PyCFunction)mfsr_as_fsspec, 1},
#if 0
- {"as_pathname", (PyCFunction)mfss_as_pathname, 1},
{"as_tuple", (PyCFunction)mfss_as_tuple, 1},
{"NewAlias", (PyCFunction)mfss_NewAlias, 1},
--- 774,797 ----
}
+ static PyObject *
+ mfsr_as_pathname(mfsrobject *self, PyObject *args)
+ {
+ char strbuf[PATHNAMELEN];
+ OSStatus err;
+
+ if (!PyArg_ParseTuple(args, ""))
+ return NULL;
+ err = FSRefMakePath(&self->fsref, strbuf, PATHNAMELEN);
+ if ( err ) {
+ PyErr_Mac(ErrorObject, err);
+ return NULL;
+ }
+ return PyString_FromString(strbuf);
+ }
+
static struct PyMethodDef mfsr_methods[] = {
{"as_fsspec", (PyCFunction)mfsr_as_fsspec, 1},
+ {"as_pathname", (PyCFunction)mfsr_as_pathname, 1},
#if 0
{"as_tuple", (PyCFunction)mfss_as_tuple, 1},
{"NewAlias", (PyCFunction)mfss_NewAlias, 1},