diff Mac/Modules/macmodule.c @ 1795:fa8bbd09f2e6 legacy-trunk

Updates for THINK C 6.0. Moved the necessary UNIX emulation routines here.
author Guido van Rossum <guido@python.org>
date Fri, 19 Aug 1994 10:51:31 +0000
parents e2665d9d4e46
children 6cfd43d5c074
line wrap: on
line diff
--- a/Mac/Modules/macmodule.c	Thu Aug 18 16:18:13 1994 +0000
+++ b/Mac/Modules/macmodule.c	Fri Aug 19 10:51:31 1994 +0000
@@ -36,9 +36,9 @@
 
 #include <fcntl.h>
 
-#include ":::unixemu:macdefs.h"
-#include ":::unixemu:dir.h"
-#include ":::unixemu:stat.h"
+#include "macdefs.h"
+#include "dirent.h"
+#include "stat.h"
 
 #ifndef MAXPATHLEN
 #define MAXPATHLEN 1024
@@ -46,14 +46,13 @@
 
 /* Prototypes for Unix simulation on Mac */
 
-int access PROTO((const char *path, int mode));
 int chdir PROTO((const char *path));
 char *getbootvol PROTO((void));
 char *getwd PROTO((char *));
 int mkdir PROTO((const char *path, int mode));
 DIR * opendir PROTO((char *));
 void closedir PROTO((DIR *));
-struct direct * readdir PROTO((DIR *));
+struct dirent * readdir PROTO((DIR *));
 int rmdir PROTO((const char *path));
 int stat PROTO((const char *path, struct stat *buf));
 int sync PROTO((void));
@@ -129,14 +128,6 @@
 }
 
 static object *
-mac_access(self, args)
-	object *self;
-	object *args;
-{
-	return mac_strint(args, access);
-}
-
-static object *
 mac_chdir(self, args)
 	object *self;
 	object *args;
@@ -243,7 +234,7 @@
 	char *name;
 	object *d, *v;
 	DIR *dirp;
-	struct direct *ep;
+	struct dirent *ep;
 	if (!getargs(args, "s", &name))
 		return NULL;
 	BGN_SAVE
@@ -376,11 +367,17 @@
 	END_SAVE
 	if (res != 0)
 		return mac_error();
-	return mkvalue("(llll)",
+	return mkvalue("(llllllllll)",
 		    (long)st.st_mode,
+		    0L /* st_ino */,
+		    (long)st.st_dev,
+		    (long)st.st_nlink,
+		    (long)st.st_uid,
+		    (long)st.st_gid,
 		    (long)st.st_size,
-		    (long)st.st_rsize,
-		    (long)st.st_mtime);
+		    (long)st.st_atime,
+		    (long)st.st_mtime,
+		    (long)st.st_ctime);
 }
 
 static object *
@@ -426,7 +423,6 @@
 }
 
 static struct methodlist mac_methods[] = {
-	{"access_",	mac_access}, /* "access" is a Python reserved word */
 	{"chdir",	mac_chdir},
 	{"close",	mac_close},
 #ifdef MPW