]> sjero.net Git - wget/blob - src/mswindows.h
[svn] Initial revision
[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 Wget.
5
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.
10
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.
15
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.  */
19
20 #ifndef MSWINDOWS_H
21 #define MSWINDOWS_H
22
23 #ifndef S_ISDIR
24 # define S_ISDIR(m) (((m) & (_S_IFMT)) == (_S_IFDIR))
25 #endif
26 #ifndef S_ISLNK
27 # define S_ISLNK(a) 0
28 #endif
29
30 /* We have strcasecmp and strncasecmp, just under a different name. */
31 #define strcasecmp stricmp
32 #define strncasecmp strnicmp
33
34 /* No stat on Windows.  */
35 #define lstat stat
36
37 #define PATH_SEPARATOR '\\'
38
39 /* Microsoft says stat is _stat, Borland doesn't */
40 #ifdef _MSC_VER
41 # define stat _stat
42 #endif
43
44 #define REALCLOSE(x) closesocket (x)
45
46 /* read & write don't work with sockets on Windows 95.  */
47 #define READ(fd, buf, cnt) recv ((fd), (buf), (cnt), 0)
48 #define WRITE(fd, buf, cnt) send ((fd), (buf), (cnt), 0)
49
50 /* #### Do we need this?  */
51 #include <direct.h>
52
53 /* Windows compilers accept only one arg to mkdir. */
54 #ifndef __BORLANDC__
55 # define mkdir(a, b) _mkdir(a)
56 #else  /* __BORLANDC__ */
57 # define mkdir(a, b) mkdir(a)
58 #endif /* __BORLANDC__ */
59
60 #include <windows.h>
61
62 /* Declarations of various socket errors: */
63
64 #define EWOULDBLOCK             WSAEWOULDBLOCK
65 #define EINPROGRESS             WSAEINPROGRESS
66 #define EALREADY                WSAEALREADY
67 #define ENOTSOCK                WSAENOTSOCK
68 #define EDESTADDRREQ            WSAEDESTADDRREQ
69 #define EMSGSIZE                WSAEMSGSIZE
70 #define EPROTOTYPE              WSAEPROTOTYPE
71 #define ENOPROTOOPT             WSAENOPROTOOPT
72 #define EPROTONOSUPPORT         WSAEPROTONOSUPPORT
73 #define ESOCKTNOSUPPORT         WSAESOCKTNOSUPPORT
74 #define EOPNOTSUPP              WSAEOPNOTSUPP
75 #define EPFNOSUPPORT            WSAEPFNOSUPPORT
76 #define EAFNOSUPPORT            WSAEAFNOSUPPORT
77 #define EADDRINUSE              WSAEADDRINUSE
78 #define EADDRNOTAVAIL           WSAEADDRNOTAVAIL
79 #define ENETDOWN                WSAENETDOWN
80 #define ENETUNREACH             WSAENETUNREACH
81 #define ENETRESET               WSAENETRESET
82 #define ECONNABORTED            WSAECONNABORTED
83 #define ECONNRESET              WSAECONNRESET
84 #define ENOBUFS                 WSAENOBUFS
85 #define EISCONN                 WSAEISCONN
86 #define ENOTCONN                WSAENOTCONN
87 #define ESHUTDOWN               WSAESHUTDOWN
88 #define ETOOMANYREFS            WSAETOOMANYREFS
89 #define ETIMEDOUT               WSAETIMEDOUT
90 #define ECONNREFUSED            WSAECONNREFUSED
91 #define ELOOP                   WSAELOOP
92 #define EHOSTDOWN               WSAEHOSTDOWN
93 #define EHOSTUNREACH            WSAEHOSTUNREACH
94 #define EPROCLIM                WSAEPROCLIM
95 #define EUSERS                  WSAEUSERS
96 #define EDQUOT                  WSAEDQUOT
97 #define ESTALE                  WSAESTALE
98 #define EREMOTE                 WSAEREMOTE
99
100 /* Public functions.  */
101
102 unsigned int sleep (unsigned);
103 void ws_startup (void);
104 void ws_changetitle (char*, int);
105 char *ws_mypath (void);
106 void ws_help (const char *);
107 void windows_main_junk (int *, char **, char **);
108
109 #endif /* MSWINDOWS_H */