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