summaryrefslogtreecommitdiffstats
path: root/Mac/Modules
diff options
context:
space:
mode:
authorJack Jansen <jack.jansen@cwi.nl>1995-06-18 20:05:14 (GMT)
committerJack Jansen <jack.jansen@cwi.nl>1995-06-18 20:05:14 (GMT)
commit2c67362f709f8ee35d1df96afcafe55222ed1569 (patch)
tree3aad7c2c9114bfd1fd8cb52de9746008ff2b2596 /Mac/Modules
parent08305504f13abc55005756c836909bc3e5c7c297 (diff)
downloadcpython-2c67362f709f8ee35d1df96afcafe55222ed1569.zip
cpython-2c67362f709f8ee35d1df96afcafe55222ed1569.tar.gz
cpython-2c67362f709f8ee35d1df96afcafe55222ed1569.tar.bz2
Added FindFolder interface
Diffstat (limited to 'Mac/Modules')
-rw-r--r--Mac/Modules/macfsmodule.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/Mac/Modules/macfsmodule.c b/Mac/Modules/macfsmodule.c
index 0d75d44..d85eb71 100644
--- a/Mac/Modules/macfsmodule.c
+++ b/Mac/Modules/macfsmodule.c
@@ -28,6 +28,7 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include <Memory.h>
#include <Files.h>
+#include <Folders.h>
#include <StandardFile.h>
#include <Aliases.h>
@@ -567,6 +568,28 @@ mfs_GetDirectory(self, args)
return mkvalue("(Oi)", newmfssobject(&fsdir), ok);
}
+static object *
+mfs_FindFolder(self, args)
+ object *self; /* Not used */
+ object *args;
+{
+ OSErr err;
+ short where;
+ OSType which;
+ int create;
+ short refnum;
+ long dirid;
+
+ if (!newgetargs(args, "hO&i", &where, PyMac_GetOSType, &which, &create) )
+ return NULL;
+ err = FindFolder(where, which, (Boolean)create, &refnum, &dirid);
+ if ( err ) {
+ PyErr_Mac(ErrorObject, err);
+ return NULL;
+ }
+ return mkvalue("(ii)", refnum, dirid);
+}
+
/* List of methods defined in the module */
static struct methodlist mfs_methods[] = {
@@ -577,6 +600,7 @@ static struct methodlist mfs_methods[] = {
{"FSSpec", mfs_FSSpec, 1},
{"RawFSSpec", mfs_RawFSSpec, 1},
{"RawAlias", mfs_RawAlias, 1},
+ {"FindFolder", mfs_FindFolder, 1},
{NULL, NULL} /* sentinel */
};