1995-01-18 13:41:47 +00:00
|
|
|
/*
|
|
|
|
** 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;
|
|
|
|
|
1995-01-19 12:23:31 +00:00
|
|
|
if ((err=FSDelete((ConstStr255Param)Pstring(old), 0)) == noErr)
|
1995-01-18 13:41:47 +00:00
|
|
|
return 0;
|
|
|
|
errno= err;
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif /* __MWERKS__ */
|