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