]> icculus.org git repositories - taylor/freespace2.git/blob - include/unix.h
merge in inetfile fixes from PXO branch
[taylor/freespace2.git] / include / unix.h
1 // unix.h - duplicates some MS defines
2
3 #ifndef _UNIX_H
4 #define _UNIX_H
5
6 #include <stdio.h>
7 #include <sys/stat.h>
8 #include <sys/types.h>
9 #include <unistd.h>
10
11
12 #define _MAX_FNAME 255
13 #define _MAX_PATH 255
14 #define MAX_PATH 255
15 #define __cdecl
16 #define _isnan isnan
17 #define HANDLE int
18 #define _getcwd getcwd
19 #define _chdir chdir
20 #define _unlink unlink
21 #define _hypot hypot
22 #define _access access
23 #define byte unsigned char
24
25 extern int filelength (int fd);
26 extern int WSAGetLastError ();
27 extern void _splitpath (const char *path, char *drive, char *dir, char *fname, char *ext);
28
29 #define _mkdir(A) mkdir(A,0700)
30 #define ioctlsocket(A,B,C) ioctl(A,B,C)
31 #define closesocket(A) close(A)
32 #define CopyMemory(A,B,C) memcpy(A,B,C)
33 #define UINT unsigned int
34 #define SOCKET int
35 #define SOCKADDR_IN struct sockaddr_in
36 #define SOCKADDR struct sockaddr
37 #define LPSOCKADDR struct sockaddr*
38 #define LPHOSTENT struct hostent*
39 #define HOSTENT struct hostent
40 #define LPINADDR struct in_addr*
41 #define LPIN_ADDR struct in_addr*
42 #define SOCKET_ERROR -1
43 #define INVALID_SOCKET -1
44 #define TIMEVAL struct timeval
45 #define SERVENT struct servent
46 #define BOOL int
47
48 #define WSAEALREADY EALREADY
49 #define WSAEINVAL EINVAL
50 #define WSAEWOULDBLOCK EAGAIN
51 #define WSAEISCONN EISCONN
52 #define WSAECONNRESET ECONNRESET
53 #define WSAECONNABORTED ECONNABORTED
54 #define WSAESHUTDOWN ESHUTDOWN
55 #define WSAENOTSOCK ENOTSOCK
56
57 #endif