diff Mac/Python/macglue.c @ 3431:26bec9e22e5d legacy-trunk

Added code to make fsspecs work for gusi-python
author Jack Jansen <jack.jansen@cwi.nl>
date Tue, 05 Mar 1996 16:56:24 +0000
parents 43c5e7a3fc1f
children 578ca302a598
line wrap: on
line diff
--- a/Mac/Python/macglue.c	Tue Mar 05 16:56:00 1996 +0000
+++ b/Mac/Python/macglue.c	Tue Mar 05 16:56:24 1996 +0000
@@ -49,6 +49,9 @@
 #ifdef __MWERKS__
 #include <SIOUX.h>
 #endif
+#ifdef USE_GUSI
+#include <TFileSpec.h> /* For Path2FSSpec */
+#endif
 
 #ifndef HAVE_UNIVERSAL_HEADERS
 #define GetResourceSizeOnDisk(x) SizeResource(x)
@@ -654,8 +657,21 @@
 		/* It's a pathname */
 		if( !PyArg_Parse(v, "O&", PyMac_GetStr255, &path) )
 			return 0;
+#ifdef USE_GUSI
+		{
+			FSSpec curdirfss;
+			
+			if ( Path2FSSpec(":x", &curdirfss) == 0 ) {
+				refnum = curdirfss.vRefNum;
+				parid = curdirfss.parID;
+			} else {
+				return 0;
+			}
+		}
+#else
 		refnum = 0; /* XXXX Should get CurWD here... */
 		parid = 0;
+#endif
 	} else {
 		if( !PyArg_Parse(v, "(hlO&); FSSpec should be fullpath or (vrefnum,dirid,path)",
 							&refnum, &parid, PyMac_GetStr255, &path)) {