Commits

Anonymous committed d55b75a

Added glue routine for PyMac_BuildFSSpec, PyMac_GetFSRef and PyMac_BuildFSRef.

Moved the declarations to pymactoolbox.h.

Comments (0)

Files changed (4)

Include/pymactoolbox.h

 #endif /* USE_TOOLBOX_OBJECT_GLUE */
 
 /* macfs exports */
-extern int PyMac_GetFSSpec(PyObject *, FSSpec *);
+int PyMac_GetFSSpec(PyObject *, FSSpec *);	/* argument parser for FSSpec */
+PyObject *PyMac_BuildFSSpec(FSSpec *);		/* Convert FSSpec to PyObject */
+
+int PyMac_GetFSRef(PyObject *, FSRef *);	/* argument parser for FSRef */
+PyObject *PyMac_BuildFSRef(FSRef *);		/* Convert FSRef to PyObject */
 
 /* AE exports */
 extern PyObject *AEDesc_New(AppleEvent *); /* XXXX Why passed by address?? */

Mac/Include/macglue.h

 short PyMac_OpenPrefFile(void);			/* From macgetpath.c, open and return preference file */
 #endif
 
-/* from macfsmodule.c: */
-int PyMac_GetFSSpec(PyObject *, FSSpec *);	/* argument parser for FSSpec */
-PyObject *PyMac_BuildFSSpec(FSSpec *);		/* Convert FSSpec to PyObject */
-
-int PyMac_GetFSRef(PyObject *, FSRef *);	/* argument parser for FSRef */
-PyObject *PyMac_BuildFSRef(FSRef *);		/* Convert FSRef to PyObject */
-
 
 /* From macfiletype.c: */
 

Mac/Modules/macfsmodule.c

 
 #ifdef USE_TOOLBOX_OBJECT_GLUE
 extern int _PyMac_GetFSSpec(PyObject *, FSSpec *);
+extern PyObject *_PyMac_BuildFSRef(FSRef *);
+extern int _PyMac_GetFSSpec(PyObject *, FSSpec *);
+extern PyObject *_PyMac_BuildFSRef(FSRef *);
 #define PyMac_GetFSSpec _PyMac_GetFSSpec
+#define PyMac_BuildFSSpec _PyMac_BuildFSSpec
+#define PyMac_GetFSRef _PyMac_GetFSRef
+#define PyMac_BuildFSRef _PyMac_BuildFSRef
 #endif
 static PyObject *ErrorObject;
 
 	PyObject *m, *d;
 
 		PyMac_INIT_TOOLBOX_OBJECT_CONVERT(FSSpec, PyMac_GetFSSpec);
+		PyMac_INIT_TOOLBOX_OBJECT_CONVERT(FSRef, PyMac_GetFSRef);
+		PyMac_INIT_TOOLBOX_OBJECT_NEW(FSSpec *, PyMac_BuildFSSpec);
+		PyMac_INIT_TOOLBOX_OBJECT_NEW(FSRef *, PyMac_BuildFSRef);
 
 	/* Create the module and add the functions */
 	m = Py_InitModule("macfs", mfs_methods);

Python/mactoolboxglue.c

     } \
     return (*PyMacGluePtr_##routinename)(pyobj, cobj); \
 }
+
+GLUE_NEW(FSSpec *, PyMac_BuildFSSpec, "macfs")
 GLUE_CONVERT(FSSpec, PyMac_GetFSSpec, "macfs")
+GLUE_NEW(FSRef *, PyMac_BuildFSRef, "macfs")
+GLUE_CONVERT(FSRef, PyMac_GetFSRef, "macfs")
 
 GLUE_NEW(AppleEvent *, AEDesc_New, "Carbon.AE") /* XXXX Why by address? */
 GLUE_CONVERT(AppleEvent, AEDesc_Convert, "Carbon.AE")