1 /* Declarations for windows
2 Copyright (C) 1995, 1997, 1997, 1998 Free Software Foundation, Inc.
4 This file is part of GNU Wget.
6 GNU Wget 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 GNU Wget 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 Wget; if not, write to the Free Software
18 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 In addition, as a special exception, the Free Software Foundation
21 gives permission to link the code of its release of Wget with the
22 OpenSSL project's "OpenSSL" library (or with modified versions of it
23 that use the same license as the "OpenSSL" library), and distribute
24 the linked executables. You must obey the GNU General Public License
25 in all respects for all of the code used other than "OpenSSL". If you
26 modify this file, you may extend this exception to your version of the
27 file, but you are not obligated to do so. If you do not wish to do
28 so, delete this exception statement from your version. */
33 /* Apparently needed for alloca(). */
37 # define S_ISDIR(m) (((m) & (_S_IFMT)) == (_S_IFDIR))
43 /* We have strcasecmp and strncasecmp, just under a different name. */
44 #define strcasecmp stricmp
45 #define strncasecmp strnicmp
47 /* The same for snprintf() and vsnprintf(). */
48 #define snprintf _snprintf
49 #define vsnprintf _vsnprintf
51 /* No stat on Windows. */
54 #define PATH_SEPARATOR '\\'
56 /* Microsoft says stat is _stat, Borland doesn't */
62 /* Microsoft VC supports _isatty; Borland ? */
64 # define isatty _isatty
68 /* Use ANSI-style stdargs regardless of whether the compiler bothers
69 to define __STDC__. (Many don't when extensions are enabled.) */
70 #define WGET_USE_STDARG
72 #define REALCLOSE(x) closesocket (x)
74 /* read & write don't work with sockets on Windows 95. */
75 #define READ(fd, buf, cnt) recv ((fd), (buf), (cnt), 0)
76 #define WRITE(fd, buf, cnt) send ((fd), (buf), (cnt), 0)
78 /* #### Do we need this? */
81 /* Windows compilers accept only one arg to mkdir. */
83 # define mkdir(a, b) _mkdir(a)
84 #else /* __BORLANDC__ */
85 # define mkdir(a, b) mkdir(a)
86 #endif /* __BORLANDC__ */
90 /* Declarations of various socket errors: */
92 #define EWOULDBLOCK WSAEWOULDBLOCK
93 #define EINPROGRESS WSAEINPROGRESS
94 #define EALREADY WSAEALREADY
95 #define ENOTSOCK WSAENOTSOCK
96 #define EDESTADDRREQ WSAEDESTADDRREQ
97 #define EMSGSIZE WSAEMSGSIZE
98 #define EPROTOTYPE WSAEPROTOTYPE
99 #define ENOPROTOOPT WSAENOPROTOOPT
100 #define EPROTONOSUPPORT WSAEPROTONOSUPPORT
101 #define ESOCKTNOSUPPORT WSAESOCKTNOSUPPORT
102 #define EOPNOTSUPP WSAEOPNOTSUPP
103 #define EPFNOSUPPORT WSAEPFNOSUPPORT
104 #define EAFNOSUPPORT WSAEAFNOSUPPORT
105 #define EADDRINUSE WSAEADDRINUSE
106 #define EADDRNOTAVAIL WSAEADDRNOTAVAIL
107 #define ENETDOWN WSAENETDOWN
108 #define ENETUNREACH WSAENETUNREACH
109 #define ENETRESET WSAENETRESET
110 #define ECONNABORTED WSAECONNABORTED
111 #define ECONNRESET WSAECONNRESET
112 #define ENOBUFS WSAENOBUFS
113 #define EISCONN WSAEISCONN
114 #define ENOTCONN WSAENOTCONN
115 #define ESHUTDOWN WSAESHUTDOWN
116 #define ETOOMANYREFS WSAETOOMANYREFS
117 #define ETIMEDOUT WSAETIMEDOUT
118 #define ECONNREFUSED WSAECONNREFUSED
119 #define ELOOP WSAELOOP
120 #define EHOSTDOWN WSAEHOSTDOWN
121 #define EHOSTUNREACH WSAEHOSTUNREACH
122 #define EPROCLIM WSAEPROCLIM
123 #define EUSERS WSAEUSERS
124 #define EDQUOT WSAEDQUOT
125 #define ESTALE WSAESTALE
126 #define EREMOTE WSAEREMOTE
128 /* Public functions. */
130 unsigned int sleep (unsigned);
131 void ws_startup (void);
132 void ws_changetitle (char*, int);
133 char *ws_mypath (void);
134 void ws_help (const char *);
135 void windows_main_junk (int *, char **, char **);
136 int usleep (unsigned long);
138 #endif /* MSWINDOWS_H */