summaryrefslogtreecommitdiffstats
path: root/Mac/Modules
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1994-08-29 08:42:37 (GMT)
committerGuido van Rossum <guido@python.org>1994-08-29 08:42:37 (GMT)
commit739267b7c34c0bdf934059804fde3f027e84bd0b (patch)
tree25dc06eae2dd9cf8b2bce19683e8d7a5b8ebbc08 /Mac/Modules
parente78344444086581bdf59f13415b0c701e740cce1 (diff)
downloadcpython-739267b7c34c0bdf934059804fde3f027e84bd0b.zip
cpython-739267b7c34c0bdf934059804fde3f027e84bd0b.tar.gz
cpython-739267b7c34c0bdf934059804fde3f027e84bd0b.tar.bz2
Completed (hopefully) the unification of THINK 6.0 and MPW 3.2
versions -- they now share config.c and config.h, and statting is always done through macstat.[ch] (THINK's <stat.h> defines funny constants). Also the configuration of stdwin is done differently: you have to define USE_STDWIN to the compiler prefix.
Diffstat (limited to 'Mac/Modules')
-rw-r--r--Mac/Modules/config.c2
-rw-r--r--Mac/Modules/macmodule.c27
2 files changed, 20 insertions, 9 deletions
diff --git a/Mac/Modules/config.c b/Mac/Modules/config.c
index 54fed74..3595a9e 100644
--- a/Mac/Modules/config.c
+++ b/Mac/Modules/config.c
@@ -31,8 +31,6 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#ifdef macintosh
/* The Macintosh main program is in macmain.c */
#define NO_MAIN
-/* Comment this out if you're not interested in STDWIN */
-#define USE_STDWIN
#endif
#include <stdio.h>
diff --git a/Mac/Modules/macmodule.c b/Mac/Modules/macmodule.c
index ff06acd..d8d0dd8 100644
--- a/Mac/Modules/macmodule.c
+++ b/Mac/Modules/macmodule.c
@@ -23,8 +23,6 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
******************************************************************/
/* Mac module implementation */
-/* Richard J. Walker April 7, 1994 Island Graphics Corp. */
-/* Thanks to Guido's unix emulation routines */
#include "allobjects.h"
#include "modsupport.h"
@@ -33,7 +31,19 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include <stdio.h>
#include <string.h>
#include <errno.h>
-#include <stat.h>
+
+#ifdef THINK_C
+#include "unix.h"
+#undef S_IFMT
+#undef S_IFDIR
+#undef S_IFCHR
+#undef S_IFBLK
+#undef S_IFREG
+#undef S_ISDIR
+#undef S_ISREG
+#endif
+
+#include "macstat.h"
#include <fcntl.h>
@@ -54,9 +64,12 @@ DIR * opendir PROTO((char *));
void closedir 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));
+#ifdef THINK_C
+int unlink PROTO((char *));
+#else
int unlink PROTO((const char *));
+#endif
@@ -357,13 +370,13 @@ mac_stat(self, args)
object *self;
object *args;
{
- struct stat st;
+ struct macstat st;
char *path;
int res;
if (!getargs(args, "s", &path))
return NULL;
BGN_SAVE
- res = stat(path, &st);
+ res = macstat(path, &st);
END_SAVE
if (res != 0)
return mac_error();
@@ -402,7 +415,7 @@ mac_unlink(self, args)
object *self;
object *args;
{
- return mac_1str(args, unlink);
+ return mac_1str(args, (int (*)(const char *))unlink);
}
static object *