blob: 37e3a81728cf7453bf5ca4a3d2212f83164fa777 [file] [log] [blame]
Jack Jansen34e7cae1994-12-14 14:04:55 +00001/*
2** Glue code for MetroWerks CodeWarrior, which misses
3** unix-like routines for file-access.
4*/
5
6#ifdef __MWERKS__
7#include <Types.h>
8#include <Files.h>
9#include <Strings.h>
10
11#include <stdio.h>
12#include <errno.h>
13
14int
15fileno(fp)
16 FILE *fp;
17{
18 if (fp==stdin) return 0;
19 else if (fp==stdout) return 1;
20 else if (fp==stderr) return 2;
21 else return 3;
22}
23
24int
25isatty(fd)
26 int fd;
27{
28 return (fd >= 0 && fd <= 2);
29}
30
31int
32unlink(old)
33 char *old;
34{
35 OSErr err;
36
37 if ((err=FSDelete(c2pstr(old), 0)) == noErr)
38 return 0;
39 errno= err;
40 return -1;
41}
42
43#endif /* __MWERKS__ */