+2001-01-23 Herold Heiko <Heiko.Herold@previnet.it>
+
+ * config.h.ms, mswindows.h: defined HAVE_ISATTY, use _isatty for
+ MS VC; somebody with Borland compiler please check and provide
+ patch if possible;
+
+ * cmpt.c: provided a usleep emulation.
+
2001-11-29 Hrvoje Niksic <hniksic@arsdigita.com>
* host.c (address_list_new): Initialize al->faulty.
#ifndef HAVE_USLEEP
-/* A simple usleep implementation based on select(). This will
- probably not work on Windows. */
+#ifndef WINDOWS
+
+/* A simple usleep implementation based on select(). For Unix and
+ Unix-like systems. */
int
usleep (unsigned long usec)
select (0, NULL, NULL, NULL, &tm);
return 0;
}
+
+#endif /* not WINDOWS */
#endif /* not HAVE_USLEEP */
/* Emulation of Unix sleep. */
+
unsigned int
sleep (unsigned seconds)
{
return SleepEx (1000 * seconds, TRUE) ? 0U : 1000 * seconds;
}
+/* Emulation of Unix usleep(). This has a granularity of
+ milliseconds, but that's ok because:
+
+ a) Wget is only using it with milliseconds;
+
+ b) You can't rely on usleep's granularity anyway. If a caller
+ expects usleep to respect every microsecond, he's in for a
+ surprise. */
+
+int
+usleep (unsigned long usec)
+{
+ SleepEx (usec / 1000, TRUE);
+ return 0;
+}
+
static char *
read_registry (HKEY hkey, char *subkey, char *valuename, char *buf, int *len)
{
# define stat _stat
#endif
+#ifdef HAVE_ISATTY
+/* Microsoft VC supports _isatty; Borland ? */
+#ifdef _MSC_VER
+# define isatty _isatty
+#endif
+#endif
+
#define REALCLOSE(x) closesocket (x)
/* read & write don't work with sockets on Windows 95. */
SRC = cmpt.c safe-ctype.c connect.c host.c http.c netrc.c ftp-basic.c ftp.c \
ftp-ls.c ftp-opie.c getopt.c hash.c headers.c html-parse.c html-url.c \
- retr.c recur.c res.c url.c cookies.c init.c utils.c main.c version.c \
- mswindows.c fnmatch.c gnu-md5.c rbuf.c log.c $(SSLSRC)
+ progress.c retr.c recur.c res.c url.c cookies.c init.c utils.c main.c \
+ version.c mswindows.c fnmatch.c gnu-md5.c rbuf.c log.c $(SSLSRC)
OBJ = cmpt$o safe-ctype$o connect$o host$o http$o netrc$o ftp-basic$o ftp$o \
ftp-ls$o ftp-opie$o getopt$o hash$o headers$o html-parse$o html-url$o \
- retr$o recur$o res$o url$o cookies$o init$o utils$o main$o version$o \
- mswindows$o fnmatch$o gnu-md5$o rbuf$o log$o $(SSLOBJ)
+ progress$o retr$o recur$o res$o url$o cookies$o init$o utils$o main$o \
+ version$o mswindows$o fnmatch$o gnu-md5$o rbuf$o log$o $(SSLOBJ)
.SUFFIXES: .c .obj
res.obj+
recur.obj+
rbuf.obj+
+progress.obj+
netrc.obj+
mswindows.obj+
gnu-md5.obj+
/* Define if we're using builtin (GNU) md5.c. */
#define HAVE_BUILTIN_MD5 1
+/* Define if you have the isatty function. */
+#undef HAVE_ISATTY
+
+
#endif /* CONFIG_H */
#define inline __inline
#define ftruncate chsize
+/* Define if you have the isatty function. */
+#define HAVE_ISATTY 1
+
#endif /* CONFIG_H */