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 #define REALCLOSE(x) closesocket (x)
70 /* read & write don't work with sockets on Windows 95. */
71 #define READ(fd, buf, cnt) recv ((fd), (buf), (cnt), 0)
72 #define WRITE(fd, buf, cnt) send ((fd), (buf), (cnt), 0)
74 /* #### Do we need this? */
77 /* Windows compilers accept only one arg to mkdir. */
79 # define mkdir(a, b) _mkdir(a)
80 #else /* __BORLANDC__ */
81 # define mkdir(a, b) mkdir(a)
82 #endif /* __BORLANDC__ */
86 /* Declarations of various socket errors: */
88 #define EWOULDBLOCK WSAEWOULDBLOCK
89 #define EINPROGRESS WSAEINPROGRESS
90 #define EALREADY WSAEALREADY
91 #define ENOTSOCK WSAENOTSOCK
92 #define EDESTADDRREQ WSAEDESTADDRREQ
93 #define EMSGSIZE WSAEMSGSIZE
94 #define EPROTOTYPE WSAEPROTOTYPE
95 #define ENOPROTOOPT WSAENOPROTOOPT
96 #define EPROTONOSUPPORT WSAEPROTONOSUPPORT
97 #define ESOCKTNOSUPPORT WSAESOCKTNOSUPPORT
98 #define EOPNOTSUPP WSAEOPNOTSUPP
99 #define EPFNOSUPPORT WSAEPFNOSUPPORT
100 #define EAFNOSUPPORT WSAEAFNOSUPPORT
101 #define EADDRINUSE WSAEADDRINUSE
102 #define EADDRNOTAVAIL WSAEADDRNOTAVAIL
103 #define ENETDOWN WSAENETDOWN
104 #define ENETUNREACH WSAENETUNREACH
105 #define ENETRESET WSAENETRESET
106 #define ECONNABORTED WSAECONNABORTED
107 #define ECONNRESET WSAECONNRESET
108 #define ENOBUFS WSAENOBUFS
109 #define EISCONN WSAEISCONN
110 #define ENOTCONN WSAENOTCONN
111 #define ESHUTDOWN WSAESHUTDOWN
112 #define ETOOMANYREFS WSAETOOMANYREFS
113 #define ETIMEDOUT WSAETIMEDOUT
114 #define ECONNREFUSED WSAECONNREFUSED
115 #define ELOOP WSAELOOP
116 #define EHOSTDOWN WSAEHOSTDOWN
117 #define EHOSTUNREACH WSAEHOSTUNREACH
118 #define EPROCLIM WSAEPROCLIM
119 #define EUSERS WSAEUSERS
120 #define EDQUOT WSAEDQUOT
121 #define ESTALE WSAESTALE
122 #define EREMOTE WSAEREMOTE
124 /* Public functions. */
127 unsigned int sleep (unsigned);
130 int usleep (unsigned long);
133 void ws_startup (void);
134 void ws_changetitle (const char*, int);
135 void ws_percenttitle (double);
136 char *ws_mypath (void);
137 void ws_help (const char *);
138 void windows_main_junk (int *, char **, char **);
140 #endif /* MSWINDOWS_H */