]> sjero.net Git - wget/blob - src/mswindows.h
[svn] Update the license to include the OpenSSL exception.
[wget] / src / mswindows.h
1 /* Declarations for windows
2    Copyright (C) 1995, 1997, 1997, 1998 Free Software Foundation, Inc.
3
4 This file is part of GNU Wget.
5
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.
10
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.
15
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.
19
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.  */
29
30 #ifndef MSWINDOWS_H
31 #define MSWINDOWS_H
32
33 /* Apparently needed for alloca(). */
34 #include <malloc.h>
35
36 #ifndef S_ISDIR
37 # define S_ISDIR(m) (((m) & (_S_IFMT)) == (_S_IFDIR))
38 #endif
39 #ifndef S_ISLNK
40 # define S_ISLNK(a) 0
41 #endif
42
43 /* We have strcasecmp and strncasecmp, just under a different name. */
44 #define strcasecmp stricmp
45 #define strncasecmp strnicmp
46
47 /* The same for snprintf() and vsnprintf().  */
48 #define snprintf _snprintf
49 #define vsnprintf _vsnprintf
50
51 /* No stat on Windows.  */
52 #define lstat stat
53
54 #define PATH_SEPARATOR '\\'
55
56 /* Microsoft says stat is _stat, Borland doesn't */
57 #ifdef _MSC_VER
58 # define stat _stat
59 #endif
60
61 #ifdef HAVE_ISATTY
62 /* Microsoft VC supports _isatty; Borland ? */
63 #ifdef _MSC_VER
64 # define isatty _isatty
65 #endif
66 #endif
67
68 #define REALCLOSE(x) closesocket (x)
69
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)
73
74 /* #### Do we need this?  */
75 #include <direct.h>
76
77 /* Windows compilers accept only one arg to mkdir. */
78 #ifndef __BORLANDC__
79 # define mkdir(a, b) _mkdir(a)
80 #else  /* __BORLANDC__ */
81 # define mkdir(a, b) mkdir(a)
82 #endif /* __BORLANDC__ */
83
84 #include <windows.h>
85
86 /* Declarations of various socket errors: */
87
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
123
124 /* Public functions.  */
125
126 unsigned int sleep (unsigned);
127 void ws_startup (void);
128 void ws_changetitle (char*, int);
129 char *ws_mypath (void);
130 void ws_help (const char *);
131 void windows_main_junk (int *, char **, char **);
132
133 #endif /* MSWINDOWS_H */