Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 31f61dd

Browse files
committed
Moved development-platform specific files to subdirectories
1 parent 6520119 commit 31f61dd

2 files changed

Lines changed: 61 additions & 0 deletions

File tree

Mac/mwerks/errno_unix.h

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
2+
#define ENOTDIR (-120)
3+
#define EACCES (-54)
4+
#define EEXIST (-48)
5+
#define EBUSY (-47)
6+
#define EROFS (-44)
7+
#define ENOENT (-43)
8+
#define ENFILE (-42)
9+
#define EIO (-36)
10+
#define ENOSPC (-34)
11+
12+
#define ESRCH 3
13+
#define EINTR 4
14+
#define EBADF 9
15+
#define ENODEV 19
16+
#define EINVAL 22
17+
#define EMFILE 24
18+

Mac/mwerks/mwerksglue.c

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
/*
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+
14+
int
15+
fileno(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+
24+
int
25+
isatty(fd)
26+
int fd;
27+
{
28+
return (fd >= 0 && fd <= 2);
29+
}
30+
31+
int
32+
unlink(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__ */

0 commit comments

Comments
 (0)