summaryrefslogtreecommitdiffstats
path: root/Mac/mwerks
diff options
context:
space:
mode:
authorJack Jansen <jack.jansen@cwi.nl>1995-01-18 13:41:47 (GMT)
committerJack Jansen <jack.jansen@cwi.nl>1995-01-18 13:41:47 (GMT)
commit31f61dddfae7fc589fe36324f5670ccbf9aaab11 (patch)
treeb44482263b933dd6165910b02083349b78f3bbc8 /Mac/mwerks
parent6520119700cacdb9b4ddf5610fe86de31701251d (diff)
downloadcpython-31f61dddfae7fc589fe36324f5670ccbf9aaab11.zip
cpython-31f61dddfae7fc589fe36324f5670ccbf9aaab11.tar.gz
cpython-31f61dddfae7fc589fe36324f5670ccbf9aaab11.tar.bz2
Moved development-platform specific files to subdirectories
Diffstat (limited to 'Mac/mwerks')
-rw-r--r--Mac/mwerks/errno_unix.h18
-rw-r--r--Mac/mwerks/mwerksglue.c43
2 files changed, 61 insertions, 0 deletions
diff --git a/Mac/mwerks/errno_unix.h b/Mac/mwerks/errno_unix.h
new file mode 100644
index 0000000..00fbe5a
--- /dev/null
+++ b/Mac/mwerks/errno_unix.h
@@ -0,0 +1,18 @@
+
+#define ENOTDIR (-120)
+#define EACCES (-54)
+#define EEXIST (-48)
+#define EBUSY (-47)
+#define EROFS (-44)
+#define ENOENT (-43)
+#define ENFILE (-42)
+#define EIO (-36)
+#define ENOSPC (-34)
+
+#define ESRCH 3
+#define EINTR 4
+#define EBADF 9
+#define ENODEV 19
+#define EINVAL 22
+#define EMFILE 24
+
diff --git a/Mac/mwerks/mwerksglue.c b/Mac/mwerks/mwerksglue.c
new file mode 100644
index 0000000..37e3a81
--- /dev/null
+++ b/Mac/mwerks/mwerksglue.c
@@ -0,0 +1,43 @@
+/*
+** Glue code for MetroWerks CodeWarrior, which misses
+** unix-like routines for file-access.
+*/
+
+#ifdef __MWERKS__
+#include <Types.h>
+#include <Files.h>
+#include <Strings.h>
+
+#include <stdio.h>
+#include <errno.h>
+
+int
+fileno(fp)
+ FILE *fp;
+{
+ if (fp==stdin) return 0;
+ else if (fp==stdout) return 1;
+ else if (fp==stderr) return 2;
+ else return 3;
+}
+
+int
+isatty(fd)
+ int fd;
+{
+ return (fd >= 0 && fd <= 2);
+}
+
+int
+unlink(old)
+ char *old;
+{
+ OSErr err;
+
+ if ((err=FSDelete(c2pstr(old), 0)) == noErr)
+ return 0;
+ errno= err;
+ return -1;
+}
+
+#endif /* __MWERKS__ */ \ No newline at end of file