117724f21a94ff32f773af4c37be88fe0d2970e3~suv--- Include/pymactoolbox.h.orig 2004-11-05 18:02:59.000000000 +1100
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+++ Include/pymactoolbox.h 2009-09-10 18:08:58.000000000 +1000
117724f21a94ff32f773af4c37be88fe0d2970e3~suv@@ -8,7 +8,9 @@
117724f21a94ff32f773af4c37be88fe0d2970e3~suv #endif
117724f21a94ff32f773af4c37be88fe0d2970e3~suv
117724f21a94ff32f773af4c37be88fe0d2970e3~suv #include <Carbon/Carbon.h>
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+#ifndef __LP64__
117724f21a94ff32f773af4c37be88fe0d2970e3~suv #include <QuickTime/QuickTime.h>
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+#endif /* !__LP64__ */
117724f21a94ff32f773af4c37be88fe0d2970e3~suv
117724f21a94ff32f773af4c37be88fe0d2970e3~suv /*
117724f21a94ff32f773af4c37be88fe0d2970e3~suv ** Helper routines for error codes and such.
117724f21a94ff32f773af4c37be88fe0d2970e3~suv@@ -18,8 +20,10 @@
117724f21a94ff32f773af4c37be88fe0d2970e3~suv PyObject *PyMac_GetOSErrException(void); /* Initialize & return it */
117724f21a94ff32f773af4c37be88fe0d2970e3~suv PyObject *PyErr_Mac(PyObject *, int); /* Exception with a mac error */
117724f21a94ff32f773af4c37be88fe0d2970e3~suv PyObject *PyMac_Error(OSErr); /* Uses PyMac_GetOSErrException */
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+#ifndef __LP64__
117724f21a94ff32f773af4c37be88fe0d2970e3~suv extern OSErr PyMac_GetFullPathname(FSSpec *, char *, int); /* convert
117724f21a94ff32f773af4c37be88fe0d2970e3~suv fsspec->path */
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+#endif /* !__LP64__ */
117724f21a94ff32f773af4c37be88fe0d2970e3~suv /*
117724f21a94ff32f773af4c37be88fe0d2970e3~suv ** These conversion routines are defined in mactoolboxglue.c itself.
117724f21a94ff32f773af4c37be88fe0d2970e3~suv */
117724f21a94ff32f773af4c37be88fe0d2970e3~suv@@ -83,9 +87,10 @@
117724f21a94ff32f773af4c37be88fe0d2970e3~suv #endif /* USE_TOOLBOX_OBJECT_GLUE */
117724f21a94ff32f773af4c37be88fe0d2970e3~suv
117724f21a94ff32f773af4c37be88fe0d2970e3~suv /* macfs exports */
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+#ifndef __LP64__
117724f21a94ff32f773af4c37be88fe0d2970e3~suv int PyMac_GetFSSpec(PyObject *, FSSpec *); /* argument parser for FSSpec */
117724f21a94ff32f773af4c37be88fe0d2970e3~suv PyObject *PyMac_BuildFSSpec(FSSpec *); /* Convert FSSpec to PyObject */
117724f21a94ff32f773af4c37be88fe0d2970e3~suv-
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+#endif /* !__LP64__ */
117724f21a94ff32f773af4c37be88fe0d2970e3~suv int PyMac_GetFSRef(PyObject *, FSRef *); /* argument parser for FSRef */
117724f21a94ff32f773af4c37be88fe0d2970e3~suv PyObject *PyMac_BuildFSRef(FSRef *); /* Convert FSRef to PyObject */
117724f21a94ff32f773af4c37be88fe0d2970e3~suv
117724f21a94ff32f773af4c37be88fe0d2970e3~suv@@ -101,39 +106,54 @@
117724f21a94ff32f773af4c37be88fe0d2970e3~suv extern int CmpInstObj_Convert(PyObject *, ComponentInstance *);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv
117724f21a94ff32f773af4c37be88fe0d2970e3~suv /* Ctl exports */
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+#ifndef __LP64__
117724f21a94ff32f773af4c37be88fe0d2970e3~suv extern PyObject *CtlObj_New(ControlHandle);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv extern int CtlObj_Convert(PyObject *, ControlHandle *);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+#endif /* !__LP64__ */
117724f21a94ff32f773af4c37be88fe0d2970e3~suv
117724f21a94ff32f773af4c37be88fe0d2970e3~suv /* Dlg exports */
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+#ifndef __LP64__
117724f21a94ff32f773af4c37be88fe0d2970e3~suv extern PyObject *DlgObj_New(DialogPtr);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv extern int DlgObj_Convert(PyObject *, DialogPtr *);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv extern PyObject *DlgObj_WhichDialog(DialogPtr);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+#endif /* !__LP64__ */
117724f21a94ff32f773af4c37be88fe0d2970e3~suv
117724f21a94ff32f773af4c37be88fe0d2970e3~suv /* Drag exports */
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+#ifndef __LP64__
117724f21a94ff32f773af4c37be88fe0d2970e3~suv extern PyObject *DragObj_New(DragReference);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv extern int DragObj_Convert(PyObject *, DragReference *);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+#endif /* !__LP64__ */
117724f21a94ff32f773af4c37be88fe0d2970e3~suv
117724f21a94ff32f773af4c37be88fe0d2970e3~suv /* List exports */
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+#ifndef __LP64__
117724f21a94ff32f773af4c37be88fe0d2970e3~suv extern PyObject *ListObj_New(ListHandle);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv extern int ListObj_Convert(PyObject *, ListHandle *);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+#endif /* !__LP64__ */
117724f21a94ff32f773af4c37be88fe0d2970e3~suv
117724f21a94ff32f773af4c37be88fe0d2970e3~suv /* Menu exports */
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+#ifndef __LP64__
117724f21a94ff32f773af4c37be88fe0d2970e3~suv extern PyObject *MenuObj_New(MenuHandle);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv extern int MenuObj_Convert(PyObject *, MenuHandle *);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+#endif /* !__LP64__ */
117724f21a94ff32f773af4c37be88fe0d2970e3~suv
117724f21a94ff32f773af4c37be88fe0d2970e3~suv /* Qd exports */
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+#ifndef __LP64__
117724f21a94ff32f773af4c37be88fe0d2970e3~suv extern PyObject *GrafObj_New(GrafPtr);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv extern int GrafObj_Convert(PyObject *, GrafPtr *);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv extern PyObject *BMObj_New(BitMapPtr);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv extern int BMObj_Convert(PyObject *, BitMapPtr *);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv extern PyObject *QdRGB_New(RGBColor *);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv extern int QdRGB_Convert(PyObject *, RGBColor *);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+#endif /* !__LP64__ */
117724f21a94ff32f773af4c37be88fe0d2970e3~suv
117724f21a94ff32f773af4c37be88fe0d2970e3~suv /* Qdoffs exports */
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+#ifndef __LP64__
117724f21a94ff32f773af4c37be88fe0d2970e3~suv extern PyObject *GWorldObj_New(GWorldPtr);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv extern int GWorldObj_Convert(PyObject *, GWorldPtr *);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+#endif /* !__LP64__ */
117724f21a94ff32f773af4c37be88fe0d2970e3~suv
117724f21a94ff32f773af4c37be88fe0d2970e3~suv /* Qt exports */
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+#ifndef __LP64__
117724f21a94ff32f773af4c37be88fe0d2970e3~suv extern PyObject *TrackObj_New(Track);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv extern int TrackObj_Convert(PyObject *, Track *);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv extern PyObject *MovieObj_New(Movie);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv@@ -146,6 +166,7 @@
117724f21a94ff32f773af4c37be88fe0d2970e3~suv extern int UserDataObj_Convert(PyObject *, UserData *);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv extern PyObject *MediaObj_New(Media);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv extern int MediaObj_Convert(PyObject *, Media *);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+#endif /* !__LP64__ */
117724f21a94ff32f773af4c37be88fe0d2970e3~suv
117724f21a94ff32f773af4c37be88fe0d2970e3~suv /* Res exports */
117724f21a94ff32f773af4c37be88fe0d2970e3~suv extern PyObject *ResObj_New(Handle);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv@@ -154,13 +175,17 @@
117724f21a94ff32f773af4c37be88fe0d2970e3~suv extern int OptResObj_Convert(PyObject *, Handle *);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv
117724f21a94ff32f773af4c37be88fe0d2970e3~suv /* TE exports */
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+#ifndef __LP64__
117724f21a94ff32f773af4c37be88fe0d2970e3~suv extern PyObject *TEObj_New(TEHandle);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv extern int TEObj_Convert(PyObject *, TEHandle *);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+#endif /* !__LP64__ */
117724f21a94ff32f773af4c37be88fe0d2970e3~suv
117724f21a94ff32f773af4c37be88fe0d2970e3~suv /* Win exports */
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+#ifndef __LP64__
117724f21a94ff32f773af4c37be88fe0d2970e3~suv extern PyObject *WinObj_New(WindowPtr);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv extern int WinObj_Convert(PyObject *, WindowPtr *);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv extern PyObject *WinObj_WhichWindow(WindowPtr);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+#endif /* !__LP64__ */
117724f21a94ff32f773af4c37be88fe0d2970e3~suv
117724f21a94ff32f773af4c37be88fe0d2970e3~suv /* CF exports */
117724f21a94ff32f773af4c37be88fe0d2970e3~suv extern PyObject *CFObj_New(CFTypeRef);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv--- Python/mactoolboxglue.c.orig 2006-07-12 02:44:25.000000000 +1000
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+++ Python/mactoolboxglue.c 2009-09-10 19:26:39.000000000 +1000
117724f21a94ff32f773af4c37be88fe0d2970e3~suv@@ -105,7 +105,7 @@
117724f21a94ff32f773af4c37be88fe0d2970e3~suv return PyErr_Mac(PyMac_GetOSErrException(), err);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv }
117724f21a94ff32f773af4c37be88fe0d2970e3~suv
117724f21a94ff32f773af4c37be88fe0d2970e3~suv-
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+#ifndef __LP64__
117724f21a94ff32f773af4c37be88fe0d2970e3~suv OSErr
117724f21a94ff32f773af4c37be88fe0d2970e3~suv PyMac_GetFullPathname(FSSpec *fss, char *path, int len)
117724f21a94ff32f773af4c37be88fe0d2970e3~suv {
117724f21a94ff32f773af4c37be88fe0d2970e3~suv@@ -153,6 +153,7 @@
117724f21a94ff32f773af4c37be88fe0d2970e3~suv Py_XDECREF(fs);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv return err;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv }
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+#endif /* !__LP64__ */
117724f21a94ff32f773af4c37be88fe0d2970e3~suv
117724f21a94ff32f773af4c37be88fe0d2970e3~suv /* Convert a 4-char string object argument to an OSType value */
117724f21a94ff32f773af4c37be88fe0d2970e3~suv int
117724f21a94ff32f773af4c37be88fe0d2970e3~suv@@ -417,6 +418,7 @@
117724f21a94ff32f773af4c37be88fe0d2970e3~suv GLUE_NEW(GWorldPtr, GWorldObj_New, "Carbon.Qdoffs")
117724f21a94ff32f773af4c37be88fe0d2970e3~suv GLUE_CONVERT(GWorldPtr, GWorldObj_Convert, "Carbon.Qdoffs")
117724f21a94ff32f773af4c37be88fe0d2970e3~suv
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+#ifndef __LP64__
117724f21a94ff32f773af4c37be88fe0d2970e3~suv GLUE_NEW(Track, TrackObj_New, "Carbon.Qt")
117724f21a94ff32f773af4c37be88fe0d2970e3~suv GLUE_CONVERT(Track, TrackObj_Convert, "Carbon.Qt")
117724f21a94ff32f773af4c37be88fe0d2970e3~suv GLUE_NEW(Movie, MovieObj_New, "Carbon.Qt")
117724f21a94ff32f773af4c37be88fe0d2970e3~suv@@ -429,6 +431,7 @@
117724f21a94ff32f773af4c37be88fe0d2970e3~suv GLUE_CONVERT(UserData, UserDataObj_Convert, "Carbon.Qt")
117724f21a94ff32f773af4c37be88fe0d2970e3~suv GLUE_NEW(Media, MediaObj_New, "Carbon.Qt")
117724f21a94ff32f773af4c37be88fe0d2970e3~suv GLUE_CONVERT(Media, MediaObj_Convert, "Carbon.Qt")
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+#endif /* !__LP64__ */
117724f21a94ff32f773af4c37be88fe0d2970e3~suv
117724f21a94ff32f773af4c37be88fe0d2970e3~suv GLUE_NEW(Handle, ResObj_New, "Carbon.Res")
117724f21a94ff32f773af4c37be88fe0d2970e3~suv GLUE_CONVERT(Handle, ResObj_Convert, "Carbon.Res")
117724f21a94ff32f773af4c37be88fe0d2970e3~suv--- Modules/_ctypes/libffi/src/darwin/ffitarget.h.orig 2006-05-26 07:58:05.000000000 +1000
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+++ Modules/_ctypes/libffi/src/darwin/ffitarget.h 2009-09-10 20:15:39.000000000 +1000
117724f21a94ff32f773af4c37be88fe0d2970e3~suv@@ -4,7 +4,7 @@
117724f21a94ff32f773af4c37be88fe0d2970e3~suv * created by configure). This makes is possible to build a univeral binary
117724f21a94ff32f773af4c37be88fe0d2970e3~suv * of ctypes in one go.
117724f21a94ff32f773af4c37be88fe0d2970e3~suv */
117724f21a94ff32f773af4c37be88fe0d2970e3~suv-#if defined(__i386__)
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+#if defined(__i386__) || defined(__x86_64__)
117724f21a94ff32f773af4c37be88fe0d2970e3~suv
117724f21a94ff32f773af4c37be88fe0d2970e3~suv #ifndef X86_DARWIN
117724f21a94ff32f773af4c37be88fe0d2970e3~suv #define X86_DARWIN
117724f21a94ff32f773af4c37be88fe0d2970e3~suv@@ -13,7 +13,7 @@
117724f21a94ff32f773af4c37be88fe0d2970e3~suv
117724f21a94ff32f773af4c37be88fe0d2970e3~suv #include "../src/x86/ffitarget.h"
117724f21a94ff32f773af4c37be88fe0d2970e3~suv
117724f21a94ff32f773af4c37be88fe0d2970e3~suv-#elif defined(__ppc__)
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+#elif defined(__ppc__) || defined(__ppc64__)
117724f21a94ff32f773af4c37be88fe0d2970e3~suv
117724f21a94ff32f773af4c37be88fe0d2970e3~suv #ifndef POWERPC_DARWIN
117724f21a94ff32f773af4c37be88fe0d2970e3~suv #define POWERPC_DARWIN
117724f21a94ff32f773af4c37be88fe0d2970e3~suv--- Mac/Modules/res/_Resmodule.c.orig 2005-07-04 06:59:44.000000000 +1000
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+++ Mac/Modules/res/_Resmodule.c 2009-09-10 20:44:43.000000000 +1000
117724f21a94ff32f773af4c37be88fe0d2970e3~suv@@ -414,6 +414,7 @@
117724f21a94ff32f773af4c37be88fe0d2970e3~suv return _res;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv }
117724f21a94ff32f773af4c37be88fe0d2970e3~suv
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+#ifndef __LP64__
117724f21a94ff32f773af4c37be88fe0d2970e3~suv static PyObject *ResObj_as_Control(ResourceObject *_self, PyObject *_args)
117724f21a94ff32f773af4c37be88fe0d2970e3~suv {
117724f21a94ff32f773af4c37be88fe0d2970e3~suv PyObject *_res = NULL;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv@@ -431,6 +432,7 @@
117724f21a94ff32f773af4c37be88fe0d2970e3~suv return _res;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv
117724f21a94ff32f773af4c37be88fe0d2970e3~suv }
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+#endif /* !__LP64__ */
117724f21a94ff32f773af4c37be88fe0d2970e3~suv
117724f21a94ff32f773af4c37be88fe0d2970e3~suv static PyObject *ResObj_LoadResource(ResourceObject *_self, PyObject *_args)
117724f21a94ff32f773af4c37be88fe0d2970e3~suv {
117724f21a94ff32f773af4c37be88fe0d2970e3~suv@@ -501,10 +503,12 @@
117724f21a94ff32f773af4c37be88fe0d2970e3~suv PyDoc_STR("(long newSize) -> None")},
117724f21a94ff32f773af4c37be88fe0d2970e3~suv {"GetNextFOND", (PyCFunction)ResObj_GetNextFOND, 1,
117724f21a94ff32f773af4c37be88fe0d2970e3~suv PyDoc_STR("() -> (Handle _rv)")},
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+#ifndef __LP64__
117724f21a94ff32f773af4c37be88fe0d2970e3~suv {"as_Control", (PyCFunction)ResObj_as_Control, 1,
117724f21a94ff32f773af4c37be88fe0d2970e3~suv PyDoc_STR("Return this resource/handle as a Control")},
117724f21a94ff32f773af4c37be88fe0d2970e3~suv {"as_Menu", (PyCFunction)ResObj_as_Menu, 1,
117724f21a94ff32f773af4c37be88fe0d2970e3~suv PyDoc_STR("Return this resource/handle as a Menu")},
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+#endif /* !__LP64__ */
117724f21a94ff32f773af4c37be88fe0d2970e3~suv {"LoadResource", (PyCFunction)ResObj_LoadResource, 1,
117724f21a94ff32f773af4c37be88fe0d2970e3~suv PyDoc_STR("() -> None")},
117724f21a94ff32f773af4c37be88fe0d2970e3~suv {"AutoDispose", (PyCFunction)ResObj_AutoDispose, 1,
117724f21a94ff32f773af4c37be88fe0d2970e3~suv@@ -1152,6 +1156,7 @@
117724f21a94ff32f773af4c37be88fe0d2970e3~suv return _res;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv }
117724f21a94ff32f773af4c37be88fe0d2970e3~suv
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+#ifndef __LP64__
117724f21a94ff32f773af4c37be88fe0d2970e3~suv static PyObject *Res_OpenRFPerm(PyObject *_self, PyObject *_args)
117724f21a94ff32f773af4c37be88fe0d2970e3~suv {
117724f21a94ff32f773af4c37be88fe0d2970e3~suv PyObject *_res = NULL;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv@@ -1287,6 +1292,7 @@
117724f21a94ff32f773af4c37be88fe0d2970e3~suv _res = Py_None;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv return _res;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv }
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+#endif /* !__LP64__ */
117724f21a94ff32f773af4c37be88fe0d2970e3~suv
117724f21a94ff32f773af4c37be88fe0d2970e3~suv static PyObject *Res_InsertResourceFile(PyObject *_self, PyObject *_args)
117724f21a94ff32f773af4c37be88fe0d2970e3~suv {
117724f21a94ff32f773af4c37be88fe0d2970e3~suv@@ -1327,6 +1333,7 @@
117724f21a94ff32f773af4c37be88fe0d2970e3~suv return _res;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv }
117724f21a94ff32f773af4c37be88fe0d2970e3~suv
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+#ifndef __LP64__
117724f21a94ff32f773af4c37be88fe0d2970e3~suv static PyObject *Res_FSpResourceFileAlreadyOpen(PyObject *_self, PyObject *_args)
117724f21a94ff32f773af4c37be88fe0d2970e3~suv {
117724f21a94ff32f773af4c37be88fe0d2970e3~suv PyObject *_res = NULL;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv@@ -1413,6 +1420,7 @@
117724f21a94ff32f773af4c37be88fe0d2970e3~suv nextRefNum);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv return _res;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv }
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+#endif /* !__LP64__ */
117724f21a94ff32f773af4c37be88fe0d2970e3~suv
117724f21a94ff32f773af4c37be88fe0d2970e3~suv static PyObject *Res_FSOpenResFile(PyObject *_self, PyObject *_args)
117724f21a94ff32f773af4c37be88fe0d2970e3~suv {
117724f21a94ff32f773af4c37be88fe0d2970e3~suv@@ -1438,6 +1446,7 @@
117724f21a94ff32f773af4c37be88fe0d2970e3~suv return _res;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv }
117724f21a94ff32f773af4c37be88fe0d2970e3~suv
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+#ifndef __LP64__
117724f21a94ff32f773af4c37be88fe0d2970e3~suv static PyObject *Res_FSCreateResFile(PyObject *_self, PyObject *_args)
117724f21a94ff32f773af4c37be88fe0d2970e3~suv {
117724f21a94ff32f773af4c37be88fe0d2970e3~suv PyObject *_res = NULL;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv@@ -1534,6 +1543,7 @@
117724f21a94ff32f773af4c37be88fe0d2970e3~suv PyMac_BuildFSSpec, &newSpec);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv return _res;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv }
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+#endif /* !__LP64__ */
117724f21a94ff32f773af4c37be88fe0d2970e3~suv
117724f21a94ff32f773af4c37be88fe0d2970e3~suv static PyObject *Res_FSOpenResourceFile(PyObject *_self, PyObject *_args)
117724f21a94ff32f773af4c37be88fe0d2970e3~suv {
117724f21a94ff32f773af4c37be88fe0d2970e3~suv@@ -1637,6 +1647,7 @@
117724f21a94ff32f773af4c37be88fe0d2970e3~suv PyDoc_STR("(short refNum) -> (short _rv)")},
117724f21a94ff32f773af4c37be88fe0d2970e3~suv {"SetResFileAttrs", (PyCFunction)Res_SetResFileAttrs, 1,
117724f21a94ff32f773af4c37be88fe0d2970e3~suv PyDoc_STR("(short refNum, short attrs) -> None")},
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+#ifndef __LP64__
117724f21a94ff32f773af4c37be88fe0d2970e3~suv {"OpenRFPerm", (PyCFunction)Res_OpenRFPerm, 1,
117724f21a94ff32f773af4c37be88fe0d2970e3~suv PyDoc_STR("(Str255 fileName, short vRefNum, SignedByte permission) -> (short _rv)")},
117724f21a94ff32f773af4c37be88fe0d2970e3~suv {"HOpenResFile", (PyCFunction)Res_HOpenResFile, 1,
117724f21a94ff32f773af4c37be88fe0d2970e3~suv@@ -1647,10 +1658,12 @@
117724f21a94ff32f773af4c37be88fe0d2970e3~suv PyDoc_STR("(FSSpec spec, SignedByte permission) -> (short _rv)")},
117724f21a94ff32f773af4c37be88fe0d2970e3~suv {"FSpCreateResFile", (PyCFunction)Res_FSpCreateResFile, 1,
117724f21a94ff32f773af4c37be88fe0d2970e3~suv PyDoc_STR("(FSSpec spec, OSType creator, OSType fileType, ScriptCode scriptTag) -> None")},
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+#endif /* !__LP64__ */
117724f21a94ff32f773af4c37be88fe0d2970e3~suv {"InsertResourceFile", (PyCFunction)Res_InsertResourceFile, 1,
117724f21a94ff32f773af4c37be88fe0d2970e3~suv PyDoc_STR("(SInt16 refNum, RsrcChainLocation where) -> None")},
117724f21a94ff32f773af4c37be88fe0d2970e3~suv {"DetachResourceFile", (PyCFunction)Res_DetachResourceFile, 1,
117724f21a94ff32f773af4c37be88fe0d2970e3~suv PyDoc_STR("(SInt16 refNum) -> None")},
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+#ifndef __LP64__
117724f21a94ff32f773af4c37be88fe0d2970e3~suv {"FSpResourceFileAlreadyOpen", (PyCFunction)Res_FSpResourceFileAlreadyOpen, 1,
117724f21a94ff32f773af4c37be88fe0d2970e3~suv PyDoc_STR("(FSSpec resourceFile) -> (Boolean _rv, Boolean inChain, SInt16 refNum)")},
117724f21a94ff32f773af4c37be88fe0d2970e3~suv {"FSpOpenOrphanResFile", (PyCFunction)Res_FSpOpenOrphanResFile, 1,
117724f21a94ff32f773af4c37be88fe0d2970e3~suv@@ -1659,14 +1672,17 @@
117724f21a94ff32f773af4c37be88fe0d2970e3~suv PyDoc_STR("() -> (SInt16 refNum)")},
117724f21a94ff32f773af4c37be88fe0d2970e3~suv {"GetNextResourceFile", (PyCFunction)Res_GetNextResourceFile, 1,
117724f21a94ff32f773af4c37be88fe0d2970e3~suv PyDoc_STR("(SInt16 curRefNum) -> (SInt16 nextRefNum)")},
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+#endif /* !__LP64__ */
117724f21a94ff32f773af4c37be88fe0d2970e3~suv {"FSOpenResFile", (PyCFunction)Res_FSOpenResFile, 1,
117724f21a94ff32f773af4c37be88fe0d2970e3~suv PyDoc_STR("(FSRef ref, SignedByte permission) -> (short _rv)")},
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+#ifndef __LP64__
117724f21a94ff32f773af4c37be88fe0d2970e3~suv {"FSCreateResFile", (PyCFunction)Res_FSCreateResFile, 1,
117724f21a94ff32f773af4c37be88fe0d2970e3~suv PyDoc_STR("(FSRef parentRef, Buffer nameLength) -> (FSRef newRef, FSSpec newSpec)")},
117724f21a94ff32f773af4c37be88fe0d2970e3~suv {"FSResourceFileAlreadyOpen", (PyCFunction)Res_FSResourceFileAlreadyOpen, 1,
117724f21a94ff32f773af4c37be88fe0d2970e3~suv PyDoc_STR("(FSRef resourceFileRef) -> (Boolean _rv, Boolean inChain, SInt16 refNum)")},
117724f21a94ff32f773af4c37be88fe0d2970e3~suv {"FSCreateResourceFile", (PyCFunction)Res_FSCreateResourceFile, 1,
117724f21a94ff32f773af4c37be88fe0d2970e3~suv PyDoc_STR("(FSRef parentRef, Buffer nameLength, Buffer forkNameLength) -> (FSRef newRef, FSSpec newSpec)")},
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+#endif /* !__LP64__ */
117724f21a94ff32f773af4c37be88fe0d2970e3~suv {"FSOpenResourceFile", (PyCFunction)Res_FSOpenResourceFile, 1,
117724f21a94ff32f773af4c37be88fe0d2970e3~suv PyDoc_STR("(FSRef ref, Buffer forkNameLength, SignedByte permissions) -> (SInt16 refNum)")},
117724f21a94ff32f773af4c37be88fe0d2970e3~suv {"Handle", (PyCFunction)Res_Handle, 1,
117724f21a94ff32f773af4c37be88fe0d2970e3~suv--- Mac/Modules/MacOS.c.orig 2006-07-26 05:20:54.000000000 +1000
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+++ Mac/Modules/MacOS.c 2009-09-10 21:47:34.000000000 +1000
117724f21a94ff32f773af4c37be88fe0d2970e3~suv@@ -54,7 +54,7 @@
117724f21a94ff32f773af4c37be88fe0d2970e3~suv do_close(rfobject *self)
117724f21a94ff32f773af4c37be88fe0d2970e3~suv {
117724f21a94ff32f773af4c37be88fe0d2970e3~suv if (self->isclosed ) return;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv- (void)FSClose(self->fRefNum);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ (void)FSCloseFork(self->fRefNum);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv self->isclosed = 1;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv }
117724f21a94ff32f773af4c37be88fe0d2970e3~suv
117724f21a94ff32f773af4c37be88fe0d2970e3~suv@@ -68,6 +68,7 @@
117724f21a94ff32f773af4c37be88fe0d2970e3~suv long n;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv PyObject *v;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv OSErr err;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ ByteCount n2;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv
117724f21a94ff32f773af4c37be88fe0d2970e3~suv if (self->isclosed) {
117724f21a94ff32f773af4c37be88fe0d2970e3~suv PyErr_SetString(PyExc_ValueError, "Operation on closed file");
117724f21a94ff32f773af4c37be88fe0d2970e3~suv@@ -81,13 +82,13 @@
117724f21a94ff32f773af4c37be88fe0d2970e3~suv if (v == NULL)
117724f21a94ff32f773af4c37be88fe0d2970e3~suv return NULL;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv
117724f21a94ff32f773af4c37be88fe0d2970e3~suv- err = FSRead(self->fRefNum, &n, PyString_AsString(v));
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ err = FSReadFork(self->fRefNum, fsAtMark, 0, n, PyString_AsString(v), &n2);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv if (err && err != eofErr) {
117724f21a94ff32f773af4c37be88fe0d2970e3~suv PyMac_Error(err);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv Py_DECREF(v);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv return NULL;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv }
117724f21a94ff32f773af4c37be88fe0d2970e3~suv- _PyString_Resize(&v, n);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ _PyString_Resize(&v, n2);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv return v;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv }
117724f21a94ff32f773af4c37be88fe0d2970e3~suv
117724f21a94ff32f773af4c37be88fe0d2970e3~suv@@ -109,7 +110,7 @@
117724f21a94ff32f773af4c37be88fe0d2970e3~suv }
117724f21a94ff32f773af4c37be88fe0d2970e3~suv if (!PyArg_ParseTuple(args, "s#", &buffer, &size))
117724f21a94ff32f773af4c37be88fe0d2970e3~suv return NULL;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv- err = FSWrite(self->fRefNum, &size, buffer);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ err = FSWriteFork(self->fRefNum, fsAtMark, 0, size, buffer, NULL);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv if (err) {
117724f21a94ff32f773af4c37be88fe0d2970e3~suv PyMac_Error(err);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv return NULL;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv@@ -126,9 +127,9 @@
117724f21a94ff32f773af4c37be88fe0d2970e3~suv static PyObject *
117724f21a94ff32f773af4c37be88fe0d2970e3~suv rf_seek(rfobject *self, PyObject *args)
117724f21a94ff32f773af4c37be88fe0d2970e3~suv {
117724f21a94ff32f773af4c37be88fe0d2970e3~suv- long amount, pos;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ long amount;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv int whence = SEEK_SET;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv- long eof;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ int mode;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv OSErr err;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv
117724f21a94ff32f773af4c37be88fe0d2970e3~suv if (self->isclosed) {
117724f21a94ff32f773af4c37be88fe0d2970e3~suv@@ -138,35 +139,23 @@
117724f21a94ff32f773af4c37be88fe0d2970e3~suv if (!PyArg_ParseTuple(args, "l|i", &amount, &whence))
117724f21a94ff32f773af4c37be88fe0d2970e3~suv return NULL;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv
117724f21a94ff32f773af4c37be88fe0d2970e3~suv- if ((err = GetEOF(self->fRefNum, &eof)))
117724f21a94ff32f773af4c37be88fe0d2970e3~suv- goto ioerr;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv-
117724f21a94ff32f773af4c37be88fe0d2970e3~suv switch (whence) {
117724f21a94ff32f773af4c37be88fe0d2970e3~suv case SEEK_CUR:
117724f21a94ff32f773af4c37be88fe0d2970e3~suv- if ((err = GetFPos(self->fRefNum, &pos)))
117724f21a94ff32f773af4c37be88fe0d2970e3~suv- goto ioerr;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ mode = fsFromMark;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv break;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv case SEEK_END:
117724f21a94ff32f773af4c37be88fe0d2970e3~suv- pos = eof;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ mode = fsFromLEOF;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv break;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv case SEEK_SET:
117724f21a94ff32f773af4c37be88fe0d2970e3~suv- pos = 0;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ mode = fsFromStart;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv break;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv default:
117724f21a94ff32f773af4c37be88fe0d2970e3~suv PyErr_BadArgument();
117724f21a94ff32f773af4c37be88fe0d2970e3~suv return NULL;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv }
117724f21a94ff32f773af4c37be88fe0d2970e3~suv
117724f21a94ff32f773af4c37be88fe0d2970e3~suv- pos += amount;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv-
117724f21a94ff32f773af4c37be88fe0d2970e3~suv- /* Don't bother implementing seek past EOF */
117724f21a94ff32f773af4c37be88fe0d2970e3~suv- if (pos > eof || pos < 0) {
117724f21a94ff32f773af4c37be88fe0d2970e3~suv- PyErr_BadArgument();
117724f21a94ff32f773af4c37be88fe0d2970e3~suv- return NULL;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv- }
117724f21a94ff32f773af4c37be88fe0d2970e3~suv-
117724f21a94ff32f773af4c37be88fe0d2970e3~suv- if ((err = SetFPos(self->fRefNum, fsFromStart, pos)) ) {
117724f21a94ff32f773af4c37be88fe0d2970e3~suv-ioerr:
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ err = FSSetForkPosition(self->fRefNum, mode, amount);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ if (err != noErr) {
117724f21a94ff32f773af4c37be88fe0d2970e3~suv PyMac_Error(err);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv return NULL;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv }
117724f21a94ff32f773af4c37be88fe0d2970e3~suv@@ -182,7 +171,7 @@
117724f21a94ff32f773af4c37be88fe0d2970e3~suv static PyObject *
117724f21a94ff32f773af4c37be88fe0d2970e3~suv rf_tell(rfobject *self, PyObject *args)
117724f21a94ff32f773af4c37be88fe0d2970e3~suv {
117724f21a94ff32f773af4c37be88fe0d2970e3~suv- long where;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ long long where;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv OSErr err;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv
117724f21a94ff32f773af4c37be88fe0d2970e3~suv if (self->isclosed) {
117724f21a94ff32f773af4c37be88fe0d2970e3~suv@@ -191,11 +180,13 @@
117724f21a94ff32f773af4c37be88fe0d2970e3~suv }
117724f21a94ff32f773af4c37be88fe0d2970e3~suv if (!PyArg_ParseTuple(args, ""))
117724f21a94ff32f773af4c37be88fe0d2970e3~suv return NULL;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv- if ((err = GetFPos(self->fRefNum, &where)) ) {
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ err = FSGetForkPosition(self->fRefNum, &where);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ if (err != noErr) {
117724f21a94ff32f773af4c37be88fe0d2970e3~suv PyMac_Error(err);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv return NULL;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv }
117724f21a94ff32f773af4c37be88fe0d2970e3~suv- return PyInt_FromLong(where);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ return PyLong_FromLongLong(where);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv }
117724f21a94ff32f773af4c37be88fe0d2970e3~suv
117724f21a94ff32f773af4c37be88fe0d2970e3~suv static char rf_close__doc__[] =
117724f21a94ff32f773af4c37be88fe0d2970e3~suv@@ -292,17 +283,61 @@
117724f21a94ff32f773af4c37be88fe0d2970e3~suv static PyObject *
117724f21a94ff32f773af4c37be88fe0d2970e3~suv MacOS_GetCreatorAndType(PyObject *self, PyObject *args)
117724f21a94ff32f773af4c37be88fe0d2970e3~suv {
117724f21a94ff32f773af4c37be88fe0d2970e3~suv- FSSpec fss;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv- FInfo info;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv PyObject *creator, *type, *res;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv OSErr err;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv-
117724f21a94ff32f773af4c37be88fe0d2970e3~suv- if (!PyArg_ParseTuple(args, "O&", PyMac_GetFSSpec, &fss))
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ FSRef ref;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ FSCatalogInfo cataloginfo;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ FileInfo* finfo;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ if (!PyArg_ParseTuple(args, "O&", PyMac_GetFSRef, &ref)) {
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+#ifndef __LP64__
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ /* This function is documented to take an FSSpec as well,
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ * which only works in 32-bit mode.
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ */
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ PyErr_Clear();
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ FSSpec fss;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ FInfo info;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ if (!PyArg_ParseTuple(args, "O&", PyMac_GetFSSpec, &fss))
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ return NULL;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ if ((err = FSpGetFInfo(&fss, &info)) != noErr) {
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ return PyErr_Mac(MacOS_Error, err);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ }
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ creator = PyString_FromStringAndSize(
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ (char *)&info.fdCreator, 4);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ type = PyString_FromStringAndSize((char *)&info.fdType, 4);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ res = Py_BuildValue("OO", creator, type);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ Py_DECREF(creator);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ Py_DECREF(type);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ return res;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+#else /* __LP64__ */
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ return NULL;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+#endif /* __LP64__ */
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ }
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ err = FSGetCatalogInfo(&ref,
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ kFSCatInfoFinderInfo|kFSCatInfoNodeFlags, &cataloginfo,
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ NULL, NULL, NULL);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ if (err != noErr) {
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ PyErr_Mac(MacOS_Error, err);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv return NULL;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv- if ((err = FSpGetFInfo(&fss, &info)) != noErr)
117724f21a94ff32f773af4c37be88fe0d2970e3~suv- return PyErr_Mac(MacOS_Error, err);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv- creator = PyString_FromStringAndSize((char *)&info.fdCreator, 4);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv- type = PyString_FromStringAndSize((char *)&info.fdType, 4);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ }
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ if ((cataloginfo.nodeFlags & kFSNodeIsDirectoryMask) != 0) {
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ /* Directory: doesn't have type/creator info.
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ *
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ * The specific error code is for backward compatibility with
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ * earlier versions.
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ */
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ PyErr_Mac(MacOS_Error, fnfErr);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ return NULL;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ }
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ finfo = (FileInfo*)&(cataloginfo.finderInfo);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ creator = PyString_FromStringAndSize((char*)&(finfo->fileCreator), 4);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ type = PyString_FromStringAndSize((char*)&(finfo->fileType), 4);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+
117724f21a94ff32f773af4c37be88fe0d2970e3~suv res = Py_BuildValue("OO", creator, type);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv Py_DECREF(creator);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv Py_DECREF(type);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv@@ -314,20 +349,66 @@
117724f21a94ff32f773af4c37be88fe0d2970e3~suv static PyObject *
117724f21a94ff32f773af4c37be88fe0d2970e3~suv MacOS_SetCreatorAndType(PyObject *self, PyObject *args)
117724f21a94ff32f773af4c37be88fe0d2970e3~suv {
117724f21a94ff32f773af4c37be88fe0d2970e3~suv- FSSpec fss;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv ResType creator, type;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv- FInfo info;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ FSRef ref;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ FileInfo* finfo;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv OSErr err;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv-
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ FSCatalogInfo cataloginfo;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+
117724f21a94ff32f773af4c37be88fe0d2970e3~suv if (!PyArg_ParseTuple(args, "O&O&O&",
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ PyMac_GetFSRef, &ref, PyMac_GetOSType, &creator, PyMac_GetOSType, &type)) {
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+#ifndef __LP64__
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ /* Try to handle FSSpec arguments, for backward compatibility */
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ FSSpec fss;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ FInfo info;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ if (!PyArg_ParseTuple(args, "O&O&O&",
117724f21a94ff32f773af4c37be88fe0d2970e3~suv PyMac_GetFSSpec, &fss, PyMac_GetOSType, &creator, PyMac_GetOSType, &type))
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ return NULL;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ if ((err = FSpGetFInfo(&fss, &info)) != noErr)
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ return PyErr_Mac(MacOS_Error, err);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ info.fdCreator = creator;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ info.fdType = type;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ if ((err = FSpSetFInfo(&fss, &info)) != noErr)
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ return PyErr_Mac(MacOS_Error, err);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ Py_INCREF(Py_None);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ return Py_None;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+#else /* __LP64__ */
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ return NULL;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+#endif /* __LP64__ */
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ }
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ err = FSGetCatalogInfo(&ref,
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ kFSCatInfoFinderInfo|kFSCatInfoNodeFlags, &cataloginfo,
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ NULL, NULL, NULL);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ if (err != noErr) {
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ PyErr_Mac(MacOS_Error, err);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv return NULL;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv- if ((err = FSpGetFInfo(&fss, &info)) != noErr)
117724f21a94ff32f773af4c37be88fe0d2970e3~suv- return PyErr_Mac(MacOS_Error, err);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv- info.fdCreator = creator;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv- info.fdType = type;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv- if ((err = FSpSetFInfo(&fss, &info)) != noErr)
117724f21a94ff32f773af4c37be88fe0d2970e3~suv- return PyErr_Mac(MacOS_Error, err);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ }
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ if ((cataloginfo.nodeFlags & kFSNodeIsDirectoryMask) != 0) {
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ /* Directory: doesn't have type/creator info.
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ *
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ * The specific error code is for backward compatibility with
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ * earlier versions.
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ */
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ PyErr_Mac(MacOS_Error, fnfErr);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ return NULL;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ }
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ finfo = (FileInfo*)&(cataloginfo.finderInfo);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ finfo->fileCreator = creator;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ finfo->fileType = type;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ err = FSSetCatalogInfo(&ref, kFSCatInfoFinderInfo, &cataloginfo);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ if (err != noErr) {
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ PyErr_Mac(MacOS_Error, fnfErr);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ return NULL;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ }
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+
117724f21a94ff32f773af4c37be88fe0d2970e3~suv Py_INCREF(Py_None);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv return Py_None;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv }
117724f21a94ff32f773af4c37be88fe0d2970e3~suv@@ -399,6 +480,7 @@
117724f21a94ff32f773af4c37be88fe0d2970e3~suv return Py_BuildValue("s", buf);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv }
117724f21a94ff32f773af4c37be88fe0d2970e3~suv
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+#ifndef __LP64__
117724f21a94ff32f773af4c37be88fe0d2970e3~suv static char splash_doc[] = "Open a splash-screen dialog by resource-id (0=close)";
117724f21a94ff32f773af4c37be88fe0d2970e3~suv
117724f21a94ff32f773af4c37be88fe0d2970e3~suv static PyObject *
117724f21a94ff32f773af4c37be88fe0d2970e3~suv@@ -470,6 +552,7 @@
117724f21a94ff32f773af4c37be88fe0d2970e3~suv Py_INCREF(Py_None);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv return Py_None;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv }
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+#endif /* !__LP64__ */
117724f21a94ff32f773af4c37be88fe0d2970e3~suv
117724f21a94ff32f773af4c37be88fe0d2970e3~suv static char WMAvailable_doc[] =
117724f21a94ff32f773af4c37be88fe0d2970e3~suv "True if this process can interact with the display."
117724f21a94ff32f773af4c37be88fe0d2970e3~suv@@ -530,17 +613,18 @@
117724f21a94ff32f773af4c37be88fe0d2970e3~suv {
117724f21a94ff32f773af4c37be88fe0d2970e3~suv OSErr err;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv char *mode = "r";
117724f21a94ff32f773af4c37be88fe0d2970e3~suv- FSSpec fss;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv- SignedByte permission = 1;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ FSRef ref;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ SInt8 permission = fsRdPerm;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv rfobject *fp;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ HFSUniStr255 name;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv
117724f21a94ff32f773af4c37be88fe0d2970e3~suv- if (!PyArg_ParseTuple(args, "O&|s", PyMac_GetFSSpec, &fss, &mode))
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ if (!PyArg_ParseTuple(args, "O&|s", PyMac_GetFSRef, &ref, &mode))
117724f21a94ff32f773af4c37be88fe0d2970e3~suv return NULL;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv while (*mode) {
117724f21a94ff32f773af4c37be88fe0d2970e3~suv switch (*mode++) {
117724f21a94ff32f773af4c37be88fe0d2970e3~suv case '*': break;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv- case 'r': permission = 1; break;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv- case 'w': permission = 2; break;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ case 'r': permission = fsRdPerm; break;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ case 'w': permission = fsWrPerm; break;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv case 'b': break;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv default:
117724f21a94ff32f773af4c37be88fe0d2970e3~suv PyErr_BadArgument();
117724f21a94ff32f773af4c37be88fe0d2970e3~suv@@ -548,33 +632,18 @@
117724f21a94ff32f773af4c37be88fe0d2970e3~suv }
117724f21a94ff32f773af4c37be88fe0d2970e3~suv }
117724f21a94ff32f773af4c37be88fe0d2970e3~suv
117724f21a94ff32f773af4c37be88fe0d2970e3~suv- if ( (fp = newrfobject()) == NULL )
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ err = FSGetResourceForkName(&name);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ if (err != noErr) {
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ PyMac_Error(err);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv return NULL;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ }
117724f21a94ff32f773af4c37be88fe0d2970e3~suv
117724f21a94ff32f773af4c37be88fe0d2970e3~suv- err = HOpenRF(fss.vRefNum, fss.parID, fss.name, permission, &fp->fRefNum);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ if ( (fp = newrfobject()) == NULL )
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ return NULL;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+
117724f21a94ff32f773af4c37be88fe0d2970e3~suv
117724f21a94ff32f773af4c37be88fe0d2970e3~suv- if ( err == fnfErr ) {
117724f21a94ff32f773af4c37be88fe0d2970e3~suv- /* In stead of doing complicated things here to get creator/type
117724f21a94ff32f773af4c37be88fe0d2970e3~suv- ** correct we let the standard i/o library handle it
117724f21a94ff32f773af4c37be88fe0d2970e3~suv- */
117724f21a94ff32f773af4c37be88fe0d2970e3~suv- FILE *tfp;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv- char pathname[PATHNAMELEN];
117724f21a94ff32f773af4c37be88fe0d2970e3~suv-
117724f21a94ff32f773af4c37be88fe0d2970e3~suv- if ( (err=PyMac_GetFullPathname(&fss, pathname, PATHNAMELEN)) ) {
117724f21a94ff32f773af4c37be88fe0d2970e3~suv- PyMac_Error(err);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv- Py_DECREF(fp);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv- return NULL;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv- }
117724f21a94ff32f773af4c37be88fe0d2970e3~suv-
117724f21a94ff32f773af4c37be88fe0d2970e3~suv- if ( (tfp = fopen(pathname, "w")) == NULL ) {
117724f21a94ff32f773af4c37be88fe0d2970e3~suv- PyMac_Error(fnfErr); /* What else... */
117724f21a94ff32f773af4c37be88fe0d2970e3~suv- Py_DECREF(fp);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv- return NULL;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv- }
117724f21a94ff32f773af4c37be88fe0d2970e3~suv- fclose(tfp);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv- err = HOpenRF(fss.vRefNum, fss.parID, fss.name, permission, &fp->fRefNum);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv- }
117724f21a94ff32f773af4c37be88fe0d2970e3~suv- if ( err ) {
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ err = FSOpenFork(&ref, name.length, name.unicode, permission, &fp->fRefNum);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ if (err != noErr) {
117724f21a94ff32f773af4c37be88fe0d2970e3~suv Py_DECREF(fp);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv PyMac_Error(err);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv return NULL;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv@@ -589,10 +658,12 @@
117724f21a94ff32f773af4c37be88fe0d2970e3~suv {"SetCreatorAndType", MacOS_SetCreatorAndType, 1, setcrtp_doc},
117724f21a94ff32f773af4c37be88fe0d2970e3~suv {"GetErrorString", MacOS_GetErrorString, 1, geterr_doc},
117724f21a94ff32f773af4c37be88fe0d2970e3~suv {"openrf", MacOS_openrf, 1, openrf_doc},
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+#ifndef __LP64__
117724f21a94ff32f773af4c37be88fe0d2970e3~suv {"splash", MacOS_splash, 1, splash_doc},
117724f21a94ff32f773af4c37be88fe0d2970e3~suv {"DebugStr", MacOS_DebugStr, 1, DebugStr_doc},
117724f21a94ff32f773af4c37be88fe0d2970e3~suv- {"GetTicks", MacOS_GetTicks, 1, GetTicks_doc},
117724f21a94ff32f773af4c37be88fe0d2970e3~suv {"SysBeep", MacOS_SysBeep, 1, SysBeep_doc},
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+#endif /* !__LP64__ */
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ {"GetTicks", MacOS_GetTicks, 1, GetTicks_doc},
117724f21a94ff32f773af4c37be88fe0d2970e3~suv {"WMAvailable", MacOS_WMAvailable, 1, WMAvailable_doc},
117724f21a94ff32f773af4c37be88fe0d2970e3~suv {NULL, NULL} /* Sentinel */
117724f21a94ff32f773af4c37be88fe0d2970e3~suv };
117724f21a94ff32f773af4c37be88fe0d2970e3~suv--- Mac/Modules/file/_Filemodule.c.orig 2006-05-29 07:57:35.000000000 +1000
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+++ Mac/Modules/file/_Filemodule.c 2009-09-10 22:48:47.000000000 +1000
117724f21a94ff32f773af4c37be88fe0d2970e3~suv@@ -18,9 +18,11 @@
117724f21a94ff32f773af4c37be88fe0d2970e3~suv #include <Carbon/Carbon.h>
117724f21a94ff32f773af4c37be88fe0d2970e3~suv
117724f21a94ff32f773af4c37be88fe0d2970e3~suv #ifdef USE_TOOLBOX_OBJECT_GLUE
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+#ifndef __LP64__
117724f21a94ff32f773af4c37be88fe0d2970e3~suv extern int _PyMac_GetFSSpec(PyObject *v, FSSpec *spec);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv-extern int _PyMac_GetFSRef(PyObject *v, FSRef *fsr);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv extern PyObject *_PyMac_BuildFSSpec(FSSpec *spec);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+#endif /* !__LP64__ */
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+extern int _PyMac_GetFSRef(PyObject *v, FSRef *fsr);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv extern PyObject *_PyMac_BuildFSRef(FSRef *spec);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv
117724f21a94ff32f773af4c37be88fe0d2970e3~suv #define PyMac_GetFSSpec _PyMac_GetFSSpec
117724f21a94ff32f773af4c37be88fe0d2970e3~suv@@ -28,20 +30,26 @@
117724f21a94ff32f773af4c37be88fe0d2970e3~suv #define PyMac_BuildFSSpec _PyMac_BuildFSSpec
117724f21a94ff32f773af4c37be88fe0d2970e3~suv #define PyMac_BuildFSRef _PyMac_BuildFSRef
117724f21a94ff32f773af4c37be88fe0d2970e3~suv #else
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+#ifndef __LP64__
117724f21a94ff32f773af4c37be88fe0d2970e3~suv extern int PyMac_GetFSSpec(PyObject *v, FSSpec *spec);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv-extern int PyMac_GetFSRef(PyObject *v, FSRef *fsr);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv extern PyObject *PyMac_BuildFSSpec(FSSpec *spec);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+#endif /* !__LP64__ */
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+extern int PyMac_GetFSRef(PyObject *v, FSRef *fsr);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv extern PyObject *PyMac_BuildFSRef(FSRef *spec);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv #endif
117724f21a94ff32f773af4c37be88fe0d2970e3~suv
117724f21a94ff32f773af4c37be88fe0d2970e3~suv /* Forward declarations */
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+#ifndef __LP64__
117724f21a94ff32f773af4c37be88fe0d2970e3~suv static PyObject *FInfo_New(FInfo *itself);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv-static PyObject *FSRef_New(FSRef *itself);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv static PyObject *FSSpec_New(FSSpec *itself);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+#define FSSpec_Convert PyMac_GetFSSpec
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+#endif /* !__LP64__ */
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+static PyObject *FSRef_New(FSRef *itself);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv static PyObject *Alias_New(AliasHandle itself);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+#ifndef __LP64__
117724f21a94ff32f773af4c37be88fe0d2970e3~suv static int FInfo_Convert(PyObject *v, FInfo *p_itself);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+#endif /* !__LP64__ */
117724f21a94ff32f773af4c37be88fe0d2970e3~suv #define FSRef_Convert PyMac_GetFSRef
117724f21a94ff32f773af4c37be88fe0d2970e3~suv-#define FSSpec_Convert PyMac_GetFSSpec
117724f21a94ff32f773af4c37be88fe0d2970e3~suv static int Alias_Convert(PyObject *v, AliasHandle *p_itself);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv
117724f21a94ff32f773af4c37be88fe0d2970e3~suv /*
117724f21a94ff32f773af4c37be88fe0d2970e3~suv@@ -62,6 +70,7 @@
117724f21a94ff32f773af4c37be88fe0d2970e3~suv /*
117724f21a94ff32f773af4c37be88fe0d2970e3~suv ** Optional fsspec and fsref pointers. None will pass NULL
117724f21a94ff32f773af4c37be88fe0d2970e3~suv */
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+#ifndef __LP64__
117724f21a94ff32f773af4c37be88fe0d2970e3~suv static int
117724f21a94ff32f773af4c37be88fe0d2970e3~suv myPyMac_GetOptFSSpecPtr(PyObject *v, FSSpec **spec)
117724f21a94ff32f773af4c37be88fe0d2970e3~suv {
117724f21a94ff32f773af4c37be88fe0d2970e3~suv@@ -71,6 +80,7 @@
117724f21a94ff32f773af4c37be88fe0d2970e3~suv }
117724f21a94ff32f773af4c37be88fe0d2970e3~suv return PyMac_GetFSSpec(v, *spec);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv }
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+#endif /* !__LP64__ */
117724f21a94ff32f773af4c37be88fe0d2970e3~suv
117724f21a94ff32f773af4c37be88fe0d2970e3~suv static int
117724f21a94ff32f773af4c37be88fe0d2970e3~suv myPyMac_GetOptFSRefPtr(PyObject *v, FSRef **ref)
117724f21a94ff32f773af4c37be88fe0d2970e3~suv@@ -92,6 +102,7 @@
117724f21a94ff32f773af4c37be88fe0d2970e3~suv return Py_BuildValue("u#", itself->unicode, itself->length);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv }
117724f21a94ff32f773af4c37be88fe0d2970e3~suv
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+#ifndef __LP64__
117724f21a94ff32f773af4c37be88fe0d2970e3~suv static OSErr
117724f21a94ff32f773af4c37be88fe0d2970e3~suv _PyMac_GetFullPathname(FSSpec *fss, char *path, int len)
117724f21a94ff32f773af4c37be88fe0d2970e3~suv {
117724f21a94ff32f773af4c37be88fe0d2970e3~suv@@ -135,6 +146,7 @@
117724f21a94ff32f773af4c37be88fe0d2970e3~suv }
117724f21a94ff32f773af4c37be88fe0d2970e3~suv return 0;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv }
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+#endif /* !__LP64__ */
117724f21a94ff32f773af4c37be88fe0d2970e3~suv
117724f21a94ff32f773af4c37be88fe0d2970e3~suv
117724f21a94ff32f773af4c37be88fe0d2970e3~suv static PyObject *File_Error;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv@@ -282,12 +294,28 @@
117724f21a94ff32f773af4c37be88fe0d2970e3~suv
117724f21a94ff32f773af4c37be88fe0d2970e3~suv static PyObject *FSCatalogInfo_get_permissions(FSCatalogInfoObject *self, void *closure)
117724f21a94ff32f773af4c37be88fe0d2970e3~suv {
117724f21a94ff32f773af4c37be88fe0d2970e3~suv- return Py_BuildValue("(llll)", self->ob_itself.permissions[0], self->ob_itself.permissions[1], self->ob_itself.permissions[2], self->ob_itself.permissions[3]);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ FSPermissionInfo* info = (FSPermissionInfo*)&(self->ob_itself.permissions);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ return Py_BuildValue("(llll)", info->userID, info->groupID, info->userAccess, info->mode);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv }
117724f21a94ff32f773af4c37be88fe0d2970e3~suv
117724f21a94ff32f773af4c37be88fe0d2970e3~suv static int FSCatalogInfo_set_permissions(FSCatalogInfoObject *self, PyObject *v, void *closure)
117724f21a94ff32f773af4c37be88fe0d2970e3~suv {
117724f21a94ff32f773af4c37be88fe0d2970e3~suv- return PyArg_Parse(v, "(llll)", &self->ob_itself.permissions[0], &self->ob_itself.permissions[1], &self->ob_itself.permissions[2], &self->ob_itself.permissions[3])-1;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ long userID;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ long groupID;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ long userAccess;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ long mode;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ int r;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ FSPermissionInfo* info = (FSPermissionInfo*)&(self->ob_itself.permissions);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ r = PyArg_Parse(v, "(llll)", &userID, &groupID, &userAccess, &mode);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ if (!r) {
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ return -1;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ }
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ info->userID = userID;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ info->groupID = groupID;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ info->userAccess = userAccess;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ info->mode = mode;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv return 0;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv }
117724f21a94ff32f773af4c37be88fe0d2970e3~suv
117724f21a94ff32f773af4c37be88fe0d2970e3~suv@@ -501,6 +529,7 @@
117724f21a94ff32f773af4c37be88fe0d2970e3~suv
117724f21a94ff32f773af4c37be88fe0d2970e3~suv /* ----------------------- Object type FInfo ------------------------ */
117724f21a94ff32f773af4c37be88fe0d2970e3~suv
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+#ifndef __LP64__
117724f21a94ff32f773af4c37be88fe0d2970e3~suv static PyTypeObject FInfo_Type;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv
117724f21a94ff32f773af4c37be88fe0d2970e3~suv #define FInfo_Check(x) ((x)->ob_type == &FInfo_Type || PyObject_TypeCheck((x), &FInfo_Type))
117724f21a94ff32f773af4c37be88fe0d2970e3~suv@@ -682,6 +711,7 @@
117724f21a94ff32f773af4c37be88fe0d2970e3~suv FInfo_tp_free, /* tp_free */
117724f21a94ff32f773af4c37be88fe0d2970e3~suv };
117724f21a94ff32f773af4c37be88fe0d2970e3~suv
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+#endif /* !__LP64__ */
117724f21a94ff32f773af4c37be88fe0d2970e3~suv /* --------------------- End object type FInfo ---------------------- */
117724f21a94ff32f773af4c37be88fe0d2970e3~suv
117724f21a94ff32f773af4c37be88fe0d2970e3~suv
117724f21a94ff32f773af4c37be88fe0d2970e3~suv@@ -729,6 +759,7 @@
117724f21a94ff32f773af4c37be88fe0d2970e3~suv self->ob_type->tp_free((PyObject *)self);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv }
117724f21a94ff32f773af4c37be88fe0d2970e3~suv
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+#ifndef __LP64__
117724f21a94ff32f773af4c37be88fe0d2970e3~suv static PyObject *Alias_ResolveAlias(AliasObject *_self, PyObject *_args)
117724f21a94ff32f773af4c37be88fe0d2970e3~suv {
117724f21a94ff32f773af4c37be88fe0d2970e3~suv PyObject *_res = NULL;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv@@ -818,6 +849,7 @@
117724f21a94ff32f773af4c37be88fe0d2970e3~suv wasChanged);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv return _res;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv }
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+#endif /* !__LP64__ */
117724f21a94ff32f773af4c37be88fe0d2970e3~suv
117724f21a94ff32f773af4c37be88fe0d2970e3~suv static PyObject *Alias_FSResolveAliasWithMountFlags(AliasObject *_self, PyObject *_args)
117724f21a94ff32f773af4c37be88fe0d2970e3~suv {
117724f21a94ff32f773af4c37be88fe0d2970e3~suv@@ -891,6 +923,7 @@
117724f21a94ff32f773af4c37be88fe0d2970e3~suv }
117724f21a94ff32f773af4c37be88fe0d2970e3~suv
117724f21a94ff32f773af4c37be88fe0d2970e3~suv static PyMethodDef Alias_methods[] = {
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+#ifndef __LP64__
117724f21a94ff32f773af4c37be88fe0d2970e3~suv {"ResolveAlias", (PyCFunction)Alias_ResolveAlias, 1,
117724f21a94ff32f773af4c37be88fe0d2970e3~suv PyDoc_STR("(FSSpec fromFile) -> (FSSpec target, Boolean wasChanged)")},
117724f21a94ff32f773af4c37be88fe0d2970e3~suv {"GetAliasInfo", (PyCFunction)Alias_GetAliasInfo, 1,
117724f21a94ff32f773af4c37be88fe0d2970e3~suv@@ -899,6 +932,7 @@
117724f21a94ff32f773af4c37be88fe0d2970e3~suv PyDoc_STR("(FSSpec fromFile, unsigned long mountFlags) -> (FSSpec target, Boolean wasChanged)")},
117724f21a94ff32f773af4c37be88fe0d2970e3~suv {"FollowFinderAlias", (PyCFunction)Alias_FollowFinderAlias, 1,
117724f21a94ff32f773af4c37be88fe0d2970e3~suv PyDoc_STR("(FSSpec fromFile, Boolean logon) -> (FSSpec target, Boolean wasChanged)")},
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+#endif /* !__LP64__ */
117724f21a94ff32f773af4c37be88fe0d2970e3~suv {"FSResolveAliasWithMountFlags", (PyCFunction)Alias_FSResolveAliasWithMountFlags, 1,
117724f21a94ff32f773af4c37be88fe0d2970e3~suv PyDoc_STR("(FSRef fromFile, unsigned long mountFlags) -> (FSRef target, Boolean wasChanged)")},
117724f21a94ff32f773af4c37be88fe0d2970e3~suv {"FSResolveAlias", (PyCFunction)Alias_FSResolveAlias, 1,
117724f21a94ff32f773af4c37be88fe0d2970e3~suv@@ -1033,6 +1067,7 @@
117724f21a94ff32f773af4c37be88fe0d2970e3~suv
117724f21a94ff32f773af4c37be88fe0d2970e3~suv
117724f21a94ff32f773af4c37be88fe0d2970e3~suv /* ----------------------- Object type FSSpec ----------------------- */
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+#ifndef __LP64__
117724f21a94ff32f773af4c37be88fe0d2970e3~suv
117724f21a94ff32f773af4c37be88fe0d2970e3~suv static PyTypeObject FSSpec_Type;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv
117724f21a94ff32f773af4c37be88fe0d2970e3~suv@@ -1488,6 +1523,7 @@
117724f21a94ff32f773af4c37be88fe0d2970e3~suv FSSpec_tp_free, /* tp_free */
117724f21a94ff32f773af4c37be88fe0d2970e3~suv };
117724f21a94ff32f773af4c37be88fe0d2970e3~suv
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+#endif /* !__LP64__ */
117724f21a94ff32f773af4c37be88fe0d2970e3~suv /* --------------------- End object type FSSpec --------------------- */
117724f21a94ff32f773af4c37be88fe0d2970e3~suv
117724f21a94ff32f773af4c37be88fe0d2970e3~suv
117724f21a94ff32f773af4c37be88fe0d2970e3~suv@@ -1568,7 +1604,9 @@
117724f21a94ff32f773af4c37be88fe0d2970e3~suv FSCatalogInfoBitmap whichInfo;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv FSCatalogInfo catalogInfo;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv FSRef newRef;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+#ifndef __LP64__
117724f21a94ff32f773af4c37be88fe0d2970e3~suv FSSpec newSpec;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+#endif /* !__LP64__ */
117724f21a94ff32f773af4c37be88fe0d2970e3~suv if (!PyArg_ParseTuple(_args, "u#lO&",
117724f21a94ff32f773af4c37be88fe0d2970e3~suv &nameLength__in__, &nameLength__in_len__,
117724f21a94ff32f773af4c37be88fe0d2970e3~suv &whichInfo,
117724f21a94ff32f773af4c37be88fe0d2970e3~suv@@ -1580,11 +1618,20 @@
117724f21a94ff32f773af4c37be88fe0d2970e3~suv whichInfo,
117724f21a94ff32f773af4c37be88fe0d2970e3~suv &catalogInfo,
117724f21a94ff32f773af4c37be88fe0d2970e3~suv &newRef,
117724f21a94ff32f773af4c37be88fe0d2970e3~suv- &newSpec);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+#ifndef __LP64__
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ &newSpec
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+#else
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ NULL
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+#endif /* !__LP64__ */
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ );
117724f21a94ff32f773af4c37be88fe0d2970e3~suv if (_err != noErr) return PyMac_Error(_err);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+#ifndef __LP64__
117724f21a94ff32f773af4c37be88fe0d2970e3~suv _res = Py_BuildValue("O&O&",
117724f21a94ff32f773af4c37be88fe0d2970e3~suv FSRef_New, &newRef,
117724f21a94ff32f773af4c37be88fe0d2970e3~suv FSSpec_New, &newSpec);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+#else
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ _res = Py_BuildValue("O&O", FSRef_New, &newRef, Py_None);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+#endif /* !__LP64__ */
117724f21a94ff32f773af4c37be88fe0d2970e3~suv return _res;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv }
117724f21a94ff32f773af4c37be88fe0d2970e3~suv
117724f21a94ff32f773af4c37be88fe0d2970e3~suv@@ -1598,7 +1645,9 @@
117724f21a94ff32f773af4c37be88fe0d2970e3~suv FSCatalogInfoBitmap whichInfo;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv FSCatalogInfo catalogInfo;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv FSRef newRef;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+#ifndef __LP64__
117724f21a94ff32f773af4c37be88fe0d2970e3~suv FSSpec newSpec;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+#endif /* !__LP64__ */
117724f21a94ff32f773af4c37be88fe0d2970e3~suv UInt32 newDirID;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv if (!PyArg_ParseTuple(_args, "u#lO&",
117724f21a94ff32f773af4c37be88fe0d2970e3~suv &nameLength__in__, &nameLength__in_len__,
117724f21a94ff32f773af4c37be88fe0d2970e3~suv@@ -1611,13 +1660,25 @@
117724f21a94ff32f773af4c37be88fe0d2970e3~suv whichInfo,
117724f21a94ff32f773af4c37be88fe0d2970e3~suv &catalogInfo,
117724f21a94ff32f773af4c37be88fe0d2970e3~suv &newRef,
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+#ifndef __LP64__
117724f21a94ff32f773af4c37be88fe0d2970e3~suv &newSpec,
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+#else
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ NULL,
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+#endif /* !__LP64__ */
117724f21a94ff32f773af4c37be88fe0d2970e3~suv &newDirID);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv if (_err != noErr) return PyMac_Error(_err);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+#ifndef __LP64__
117724f21a94ff32f773af4c37be88fe0d2970e3~suv _res = Py_BuildValue("O&O&l",
117724f21a94ff32f773af4c37be88fe0d2970e3~suv FSRef_New, &newRef,
117724f21a94ff32f773af4c37be88fe0d2970e3~suv FSSpec_New, &newSpec,
117724f21a94ff32f773af4c37be88fe0d2970e3~suv newDirID);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+#else
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ _res = Py_BuildValue("O&Ol",
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ FSRef_New, &newRef,
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ Py_None,
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ newDirID);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+#endif /* !__LP64__ */
117724f21a94ff32f773af4c37be88fe0d2970e3~suv return _res;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv }
117724f21a94ff32f773af4c37be88fe0d2970e3~suv
117724f21a94ff32f773af4c37be88fe0d2970e3~suv@@ -1699,7 +1760,9 @@
117724f21a94ff32f773af4c37be88fe0d2970e3~suv FSCatalogInfoBitmap whichInfo;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv FSCatalogInfo catalogInfo;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv HFSUniStr255 outName;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+#ifndef __LP64__
117724f21a94ff32f773af4c37be88fe0d2970e3~suv FSSpec fsSpec;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+#endif /* !__LP64__ */
117724f21a94ff32f773af4c37be88fe0d2970e3~suv FSRef parentRef;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv if (!PyArg_ParseTuple(_args, "l",
117724f21a94ff32f773af4c37be88fe0d2970e3~suv &whichInfo))
117724f21a94ff32f773af4c37be88fe0d2970e3~suv@@ -1708,14 +1771,26 @@
117724f21a94ff32f773af4c37be88fe0d2970e3~suv whichInfo,
117724f21a94ff32f773af4c37be88fe0d2970e3~suv &catalogInfo,
117724f21a94ff32f773af4c37be88fe0d2970e3~suv &outName,
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+#ifndef __LP64__
117724f21a94ff32f773af4c37be88fe0d2970e3~suv &fsSpec,
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+#else
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ NULL,
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+#endif /* !__LP64__ */
117724f21a94ff32f773af4c37be88fe0d2970e3~suv &parentRef);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv if (_err != noErr) return PyMac_Error(_err);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+#ifndef __LP64__
117724f21a94ff32f773af4c37be88fe0d2970e3~suv _res = Py_BuildValue("O&O&O&O&",
117724f21a94ff32f773af4c37be88fe0d2970e3~suv FSCatalogInfo_New, &catalogInfo,
117724f21a94ff32f773af4c37be88fe0d2970e3~suv PyMac_BuildHFSUniStr255, &outName,
117724f21a94ff32f773af4c37be88fe0d2970e3~suv FSSpec_New, &fsSpec,
117724f21a94ff32f773af4c37be88fe0d2970e3~suv FSRef_New, &parentRef);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+#else
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ _res = Py_BuildValue("O&O&OO&",
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ FSCatalogInfo_New, &catalogInfo,
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ PyMac_BuildHFSUniStr255, &outName,
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ Py_None,
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ FSRef_New, &parentRef);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+#endif /* !__LP64__ */
117724f21a94ff32f773af4c37be88fe0d2970e3~suv return _res;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv }
117724f21a94ff32f773af4c37be88fe0d2970e3~suv
117724f21a94ff32f773af4c37be88fe0d2970e3~suv@@ -1784,7 +1859,7 @@
117724f21a94ff32f773af4c37be88fe0d2970e3~suv UniCharCount forkNameLength__len__;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv int forkNameLength__in_len__;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv SInt8 permissions;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv- SInt16 forkRefNum;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ FSIORefNum forkRefNum;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv if (!PyArg_ParseTuple(_args, "u#b",
117724f21a94ff32f773af4c37be88fe0d2970e3~suv &forkNameLength__in__, &forkNameLength__in_len__,
117724f21a94ff32f773af4c37be88fe0d2970e3~suv &permissions))
117724f21a94ff32f773af4c37be88fe0d2970e3~suv@@ -2034,7 +2109,7 @@
117724f21a94ff32f773af4c37be88fe0d2970e3~suv
117724f21a94ff32f773af4c37be88fe0d2970e3~suv /* --------------------- End object type FSRef ---------------------- */
117724f21a94ff32f773af4c37be88fe0d2970e3~suv
117724f21a94ff32f773af4c37be88fe0d2970e3~suv-
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+#ifndef __LP64__
117724f21a94ff32f773af4c37be88fe0d2970e3~suv static PyObject *File_UnmountVol(PyObject *_self, PyObject *_args)
117724f21a94ff32f773af4c37be88fe0d2970e3~suv {
117724f21a94ff32f773af4c37be88fe0d2970e3~suv PyObject *_res = NULL;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv@@ -2562,6 +2637,7 @@
117724f21a94ff32f773af4c37be88fe0d2970e3~suv FSSpec_New, &spec);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv return _res;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv }
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+#endif /* !__LP64__ */
117724f21a94ff32f773af4c37be88fe0d2970e3~suv
117724f21a94ff32f773af4c37be88fe0d2970e3~suv static PyObject *File_FSGetForkPosition(PyObject *_self, PyObject *_args)
117724f21a94ff32f773af4c37be88fe0d2970e3~suv {
117724f21a94ff32f773af4c37be88fe0d2970e3~suv@@ -2785,6 +2861,7 @@
117724f21a94ff32f773af4c37be88fe0d2970e3~suv return _res;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv }
117724f21a94ff32f773af4c37be88fe0d2970e3~suv
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+#ifndef __LP64__
117724f21a94ff32f773af4c37be88fe0d2970e3~suv static PyObject *File_NewAlias(PyObject *_self, PyObject *_args)
117724f21a94ff32f773af4c37be88fe0d2970e3~suv {
117724f21a94ff32f773af4c37be88fe0d2970e3~suv PyObject *_res = NULL;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv@@ -2933,6 +3010,7 @@
117724f21a94ff32f773af4c37be88fe0d2970e3~suv wasAliased);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv return _res;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv }
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+#endif /* !__LP64__ */
117724f21a94ff32f773af4c37be88fe0d2970e3~suv
117724f21a94ff32f773af4c37be88fe0d2970e3~suv static PyObject *File_FSNewAlias(PyObject *_self, PyObject *_args)
117724f21a94ff32f773af4c37be88fe0d2970e3~suv {
117724f21a94ff32f773af4c37be88fe0d2970e3~suv@@ -3050,6 +3128,7 @@
117724f21a94ff32f773af4c37be88fe0d2970e3~suv }
117724f21a94ff32f773af4c37be88fe0d2970e3~suv
117724f21a94ff32f773af4c37be88fe0d2970e3~suv static PyMethodDef File_methods[] = {
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+#ifndef __LP64__
117724f21a94ff32f773af4c37be88fe0d2970e3~suv {"UnmountVol", (PyCFunction)File_UnmountVol, 1,
117724f21a94ff32f773af4c37be88fe0d2970e3~suv PyDoc_STR("(Str63 volName, short vRefNum) -> None")},
117724f21a94ff32f773af4c37be88fe0d2970e3~suv {"FlushVol", (PyCFunction)File_FlushVol, 1,
117724f21a94ff32f773af4c37be88fe0d2970e3~suv@@ -3100,6 +3179,7 @@
117724f21a94ff32f773af4c37be88fe0d2970e3~suv PyDoc_STR("(short vRefNum, long dirID, Str255 oldName, long newDirID, Str255 newName) -> None")},
117724f21a94ff32f773af4c37be88fe0d2970e3~suv {"FSMakeFSSpec", (PyCFunction)File_FSMakeFSSpec, 1,
117724f21a94ff32f773af4c37be88fe0d2970e3~suv PyDoc_STR("(short vRefNum, long dirID, Str255 fileName) -> (FSSpec spec)")},
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+#endif /* !__LP64__ */
117724f21a94ff32f773af4c37be88fe0d2970e3~suv {"FSGetForkPosition", (PyCFunction)File_FSGetForkPosition, 1,
117724f21a94ff32f773af4c37be88fe0d2970e3~suv PyDoc_STR("(SInt16 forkRefNum) -> (SInt64 position)")},
117724f21a94ff32f773af4c37be88fe0d2970e3~suv {"FSSetForkPosition", (PyCFunction)File_FSSetForkPosition, 1,
117724f21a94ff32f773af4c37be88fe0d2970e3~suv@@ -3124,6 +3204,7 @@
117724f21a94ff32f773af4c37be88fe0d2970e3~suv PyDoc_STR("(UInt8 * path, FNMessage message, OptionBits flags) -> None")},
117724f21a94ff32f773af4c37be88fe0d2970e3~suv {"FNNotifyAll", (PyCFunction)File_FNNotifyAll, 1,
117724f21a94ff32f773af4c37be88fe0d2970e3~suv PyDoc_STR("(FNMessage message, OptionBits flags) -> None")},
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+#ifndef __LP64__
117724f21a94ff32f773af4c37be88fe0d2970e3~suv {"NewAlias", (PyCFunction)File_NewAlias, 1,
117724f21a94ff32f773af4c37be88fe0d2970e3~suv PyDoc_STR("(FSSpec fromFile, FSSpec target) -> (AliasHandle alias)")},
117724f21a94ff32f773af4c37be88fe0d2970e3~suv {"NewAliasMinimalFromFullPath", (PyCFunction)File_NewAliasMinimalFromFullPath, 1,
117724f21a94ff32f773af4c37be88fe0d2970e3~suv@@ -3136,6 +3217,7 @@
117724f21a94ff32f773af4c37be88fe0d2970e3~suv PyDoc_STR("(FSSpec fromFile, FSSpec target, AliasHandle alias) -> (Boolean wasChanged)")},
117724f21a94ff32f773af4c37be88fe0d2970e3~suv {"ResolveAliasFileWithMountFlagsNoUI", (PyCFunction)File_ResolveAliasFileWithMountFlagsNoUI, 1,
117724f21a94ff32f773af4c37be88fe0d2970e3~suv PyDoc_STR("(FSSpec theSpec, Boolean resolveAliasChains, unsigned long mountFlags) -> (FSSpec theSpec, Boolean targetIsFolder, Boolean wasAliased)")},
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+#endif /* !__LP64__ */
117724f21a94ff32f773af4c37be88fe0d2970e3~suv {"FSNewAlias", (PyCFunction)File_FSNewAlias, 1,
117724f21a94ff32f773af4c37be88fe0d2970e3~suv PyDoc_STR("(FSRef fromFile, FSRef target) -> (AliasHandle inAlias)")},
117724f21a94ff32f773af4c37be88fe0d2970e3~suv {"FSResolveAliasFileWithMountFlags", (PyCFunction)File_FSResolveAliasFileWithMountFlags, 1,
117724f21a94ff32f773af4c37be88fe0d2970e3~suv@@ -3150,7 +3232,7 @@
117724f21a94ff32f773af4c37be88fe0d2970e3~suv };
117724f21a94ff32f773af4c37be88fe0d2970e3~suv
117724f21a94ff32f773af4c37be88fe0d2970e3~suv
117724f21a94ff32f773af4c37be88fe0d2970e3~suv-
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+#ifndef __LP64__
117724f21a94ff32f773af4c37be88fe0d2970e3~suv int
117724f21a94ff32f773af4c37be88fe0d2970e3~suv PyMac_GetFSSpec(PyObject *v, FSSpec *spec)
117724f21a94ff32f773af4c37be88fe0d2970e3~suv {
117724f21a94ff32f773af4c37be88fe0d2970e3~suv@@ -3188,12 +3270,15 @@
117724f21a94ff32f773af4c37be88fe0d2970e3~suv }
117724f21a94ff32f773af4c37be88fe0d2970e3~suv return 0;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv }
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+#endif /* !__LP64__ */
117724f21a94ff32f773af4c37be88fe0d2970e3~suv
117724f21a94ff32f773af4c37be88fe0d2970e3~suv int
117724f21a94ff32f773af4c37be88fe0d2970e3~suv PyMac_GetFSRef(PyObject *v, FSRef *fsr)
117724f21a94ff32f773af4c37be88fe0d2970e3~suv {
117724f21a94ff32f773af4c37be88fe0d2970e3~suv OSStatus err;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+#ifndef __LP64__
117724f21a94ff32f773af4c37be88fe0d2970e3~suv FSSpec fss;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+#endif /* !__LP64__ */
117724f21a94ff32f773af4c37be88fe0d2970e3~suv
117724f21a94ff32f773af4c37be88fe0d2970e3~suv if (FSRef_Check(v)) {
117724f21a94ff32f773af4c37be88fe0d2970e3~suv *fsr = ((FSRefObject *)v)->ob_itself;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv@@ -3211,6 +3296,7 @@
117724f21a94ff32f773af4c37be88fe0d2970e3~suv return !err;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv }
117724f21a94ff32f773af4c37be88fe0d2970e3~suv /* XXXX Should try unicode here too */
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+#ifndef __LP64__
117724f21a94ff32f773af4c37be88fe0d2970e3~suv /* Otherwise we try to go via an FSSpec */
117724f21a94ff32f773af4c37be88fe0d2970e3~suv if (FSSpec_Check(v)) {
117724f21a94ff32f773af4c37be88fe0d2970e3~suv fss = ((FSSpecObject *)v)->ob_itself;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv@@ -3219,15 +3305,18 @@
117724f21a94ff32f773af4c37be88fe0d2970e3~suv PyMac_Error(err);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv return 0;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv }
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+#endif /* !__LP64__ */
117724f21a94ff32f773af4c37be88fe0d2970e3~suv PyErr_SetString(PyExc_TypeError, "FSRef, FSSpec or pathname required");
117724f21a94ff32f773af4c37be88fe0d2970e3~suv return 0;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv }
117724f21a94ff32f773af4c37be88fe0d2970e3~suv
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+#ifndef __LP64__
117724f21a94ff32f773af4c37be88fe0d2970e3~suv extern PyObject *
117724f21a94ff32f773af4c37be88fe0d2970e3~suv PyMac_BuildFSSpec(FSSpec *spec)
117724f21a94ff32f773af4c37be88fe0d2970e3~suv {
117724f21a94ff32f773af4c37be88fe0d2970e3~suv return FSSpec_New(spec);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv }
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+#endif /* !__LP64__ */
117724f21a94ff32f773af4c37be88fe0d2970e3~suv
117724f21a94ff32f773af4c37be88fe0d2970e3~suv extern PyObject *
117724f21a94ff32f773af4c37be88fe0d2970e3~suv PyMac_BuildFSRef(FSRef *spec)
117724f21a94ff32f773af4c37be88fe0d2970e3~suv@@ -3242,10 +3331,11 @@
117724f21a94ff32f773af4c37be88fe0d2970e3~suv PyObject *d;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv
117724f21a94ff32f773af4c37be88fe0d2970e3~suv
117724f21a94ff32f773af4c37be88fe0d2970e3~suv-
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+#ifndef __LP64__
117724f21a94ff32f773af4c37be88fe0d2970e3~suv PyMac_INIT_TOOLBOX_OBJECT_NEW(FSSpec *, PyMac_BuildFSSpec);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv- PyMac_INIT_TOOLBOX_OBJECT_NEW(FSRef *, PyMac_BuildFSRef);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv PyMac_INIT_TOOLBOX_OBJECT_CONVERT(FSSpec, PyMac_GetFSSpec);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+#endif /* !__LP64__ */
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ PyMac_INIT_TOOLBOX_OBJECT_NEW(FSRef *, PyMac_BuildFSRef);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv PyMac_INIT_TOOLBOX_OBJECT_CONVERT(FSRef, PyMac_GetFSRef);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv
117724f21a94ff32f773af4c37be88fe0d2970e3~suv
117724f21a94ff32f773af4c37be88fe0d2970e3~suv@@ -3262,6 +3352,7 @@
117724f21a94ff32f773af4c37be88fe0d2970e3~suv /* Backward-compatible name */
117724f21a94ff32f773af4c37be88fe0d2970e3~suv Py_INCREF(&FSCatalogInfo_Type);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv PyModule_AddObject(m, "FSCatalogInfoType", (PyObject *)&FSCatalogInfo_Type);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+#ifndef __LP64__
117724f21a94ff32f773af4c37be88fe0d2970e3~suv FInfo_Type.ob_type = &PyType_Type;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv if (PyType_Ready(&FInfo_Type) < 0) return;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv Py_INCREF(&FInfo_Type);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv@@ -3269,6 +3360,7 @@
117724f21a94ff32f773af4c37be88fe0d2970e3~suv /* Backward-compatible name */
117724f21a94ff32f773af4c37be88fe0d2970e3~suv Py_INCREF(&FInfo_Type);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv PyModule_AddObject(m, "FInfoType", (PyObject *)&FInfo_Type);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+#endif /* !__LP64__ */
117724f21a94ff32f773af4c37be88fe0d2970e3~suv Alias_Type.ob_type = &PyType_Type;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv if (PyType_Ready(&Alias_Type) < 0) return;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv Py_INCREF(&Alias_Type);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv@@ -3276,6 +3368,7 @@
117724f21a94ff32f773af4c37be88fe0d2970e3~suv /* Backward-compatible name */
117724f21a94ff32f773af4c37be88fe0d2970e3~suv Py_INCREF(&Alias_Type);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv PyModule_AddObject(m, "AliasType", (PyObject *)&Alias_Type);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+#ifndef __LP64__
117724f21a94ff32f773af4c37be88fe0d2970e3~suv FSSpec_Type.ob_type = &PyType_Type;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv if (PyType_Ready(&FSSpec_Type) < 0) return;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv Py_INCREF(&FSSpec_Type);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv@@ -3283,6 +3376,7 @@
117724f21a94ff32f773af4c37be88fe0d2970e3~suv /* Backward-compatible name */
117724f21a94ff32f773af4c37be88fe0d2970e3~suv Py_INCREF(&FSSpec_Type);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv PyModule_AddObject(m, "FSSpecType", (PyObject *)&FSSpec_Type);
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+#endif /* !__LP64__ */
117724f21a94ff32f773af4c37be88fe0d2970e3~suv FSRef_Type.ob_type = &PyType_Type;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv if (PyType_Ready(&FSRef_Type) < 0) return;
117724f21a94ff32f773af4c37be88fe0d2970e3~suv Py_INCREF(&FSRef_Type);
117724f21a94ff32f773af4c37be88fe0d2970e3~suvIndex: Lib/plat-mac/macresource.py
117724f21a94ff32f773af4c37be88fe0d2970e3~suv===================================================================
117724f21a94ff32f773af4c37be88fe0d2970e3~suv--- Lib/plat-mac/macresource.py (revision 74680)
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+++ Lib/plat-mac/macresource.py (revision 74681)
117724f21a94ff32f773af4c37be88fe0d2970e3~suv@@ -79,8 +79,8 @@
117724f21a94ff32f773af4c37be88fe0d2970e3~suv AppleSingle file"""
117724f21a94ff32f773af4c37be88fe0d2970e3~suv try:
117724f21a94ff32f773af4c37be88fe0d2970e3~suv refno = Res.FSpOpenResFile(pathname, 1)
117724f21a94ff32f773af4c37be88fe0d2970e3~suv- except Res.Error, arg:
117724f21a94ff32f773af4c37be88fe0d2970e3~suv- if arg[0] in (-37, -39):
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ except (AttributeError, Res.Error), arg:
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ if isinstance(arg, AttributeError) or arg[0] in (-37, -39):
117724f21a94ff32f773af4c37be88fe0d2970e3~suv # No resource fork. We may be on OSX, and this may be either
117724f21a94ff32f773af4c37be88fe0d2970e3~suv # a data-fork based resource file or a AppleSingle file
117724f21a94ff32f773af4c37be88fe0d2970e3~suv # from the CVS repository.
117724f21a94ff32f773af4c37be88fe0d2970e3~suv@@ -106,8 +106,8 @@
117724f21a94ff32f773af4c37be88fe0d2970e3~suv try:
117724f21a94ff32f773af4c37be88fe0d2970e3~suv refno = Res.FSpOpenResFile(pathname, 1)
117724f21a94ff32f773af4c37be88fe0d2970e3~suv Res.CloseResFile(refno)
117724f21a94ff32f773af4c37be88fe0d2970e3~suv- except Res.Error, arg:
117724f21a94ff32f773af4c37be88fe0d2970e3~suv- if arg[0] in (-37, -39):
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ except (AttributeError, Res.Error), arg:
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ if isinstance(arg, AttributeError) or arg[0] in (-37, -39):
117724f21a94ff32f773af4c37be88fe0d2970e3~suv # No resource fork. We may be on OSX, and this may be either
117724f21a94ff32f773af4c37be88fe0d2970e3~suv # a data-fork based resource file or a AppleSingle file
117724f21a94ff32f773af4c37be88fe0d2970e3~suv # from the CVS repository.
117724f21a94ff32f773af4c37be88fe0d2970e3~suvIndex: Lib/plat-mac/applesingle.py
117724f21a94ff32f773af4c37be88fe0d2970e3~suv===================================================================
117724f21a94ff32f773af4c37be88fe0d2970e3~suv--- Lib/plat-mac/applesingle.py (revision 74680)
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+++ Lib/plat-mac/applesingle.py (revision 74681)
117724f21a94ff32f773af4c37be88fe0d2970e3~suv@@ -119,8 +119,13 @@
117724f21a94ff32f773af4c37be88fe0d2970e3~suv if not hasattr(infile, 'read'):
117724f21a94ff32f773af4c37be88fe0d2970e3~suv if isinstance(infile, Carbon.File.Alias):
117724f21a94ff32f773af4c37be88fe0d2970e3~suv infile = infile.ResolveAlias()[0]
117724f21a94ff32f773af4c37be88fe0d2970e3~suv- if isinstance(infile, (Carbon.File.FSSpec, Carbon.File.FSRef)):
117724f21a94ff32f773af4c37be88fe0d2970e3~suv- infile = infile.as_pathname()
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ if hasattr(Carbon.File, "FSSpec"):
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ if isinstance(infile, (Carbon.File.FSSpec, Carbon.File.FSRef)):
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ infile = infile.as_pathname()
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ else:
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ if isinstance(infile, Carbon.File.FSRef):
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ infile = infile.as_pathname()
117724f21a94ff32f773af4c37be88fe0d2970e3~suv infile = open(infile, 'rb')
117724f21a94ff32f773af4c37be88fe0d2970e3~suv
117724f21a94ff32f773af4c37be88fe0d2970e3~suv asfile = AppleSingle(infile, verbose=verbose)
117724f21a94ff32f773af4c37be88fe0d2970e3~suvIndex: Mac/scripts/BuildApplet.py
117724f21a94ff32f773af4c37be88fe0d2970e3~suv===================================================================
117724f21a94ff32f773af4c37be88fe0d2970e3~suv--- Mac/scripts/BuildApplet.py (revision 74680)
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+++ Mac/scripts/BuildApplet.py (revision 74681)
117724f21a94ff32f773af4c37be88fe0d2970e3~suv@@ -12,7 +12,10 @@
117724f21a94ff32f773af4c37be88fe0d2970e3~suv
117724f21a94ff32f773af4c37be88fe0d2970e3~suv import os
117724f21a94ff32f773af4c37be88fe0d2970e3~suv import MacOS
117724f21a94ff32f773af4c37be88fe0d2970e3~suv-import EasyDialogs
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+try:
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ import EasyDialogs
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+except ImportError:
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ EasyDialogs = None
117724f21a94ff32f773af4c37be88fe0d2970e3~suv import buildtools
117724f21a94ff32f773af4c37be88fe0d2970e3~suv import getopt
117724f21a94ff32f773af4c37be88fe0d2970e3~suv
117724f21a94ff32f773af4c37be88fe0d2970e3~suv@@ -32,7 +35,10 @@
117724f21a94ff32f773af4c37be88fe0d2970e3~suv try:
117724f21a94ff32f773af4c37be88fe0d2970e3~suv buildapplet()
117724f21a94ff32f773af4c37be88fe0d2970e3~suv except buildtools.BuildError, detail:
117724f21a94ff32f773af4c37be88fe0d2970e3~suv- EasyDialogs.Message(detail)
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ if EasyDialogs is None:
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ print detail
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ else:
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ EasyDialogs.Message(detail)
117724f21a94ff32f773af4c37be88fe0d2970e3~suv
117724f21a94ff32f773af4c37be88fe0d2970e3~suv
117724f21a94ff32f773af4c37be88fe0d2970e3~suv def buildapplet():
117724f21a94ff32f773af4c37be88fe0d2970e3~suv@@ -46,6 +52,10 @@
117724f21a94ff32f773af4c37be88fe0d2970e3~suv # Ask for source text if not specified in sys.argv[1:]
117724f21a94ff32f773af4c37be88fe0d2970e3~suv
117724f21a94ff32f773af4c37be88fe0d2970e3~suv if not sys.argv[1:]:
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ if EasyDialogs is None:
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ usage()
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ sys.exit(1)
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+
117724f21a94ff32f773af4c37be88fe0d2970e3~suv filename = EasyDialogs.AskFileForOpen(message='Select Python source or applet:',
117724f21a94ff32f773af4c37be88fe0d2970e3~suv typeList=('TEXT', 'APPL'))
117724f21a94ff32f773af4c37be88fe0d2970e3~suv if not filename:
117724f21a94ff32f773af4c37be88fe0d2970e3~suvIndex: Lib/plat-mac/buildtools.py
117724f21a94ff32f773af4c37be88fe0d2970e3~suv===================================================================
117724f21a94ff32f773af4c37be88fe0d2970e3~suv--- Lib/plat-mac/buildtools.py (revision 74680)
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+++ Lib/plat-mac/buildtools.py (revision 74681)
117724f21a94ff32f773af4c37be88fe0d2970e3~suv@@ -15,7 +15,10 @@
117724f21a94ff32f773af4c37be88fe0d2970e3~suv import MacOS
117724f21a94ff32f773af4c37be88fe0d2970e3~suv import macostools
117724f21a94ff32f773af4c37be88fe0d2970e3~suv import macresource
117724f21a94ff32f773af4c37be88fe0d2970e3~suv-import EasyDialogs
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+try:
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ import EasyDialogs
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+except ImportError:
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ EasyDialogs = None
117724f21a94ff32f773af4c37be88fe0d2970e3~suv import shutil
117724f21a94ff32f773af4c37be88fe0d2970e3~suv
117724f21a94ff32f773af4c37be88fe0d2970e3~suv
117724f21a94ff32f773af4c37be88fe0d2970e3~suv@@ -67,9 +70,13 @@
117724f21a94ff32f773af4c37be88fe0d2970e3~suv rsrcname=None, others=[], raw=0, progress="default", destroot=""):
117724f21a94ff32f773af4c37be88fe0d2970e3~suv
117724f21a94ff32f773af4c37be88fe0d2970e3~suv if progress == "default":
117724f21a94ff32f773af4c37be88fe0d2970e3~suv- progress = EasyDialogs.ProgressBar("Processing %s..."%os.path.split(filename)[1], 120)
117724f21a94ff32f773af4c37be88fe0d2970e3~suv- progress.label("Compiling...")
117724f21a94ff32f773af4c37be88fe0d2970e3~suv- progress.inc(0)
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ if EasyDialogs is None:
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ print "Compiling %s"%(os.path.split(filename)[1],)
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ process = None
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ else:
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ progress = EasyDialogs.ProgressBar("Processing %s..."%os.path.split(filename)[1], 120)
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ progress.label("Compiling...")
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ progress.inc(0)
117724f21a94ff32f773af4c37be88fe0d2970e3~suv # check for the script name being longer than 32 chars. This may trigger a bug
117724f21a94ff32f773af4c37be88fe0d2970e3~suv # on OSX that can destroy your sourcefile.
117724f21a94ff32f773af4c37be88fe0d2970e3~suv if '#' in os.path.split(filename)[1]:
117724f21a94ff32f773af4c37be88fe0d2970e3~suv@@ -119,7 +126,11 @@
117724f21a94ff32f773af4c37be88fe0d2970e3~suv if MacOS.runtimemodel == 'macho':
117724f21a94ff32f773af4c37be88fe0d2970e3~suv raise BuildError, "No updating yet for MachO applets"
117724f21a94ff32f773af4c37be88fe0d2970e3~suv if progress:
117724f21a94ff32f773af4c37be88fe0d2970e3~suv- progress = EasyDialogs.ProgressBar("Updating %s..."%os.path.split(filename)[1], 120)
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ if EasyDialogs is None:
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ print "Updating %s"%(os.path.split(filename)[1],)
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ progress = None
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ else:
117724f21a94ff32f773af4c37be88fe0d2970e3~suv+ progress = EasyDialogs.ProgressBar("Updating %s..."%os.path.split(filename)[1], 120)
117724f21a94ff32f773af4c37be88fe0d2970e3~suv else:
117724f21a94ff32f773af4c37be88fe0d2970e3~suv progress = None
117724f21a94ff32f773af4c37be88fe0d2970e3~suv if not output: