Staging
v0.5.0
https://github.com/python/cpython
Raw File
Tip revision: 4e02a97bd786bde6485210bd1c0f36fdc8ea8a56 authored by cvs2svn on 12 August 1998, 02:38:11 UTC
This commit was manufactured by cvs2svn to create tag 'r152a1'.
Tip revision: 4e02a97
mwerksglue.c
/*
** 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__ */
back to top