summaryrefslogtreecommitdiffstats
path: root/Mac/Modules/macfsmodule.c
diff options
context:
space:
mode:
authorJack Jansen <jack.jansen@cwi.nl>1996-09-20 15:25:16 (GMT)
committerJack Jansen <jack.jansen@cwi.nl>1996-09-20 15:25:16 (GMT)
commit924ca855da687484ba8ac1a81913777b5204797f (patch)
tree565809bddb09abc33b0bd984e0e9700249b8a02d /Mac/Modules/macfsmodule.c
parentbdf03a0072ff662be72f5a72ae7f69a9e466c076 (diff)
downloadcpython-924ca855da687484ba8ac1a81913777b5204797f.zip
cpython-924ca855da687484ba8ac1a81913777b5204797f.tar.gz
cpython-924ca855da687484ba8ac1a81913777b5204797f.tar.bz2
Added macfs.FindApplication() to find application FSSpec given signature.
Diffstat (limited to 'Mac/Modules/macfsmodule.c')
-rw-r--r--Mac/Modules/macfsmodule.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/Mac/Modules/macfsmodule.c b/Mac/Modules/macfsmodule.c
index 831fd65..91e63eb 100644
--- a/Mac/Modules/macfsmodule.c
+++ b/Mac/Modules/macfsmodule.c
@@ -34,6 +34,7 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include <LowMem.h>
#include "nfullpath.h"
+#include "getapplbycreator.h"
#ifdef THINK_C
#define FileFilterUPP FileFilterProcPtr
@@ -895,6 +896,25 @@ mfs_FindFolder(self, args)
}
static object *
+mfs_FindApplication(self, args)
+ object *self; /* Not used */
+ object *args;
+{
+ OSErr err;
+ OSType which;
+ FSSpec fss;
+
+ if (!newgetargs(args, "O&", PyMac_GetOSType, &which) )
+ return NULL;
+ err = FindApplicationFromCreator(which, &fss);
+ if ( err ) {
+ PyErr_Mac(ErrorObject, err);
+ return NULL;
+ }
+ return (object *)newmfssobject(&fss);
+}
+
+static object *
mfs_FInfo(self, args)
object *self;
object *args;
@@ -915,6 +935,7 @@ static struct methodlist mfs_methods[] = {
{"RawFSSpec", mfs_RawFSSpec, 1},
{"RawAlias", mfs_RawAlias, 1},
{"FindFolder", mfs_FindFolder, 1},
+ {"FindApplication", mfs_FindApplication, 1},
{"FInfo", mfs_FInfo, 1},
{NULL, NULL} /* sentinel */