prototype implementation of the new recursive code, and more.
Co-maintained Wget during the 1.8 release cycle.
-Gisle Vanem. Contributed Windows improvements, including a port of
-run_with_timeout to Windows, additions to Makefiles, and many bug
-reports and fixes.
+Gisle Vanem. Contributed Windows and MS-DOS improvements, including a
+port of run_with_timeout to Windows, additions to Makefiles, and many
+bug reports and fixes.
Mauro Tortonesi. Improved IPv6 support, adding support for dual
family systems. Refactored and enhanced FTP IPv6 code. Maintained GNU
windows/ChangeLog: documents only changes to files in the windows directory
+ msdos/ChangeLog: documents only changes to files in the msdos directory
+
When checking to see if a patch you sent in has been applied, please
look in the appropriate ChangeLog(s).
--- /dev/null
+2007-09-24 Gisle Vanem <giva@bgnett.no>
+
+ * Makefile.DJ, config.h: Added to support building on MS-DOS via
+ DJGPP.
--- /dev/null
+#
+# GNU Makefile for wget / djgpp / MSDOS.
+# By Gisle Vanem <giva@bgnett.no>.
+#
+.SUFFIXES: .exe .map
+
+USE_OPENSSL = 0
+USE_IPV6 = 1
+
+OPENSSL_ROOT = e:/net/OpenSSL.099
+ZLIB_ROOT = e:/djgpp/contrib/zlib
+
+VPATH = ../src
+OBJ_DIR = djgpp.obj
+CC = gcc
+CFLAGS = -O2 -g -Wall -Wcast-align -I. -I../src -I/dev/env/WATT_ROOT/inc \
+ -DHAVE_CONFIG_H -DENABLE_DEBUG
+
+# LDFLAGS = -s
+
+ifeq ($(USE_OPENSSL),1)
+ CFLAGS += -DHAVE_OPENSSL -DHAVE_SSL -I$(OPENSSL_ROOT)
+ EX_LIBS += $(OPENSSL_ROOT)/lib/libssl.a $(OPENSSL_ROOT)/lib/libcrypt.a \
+ $(ZLIB_ROOT)/libz.a
+ SOURCES = ../src/openssl.c ../src/http-ntlm.c
+endif
+
+ifeq ($(USE_IPV6),1)
+ CFLAGS += -DENABLE_IPV6
+endif
+
+EX_LIBS += /dev/env/WATT_ROOT/lib/libwatt.a
+
+SOURCES += $(addprefix ../src/, cmpt.c connect.c cookies.c ftp.c ftp-basic.c \
+ ftp-ls.c ftp-opie.c getopt.c hash.c host.c html-parse.c html-url.c \
+ http.c init.c log.c main.c gen-md5.c gnu-md5.c netrc.c progress.c \
+ recur.c res.c retr.c safe-ctype.c url.c utils.c version.c convert.c \
+ xmalloc.c ptimer.c spider.c)
+
+OBJECTS = $(addprefix $(OBJ_DIR)/, $(notdir $(SOURCES:.c=.o)))
+
+all: $(OBJ_DIR) ../wget-dos.exe
+ @echo 'Welcome to Wget'
+
+$(OBJ_DIR):
+ mkdir $(OBJ_DIR)
+
+../wget-dos.exe: $(OBJECTS)
+ $(CC) $(LDFLAGS) -o $@ $^ $(EX_LIBS)
+
+clean:
+ rm -f $(OBJECTS) $(MAPFILE)
+
+vclean realclean: clean
+ rm -f ../wget-dos.exe depend.dj
+ - rmdir $(OBJ_DIR)
+
+$(OBJ_DIR)/%.o: %.c
+ $(CC) $(CFLAGS) -o $@ -c $<
+ @echo
+
+depend:
+ $(CC) -MM $(CFLAGS) $(SOURCES) | \
+ sed -e 's/^\([a-zA-Z0-9_-]*\.o:\)/$$(OBJ_DIR)\/\1/' > depend.dj
+
+-include depend.dj
+
--- /dev/null
+/* Configuration header file for MS-DOS/Watt-32
+
+ Copyright (C) 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+ In addition, as a special exception, the Free Software Foundation
+ gives permission to link the code of its release of Wget with the
+ OpenSSL project's "OpenSSL" library (or with modified versions of it
+ that use the same license as the "OpenSSL" library), and distribute
+ the linked executables. You must obey the GNU General Public License
+ in all respects for all of the code used other than "OpenSSL". If you
+ modify this file, you may extend this exception to your version of the
+ file, but you are not obligated to do so. If you do not wish to do
+ so, delete this exception statement from your version. */
+
+
+#ifndef CONFIG_DOS_H
+#define CONFIG_DOS_H
+
+#include <stdlib.h>
+#include <limits.h>
+#include <tcp.h>
+#include <malloc.h>
+
+#ifdef __DJGPP__
+#include <sys/config.h>
+#endif
+
+#include <sys/errno.h>
+
+#if defined(__WATCOMC__) && (__WATCOMC__ >= 1250) /* OW 1.5+ */
+ #define OPENWATCOM_15
+#endif
+
+#if defined(__HIGHC__)
+ #define inline
+ #define HAVE_UNISTD_H 1
+ #define HAVE_UTIME_H 1
+#endif
+
+#if defined(__WATCOMC__) || defined(__BORLANDC__)
+ #define inline
+#endif
+
+#ifdef HAVE_SSL
+ #define OPENSSL_NO_KRB5
+#endif
+
+#define STDC_HEADERS 1
+#define RETSIGTYPE void
+
+#define USE_OPIE 1
+#define USE_DIGEST 1
+#define DEBUG
+
+#ifdef __DJGPP__
+ #define HAVE_STRUCT_UTIMBUF 1
+ #define HAVE_UNAME 1
+ #define HAVE_UTIME_H 1
+ #define HAVE_STRCASECMP 1
+ #define HAVE_STRNCASECMP 1
+ #define HAVE_SYS_SELECT_H 1
+ #define HAVE_USLEEP 1
+ #define HAVE_SIGNAL 1
+ #define HAVE_BASENAME 1
+ #define HAVE_SIGSETJMP 1
+ #define HAVE_SIGBLOCK 1
+ #define HAVE__BOOL 1
+
+ #if (DJGPP_MINOR >= 4)
+ #include <stdbool.h>
+ #define HAVE_SNPRINTF 1
+ #define HAVE_VSNPRINTF 1
+ #define HAVE_UINT32_T 1
+ #endif
+#endif
+
+#ifdef __HIGHC__
+ #define HAVE_STRUCT_UTIMBUF 1
+ #define HAVE_UTIME_H 1
+#endif
+
+#ifdef OPENWATCOM_15
+ #define HAVE_STRCASECMP
+ #define HAVE_STRNCASECMP
+#endif
+
+#define HAVE_GETHOSTBYNAME 1
+#define HAVE_GETHOSTNAME 1
+#define HAVE_SELECT 1
+#define HAVE_STRDUP 1
+#define HAVE_STRERROR 1
+#define HAVE_STRSTR 1
+#define HAVE_MKTIME 1
+#define HAVE_STDARG_H 1
+#define HAVE_STDLIB_H 1
+#define HAVE_STRING_H 1
+#define HAVE_SIGNAL_H 1
+#define HAVE_GETTIMEOFDAY 1
+#define HAVE_MD5 1
+#define HAVE_BUILTIN_MD5 1
+#define HAVE_ISATTY 1
+#define HAVE_MEMMOVE 1
+
+#define OS_TYPE "DOS"
+#define CTRLBREAK_BACKGND 1
+#define PROTOTYPES 1
+
+#define WGET_USE_STDARG
+
+#define lookup_host wget_lookuphost
+#define select select_s
+#define socklen_t int
+
+#define sock_read wget_sock_read
+#define sock_write wget_sock_write
+#define sock_close wget_sock_close
+
+#if defined(__DJGPP__)
+ #define MKDIR(p,a) mkdir(p,a)
+#else
+ #define strcasecmp stricmp
+ #define MKDIR(p,a) mkdir(p)
+#endif
+
+#if !defined(MSDOS)
+#define MSDOS
+#endif
+
+#endif /* CONFIG_DOS_H */
+2007-09-24 Gisle Vanem <giva@bgnett.no>
+
+ * connect.c, init.c, main.c, openssl.c, options.h, sysdep.h,
+ url.c, utils.c: Added support for building on MS-DOS.
+
2007-09-24 Jochen Roderburg <roderburg@uni-koeln.de>
* http.c (http_zero): Remove no-longer-used local_size variable.
\f
/* Basic socket operations, mostly EINTR wrappers. */
-#ifdef WINDOWS
+#if defined(WINDOWS) || defined(MSDOS)
# define read(fd, buf, cnt) recv (fd, buf, cnt, 0)
# define write(fd, buf, cnt) send (fd, buf, cnt, 0)
# define close(fd) closesocket (fd)
add any entries that allocate memory (e.g. cmd_string and
cmd_vector) to the cleanup() function below. */
-static struct {
+static const struct {
const char *name;
void *place;
bool (*action) (const char *, const char *, void *);
{ "useragent", NULL, cmd_spec_useragent },
{ "verbose", NULL, cmd_spec_verbose },
{ "wait", &opt.wait, cmd_time },
- { "waitretry", &opt.waitretry, cmd_time }
+ { "waitretry", &opt.waitretry, cmd_time },
+#ifdef MSDOS
+ { "wdebug", &opt.wdebug, cmd_boolean },
+#endif
};
/* Look up CMDNAME in the commands[] and return its position in the
#endif
/* The default for file name restriction defaults to the OS type. */
-#if !defined(WINDOWS) && !defined(__CYGWIN__)
- opt.restrict_files_os = restrict_unix;
-#else
+#if defined(WINDOWS) || defined(MSDOS) || defined(__CYGWIN__)
opt.restrict_files_os = restrict_windows;
+#else
+ opt.restrict_files_os = restrict_unix;
#endif
opt.restrict_files_ctrl = true;
opt.restrict_files_case = restrict_no_case_restriction;
if (!home)
{
-#ifndef WINDOWS
+#if defined(MSDOS)
+ /* Under MSDOS, if $HOME isn't defined, use the directory where
+ `wget.exe' resides. */
+ const char *_w32_get_argv0 (void); /* in libwatt.a/pcconfig.c */
+ char *p, buf[PATH_MAX];
+
+ strcpy (buf, _w32_get_argv0 ());
+ p = strrchr (buf, '/'); /* djgpp */
+ if (!p)
+ p = strrchr (buf, '\\'); /* others */
+ assert (p);
+ *p = '\0';
+ home = buf;
+#elif !defined(WINDOWS)
/* If HOME is not defined, try getting it from the password
file. */
struct passwd *pwd = getpwuid (getuid ());
if (!pwd || !pwd->pw_dir)
return NULL;
home = pwd->pw_dir;
-#else /* WINDOWS */
+#else /* !WINDOWS */
/* Under Windows, if $HOME isn't defined, use the directory where
`wget.exe' resides. */
home = ws_mypath ();
return true;
}
-#ifndef WINDOWS
-# define ISSEP(c) ((c) == '/')
-#else
+#if defined(WINDOWS) || defined(MSDOS)
# define ISSEP(c) ((c) == '/' || (c) == '\\')
+#else
+# define ISSEP(c) ((c) == '/')
#endif
/* Like the above, but handles tilde-expansion when reading a user's
*pstring = concat_strings (home, "/", val, (char *) 0);
}
-#ifdef WINDOWS
+#if defined(WINDOWS) || defined(MSDOS)
/* Convert "\" to "/". */
{
char *s;
{ "version", 'V', OPT_FUNCALL, (void *) print_version, no_argument },
{ "wait", 'w', OPT_VALUE, "wait", -1 },
{ "waitretry", 0, OPT_VALUE, "waitretry", -1 },
+#ifdef MSDOS
+ { "wdebug", 0, OPT_BOOLEAN, "wdebug", -1 },
+#endif
};
#undef WHEN_DEBUG
#ifdef ENABLE_DEBUG
N_("\
-d, --debug print lots of debugging information.\n"),
+#endif
+#ifdef MSDOS
+ N_("\
+ --wdebug print Watt-32 debug output.\n"),
#endif
N_("\
-q, --quiet quiet (no output).\n"),
exit (0);
}
\f
+
int
main (int argc, char *const *argv)
{
exit (1);
}
+#ifdef MSDOS
+ if (opt.wdebug)
+ dbug_init();
+ sock_init();
+#else
if (opt.background)
fork_to_background ();
+#endif
/* Initialize progress. Have to do this after the options are
processed so we know where the log file is. */
xfree_null (ctx->last_error);
xfree (ctx);
-#ifdef WINDOWS
+#if defined(WINDOWS) || defined(MSDOS)
closesocket (fd);
#else
close (fd);
bool debug; /* Debugging on/off */
#endif
+#ifdef MSDOS
+ bool wdebug; /* Watt-32 tcp/ip debugging on/off */
+#endif
+
bool timestamping; /* Whether to use time-stamping. */
bool backup_converted; /* Do we save pre-converted files as *.orig? */
# define __bool_true_false_are_defined 1
#endif
-/* Needed for compilation under OS/2: */
-#ifdef __EMX__
+/* Needed for compilation under OS/2 and MSDOS */
+#if defined(__EMX__) || defined(MSDOS)
# ifndef S_ISLNK
# define S_ISLNK(m) 0
# endif
# ifndef lstat
# define lstat stat
# endif
-#endif /* __EMX__ */
+#endif /* __EMX__ || MSDOS */
/* Reportedly, stat() macros are broken on some old systems. Those
systems will have to fend for themselves, as I will not introduce
enum {
filechr_not_unix = 1, /* unusable on Unix, / and \0 */
- filechr_not_windows = 2, /* unusable on Windows, one of \|/<>?:*" */
+ filechr_not_windows = 2, /* unusable on MSDOS/Windows, one of \|/<>?:*" */
filechr_control = 4 /* a control character, e.g. 0-31 */
};
}
\f
/* The Windows versions of the following two functions are defined in
- mswindows.c. */
+ mswindows.c. On MSDOS this function should never be called. */
-#ifndef WINDOWS
+#if !defined(WINDOWS) && !defined(MSDOS)
void
fork_to_background (void)
{
freopen ("/dev/null", "w", stdout);
freopen ("/dev/null", "w", stderr);
}
-#endif /* not WINDOWS */
+#endif /* !WINDOWS && !MSDOS */
\f
/* "Touch" FILE, i.e. make its mtime ("modified time") equal the time
specified with TM. The atime ("access time") is set to the current