summaryrefslogtreecommitdiffstats
path: root/Mac/Modules
diff options
context:
space:
mode:
authorJack Jansen <jack.jansen@cwi.nl>1994-12-14 13:48:38 (GMT)
committerJack Jansen <jack.jansen@cwi.nl>1994-12-14 13:48:38 (GMT)
commit0c097eab573189240d7183ddd0c0c17eead4bc06 (patch)
treee6ff60537e1b66ee06b7f5f39d5153231876e196 /Mac/Modules
parentbac428d2e092d3d18b3556c5239964b8af4dc8bd (diff)
downloadcpython-0c097eab573189240d7183ddd0c0c17eead4bc06.zip
cpython-0c097eab573189240d7183ddd0c0c17eead4bc06.tar.gz
cpython-0c097eab573189240d7183ddd0c0c17eead4bc06.tar.bz2
Ported to MetroWerks, which misses file-descriptor like functionality.
Diffstat (limited to 'Mac/Modules')
-rw-r--r--Mac/Modules/macmodule.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/Mac/Modules/macmodule.c b/Mac/Modules/macmodule.c
index d8d0dd8..5b7dc7c 100644
--- a/Mac/Modules/macmodule.c
+++ b/Mac/Modules/macmodule.c
@@ -45,7 +45,9 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include "macstat.h"
+#ifndef __MWERKS__
#include <fcntl.h>
+#endif
#include "macdefs.h"
#include "dirent.h"
@@ -148,6 +150,7 @@ mac_chdir(self, args)
return mac_1str(args, chdir);
}
+#ifndef __MWERKS__
static object *
mac_close(self, args)
object *self;
@@ -164,6 +167,7 @@ mac_close(self, args)
INCREF(None);
return None;
}
+#endif /* !__MWERKS__ */
#ifdef MPW
@@ -185,6 +189,7 @@ mac_dup(self, args)
#endif /* MPW */
+#ifndef __MWERKS__
static object *
mac_fdopen(self, args)
object *self;
@@ -203,6 +208,7 @@ mac_fdopen(self, args)
return mac_error();
return newopenfileobject(fp, "(fdopen)", mode, fclose);
}
+#endif
static object *
mac_getbootvol(self, args)
@@ -281,6 +287,7 @@ mac_listdir(self, args)
return d;
}
+#ifndef __MWERKS__
static object *
mac_lseek(self, args)
object *self;
@@ -299,6 +306,7 @@ mac_lseek(self, args)
return mac_error();
return newintobject(res);
}
+#endif /* !__MWERKS__ */
static object *
mac_mkdir(self, args)
@@ -308,6 +316,7 @@ mac_mkdir(self, args)
return mac_strint(args, mkdir);
}
+#ifndef __MWERKS__
static object *
mac_open(self, args)
object *self;
@@ -348,6 +357,7 @@ mac_read(self, args)
resizestring(&buffer, size);
return buffer;
}
+#endif /* !__MWERKS */
static object *
mac_rename(self, args)
@@ -418,6 +428,7 @@ mac_unlink(self, args)
return mac_1str(args, (int (*)(const char *))unlink);
}
+#ifndef __MWERKS__
static object *
mac_write(self, args)
object *self;
@@ -434,27 +445,38 @@ mac_write(self, args)
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 */
};