diff Mac/Modules/macmodule.c @ 2032:609bfb8ae7f5 legacy-trunk

Ported to MetroWerks, which misses file-descriptor like functionality.
author Jack Jansen <jack.jansen@cwi.nl>
date Wed, 14 Dec 1994 13:48:38 +0000
parents 76d0f2b3b9ee
children b4d982c648bb
line wrap: on
line diff
--- a/Mac/Modules/macmodule.c	Wed Dec 14 13:47:30 1994 +0000
+++ b/Mac/Modules/macmodule.c	Wed Dec 14 13:48:38 1994 +0000
@@ -45,7 +45,9 @@
 
 #include "macstat.h"
 
+#ifndef __MWERKS__
 #include <fcntl.h>
+#endif
 
 #include "macdefs.h"
 #include "dirent.h"
@@ -148,6 +150,7 @@
 	return mac_1str(args, chdir);
 }
 
+#ifndef __MWERKS__
 static object *
 mac_close(self, args)
 	object *self;
@@ -164,6 +167,7 @@
 	INCREF(None);
 	return None;
 }
+#endif /* !__MWERKS__ */
 
 #ifdef MPW
 
@@ -185,6 +189,7 @@
 
 #endif /* MPW */
 
+#ifndef __MWERKS__
 static object *
 mac_fdopen(self, args)
 	object *self;
@@ -203,6 +208,7 @@
 		return mac_error();
 	return newopenfileobject(fp, "(fdopen)", mode, fclose);
 }
+#endif
 
 static object *
 mac_getbootvol(self, args)
@@ -281,6 +287,7 @@
 	return d;
 }
 
+#ifndef __MWERKS__
 static object *
 mac_lseek(self, args)
 	object *self;
@@ -299,6 +306,7 @@
 		return mac_error();
 	return newintobject(res);
 }
+#endif /* !__MWERKS__ */
 
 static object *
 mac_mkdir(self, args)
@@ -308,6 +316,7 @@
 	return mac_strint(args, mkdir);
 }
 
+#ifndef __MWERKS__
 static object *
 mac_open(self, args)
 	object *self;
@@ -348,6 +357,7 @@
 	resizestring(&buffer, size);
 	return buffer;
 }
+#endif /* !__MWERKS */
 
 static object *
 mac_rename(self, args)
@@ -418,6 +428,7 @@
 	return mac_1str(args, (int (*)(const char *))unlink);
 }
 
+#ifndef __MWERKS__
 static object *
 mac_write(self, args)
 	object *self;
@@ -434,27 +445,38 @@
 		return mac_error();
 	return newintobject((long)size);
 }
+#endif /* !__MWERKS__ */
 
 static struct methodlist mac_methods[] = {
 	{"chdir",	mac_chdir},
+#ifndef __MWERKS__
 	{"close",	mac_close},
+#endif
 #ifdef MPW
 	{"dup",		mac_dup},
 #endif
+#ifndef __MWERKS__
 	{"fdopen",	mac_fdopen},
+#endif
 	{"getbootvol",	mac_getbootvol}, /* non-standard */
 	{"getcwd",	mac_getcwd},
 	{"listdir",	mac_listdir},
+#ifndef __MWERKS__
 	{"lseek",	mac_lseek},
+#endif
 	{"mkdir",	mac_mkdir},
+#ifndef __MWERKS__
 	{"open",	mac_open},
 	{"read",	mac_read},
+#endif
 	{"rename",	mac_rename},
 	{"rmdir",	mac_rmdir},
 	{"stat",	mac_stat},
 	{"sync",	mac_sync},
 	{"unlink",	mac_unlink},
+#ifndef __MWERKS__
 	{"write",	mac_write},
+#endif
 
 	{NULL,		NULL}		 /* Sentinel */
 };