1 /* Declarations for windows
2 Copyright (C) 1995, 1997, 1997, 1998 Free Software Foundation, Inc.
4 This file is part of Wget.
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
23 /* Apparently needed for alloca(). */
27 # define S_ISDIR(m) (((m) & (_S_IFMT)) == (_S_IFDIR))
33 /* We have strcasecmp and strncasecmp, just under a different name. */
34 #define strcasecmp stricmp
35 #define strncasecmp strnicmp
37 /* The same for snprintf() and vsnprintf(). */
38 #define snprintf _snprintf
39 #define vsnprintf _vsnprintf
41 /* No stat on Windows. */
44 #define PATH_SEPARATOR '\\'
46 /* Microsoft says stat is _stat, Borland doesn't */
51 #define REALCLOSE(x) closesocket (x)
53 /* read & write don't work with sockets on Windows 95. */
54 #define READ(fd, buf, cnt) recv ((fd), (buf), (cnt), 0)
55 #define WRITE(fd, buf, cnt) send ((fd), (buf), (cnt), 0)
57 /* #### Do we need this? */
60 /* Windows compilers accept only one arg to mkdir. */
62 # define mkdir(a, b) _mkdir(a)
63 #else /* __BORLANDC__ */
64 # define mkdir(a, b) mkdir(a)
65 #endif /* __BORLANDC__ */
69 /* Declarations of various socket errors: */
71 #define EWOULDBLOCK WSAEWOULDBLOCK
72 #define EINPROGRESS WSAEINPROGRESS
73 #define EALREADY WSAEALREADY
74 #define ENOTSOCK WSAENOTSOCK
75 #define EDESTADDRREQ WSAEDESTADDRREQ
76 #define EMSGSIZE WSAEMSGSIZE
77 #define EPROTOTYPE WSAEPROTOTYPE
78 #define ENOPROTOOPT WSAENOPROTOOPT
79 #define EPROTONOSUPPORT WSAEPROTONOSUPPORT
80 #define ESOCKTNOSUPPORT WSAESOCKTNOSUPPORT
81 #define EOPNOTSUPP WSAEOPNOTSUPP
82 #define EPFNOSUPPORT WSAEPFNOSUPPORT
83 #define EAFNOSUPPORT WSAEAFNOSUPPORT
84 #define EADDRINUSE WSAEADDRINUSE
85 #define EADDRNOTAVAIL WSAEADDRNOTAVAIL
86 #define ENETDOWN WSAENETDOWN
87 #define ENETUNREACH WSAENETUNREACH
88 #define ENETRESET WSAENETRESET
89 #define ECONNABORTED WSAECONNABORTED
90 #define ECONNRESET WSAECONNRESET
91 #define ENOBUFS WSAENOBUFS
92 #define EISCONN WSAEISCONN
93 #define ENOTCONN WSAENOTCONN
94 #define ESHUTDOWN WSAESHUTDOWN
95 #define ETOOMANYREFS WSAETOOMANYREFS
96 #define ETIMEDOUT WSAETIMEDOUT
97 #define ECONNREFUSED WSAECONNREFUSED
98 #define ELOOP WSAELOOP
99 #define EHOSTDOWN WSAEHOSTDOWN
100 #define EHOSTUNREACH WSAEHOSTUNREACH
101 #define EPROCLIM WSAEPROCLIM
102 #define EUSERS WSAEUSERS
103 #define EDQUOT WSAEDQUOT
104 #define ESTALE WSAESTALE
105 #define EREMOTE WSAEREMOTE
107 /* Public functions. */
109 unsigned int sleep (unsigned);
110 void ws_startup (void);
111 void ws_changetitle (char*, int);
112 char *ws_mypath (void);
113 void ws_help (const char *);
114 void windows_main_junk (int *, char **, char **);
116 #endif /* MSWINDOWS_H */