This directory contains a port of Mosaic Version 2.7 to Desqview/X.
The major steps involved in the port were:

1) Removed all implicit function and variable declarations.  I
compiled using the flags -O -DMSDOS -DMOTIF -Wimplicit.  I was able to
remove all compile warnings except for three or four complaints about
"XtAddApp...".  

Did this when porting 2.5, but didn't bother in porting 2.7. 

2) Changed unix file names that were too long to be DOS file names.
The major offenders were src/ccibindings1.c and src/ccibindings2.c,
which are both truncated to src/ccibindi.c.  I changed these file
names to ccibind1.c and ccibind2.c.  Also, many of the bitmap and
pixmap files in src/bitmaps were too long, and when truncated were
ambiguous.  To fix this, I changed "gopher" to "go" and "xmosaic" to
"xm" in all of the file names in src/bitmaps.  Also, the icon names in
src/pixmaps had two periods in them (e.g., icon.1.xpm), so I changed
the first period in each name to a dash, i.e., icon.1.xpm became
icon-1.xpm.

m27: ccibind1.c ccibind2.c done
     src\bitmaps\gopher -> go_ done
     src\bitmaps\xmosaic -> xm_ done
     src\pixmaps\icon names are now icon_1.xpm, etc.

made corresponding changes in src/gui.c and src/img.c

3) Replaced calls to the unix function "system".

-- none in src
-- none in libhtmlw
-- 1 in libwww2/htcompre.c *done*
-- 1 in libwww2/htfwrite.c *done*

Most of these were easy.  Calls to rm and mv were replaced with calls
to unlink and rename.  Calls to external viewers were replaced by
starting a doswin.dvp process, whose argument is the string that
contains the call, The "xv" command doesn't understand the disk name
"c:", so I strip this out of the file name before calling xv (or any
other program).  I.e., the call is:

c:
xv /tmp/007234.jpe
del c:/tmp/007234.jpe
exit

Decompressing files was a bit difficult because Mosaic tries to create
temporary files with two suffixes, e.g., 007234.ps.gz.  I fixed this
by removing the first suffix, decompressing the file, and then adding
the suffix back.  I first open a doswin.dvp process to do the
decompression, then every 1/2 second (for up to 25 seconds) I test to
see if the decompressed file exists.  Once it exists, I spawn the
external viewer. *done*

4) All files were opened in binary mode.  (The default in djgpp is
text mode, which fails for .gif files, etc.)  (Change made in
src/mosaic.h and libxmx/xmx.c.) *done*
changed fopen to FOPEN in many files!

5) All "read", "write", and "close" operations on sockets were changed
to "recv", "send", and "so_close".  (change in libwww2/tcp.h)
change in src/accept.c
(changed read to NETREAD and write to NETREAD in several files)

done.

6) The type of the third argument to ioctl was changed from int * to
long * (in /djgpp/include/sys/socket.h).
done.

Also, in libwww2/httcp.c, changed int val = 1; to long val = 1;
(And in aothr place int val = 0; to long val = 0;)

7) Unlike the port of Mosaic 2.0pre6, I did not attempt to change
slashes (i.e., '/'s) in file names to backslashes (i.e., '\'), except
in a few places where I issue DOS commands such as del and move.
Since all file names in djgpp use slashes, and all of the viewers and
compression utilities understand slashes, I didn't see any advantage
to making the change.

8) In src/xresourc.h, changed
".mosaic-personal-annotations" to "persanno" *done*
".mailcap" to "mailcap" *done*
".mosaic-hotlist-default" to "hotlist" *done*
 ".mime.types" to "mime.typ" *done*
".mosaic-global-history" to "globhist" *done*
".mosaic-x-history" to "mosxhist" *done*
".mosaic-hot.html" to "moshot.htm"
".newsrc" to "newsrc"
left "/usr/local/lib/mosaic/documents.menu"  as is

Also, in src/gui.c, changed ".mosaicpid" to "mosaic.pid" *done*
(DOS doesn't allow file names that start with .)

9) defined MO_MACHINE_TYPE to be "PC/AT" in src/mosaic.h *done*
   defined USE_REMOVE (but I didn't use it anywhere) in src/mosaic/h *done*
   defined USE_DIRENT (not sure what this does) in libwww2/tcp.h *done*
   defined GOT_READ_DIR to be 1 (directory reading functions available)
     in libwww2/tcp.h *done*
   defined NO_GROUPS in libwww2/htfile.c (not sure what this does) *done*
   defined fopen to be dvxfopen in src/mosaic.h *done*
   defined stat to be dvxstat in src/mosaic.h *done*

10) patched up call to _XmDrawShadows in libhtmlw/htmlw.c (html.c in 2.7)
*done*

11) created libhtmlw/htmlpars.h to hold some function prototypes *done*
    (but is this actually used anywhere?)

12) commented out a check for dirbuf->d_ino == 0 in libwww2/htfile.c.
This field does not exist in dv/x. *done*

13) in libwww2/htfile.c commented out check for:
(statbuf.st_mode & S_IXUSR) ||
(statbuf.st_mode & S_IXGRP) || 
(statbuf.st_mode & S_IXOTH)
instead, check for
(statbuf.st_mode & S_IEXEC) *done*

14) commented out line that set pres->command = 0 on libwww2/htformat.c *done*

15) deleted a pair of lines that removed a file twice in a row in
libwww2/htfwrite.c *done*

-- this seems to be fixed in version 2.7b5

16) mosaic thinks that a file whose name starts with c:/ belongs to a
subdirectory of the current directory called "c:".  Now all files are
opened through a call to DOSOPEN (in src/support.c), which looks for a
':' in the filename and, if it finds one, throws away everything
before the name of the disk.  Also, in function
mo_url_cononicalize_local, we have to add a / before any file name
that starts with a disk letter, or before the current working
directory, which always starts with a disk name. *done*

17) added support for inline JPEG images -- no DOS specific changes!
Small changes in file src/mosaic.h, src/mo-www.c, src/picread.c.
Did NOT make the changes to src/pixmaps.c, src/pixmaps.h, or
src/pixmaps that it wanted me to (all it did was replace the twirling
globe with a twirling dog).

- mo-www.c mod changes Mosaic signature string (didn't change it in m27)

18) Printing calls "lpr".  The dv/x lpr doesn't understand slashes
(/), so in gui-dial.c I convert the backslashes (\) in the temporary
file name before issuing the call to SYSTEM.  Also, lpr doesn't like
it when the file that it is supposed to print is unlinked, so for
dv/x, I commented out the line in gui-dial.c that unlinks the file
after issuing the command.  (The file is still deleted using the del
command.)

*done*

19) In src/hotfile.c/mo_write_hotlist, removed the call to
getpwuid(getuid()) the attempt to access pw->pw_gecos.  (This was
causing Mosaic to crash once I fixed the problem with the bad filename
for hotlists.)  [Removed all calls to getuid and getpwuid.]

* seems to have been removed in 2.7b4 *

20) Change uncompress command from "uncompress" to "decomp"
(In src/xresourc.h) *done* 

21) tmpnam and tempnam in djgpp kept returning the same temporary name
(e.g., 007684).  This worked most of the time, since Mosaic typically
unlinks a temporary file soon after using it, and in fact as far as I
know, if 007684 already existed, it might have created 007685.  The
problem was that Mosaic adds suffixes to temporary file names.  For
example, when a gzip-compressed postscript file is downloaded, it
might be put in a file 007684.  Soon, 007684 might get renamed to
007684.ps and then to 007684.gz and then to 007684, and finally back
to 007684.gz.  In the middle of this, tmpnam or tempnam might decide
that 007684 was a free name, and use it for some other purpose.  I
fixed this by adding my own 2-digit suffix to the beginning of each
temporary file name created.

22) removed call to execlp (which tries to swap a process) in
libwww2/htaabrow.c
*done*

23) removed the following lines from htwrite.c *done*

	      me->end_command = (char *)malloc 
		((strlen (pres->command) + 64 + (2 * strlen(me->fnam))) * 
		 sizeof (char));
	      sprintf (me->end_command, "((cat %s | %s); /bin/rm -f %s) &",
		       me->fnam, pres->command, me->fnam);

24) replaced the following lines in libwww2/htfwrite.c *done*
	      sprintf (me->end_command, "(%s ; /bin/rm -f %s) &",
		       command, me->fnam);
with
	      strcpy(me->end_command,command);

25) created a file src/config.h (supposed to be generated automatically)

26) added #include <sys/errno.h> to libwww2/htformat.c

27) commented out redundant "case EXTENSION:" in libwww2/htmime.c
also "case CONTENT_TYPE:"  SOMETHING IS WRONG HERE

28) ran unix2dvx -d=4 *.c and *.h on directories libwww2, libhtmlw, libxmx,
and src *done*

29) moved typedef from htmime.c to htmime.h.  Changed enum value EXTENSION to
abcEXTENSION (this fixed a lot of compile errors, for some unknown reason)

30) added #include <sys/errno.h> to libwww2/httcp.c and libwww2/http.c

31) fixed the following lines in src/gui.c
#include "../libnut/system.h"
#include "../libwww2/HTAABrow.h"
#include "../libhtmlw/HTML.h"

similar fix in gui-dialogs.c
similar fix in gui-menubar.c
similar fix in gui-popup.h
similar fix in gui-documents.h
similar fix in mo-www.c
similar fix in history.c
similar fix in annotate.c

32) added the following to mosaic.h (def. of mo_window)

#ifdef MSDOS
  Widget whine_text;
  Widget whine_form;
  Widget whine_win;
#endif

33) added the following to mosaic.h
extern *AppData Rdata;  /* extern'd in mosaic.h */

34) added #include "prefs.h" to src/whine.c

35) got rid of call to wait3 in src/child.c

#ifndef MSDOS
	pid = wait3(&stat_loc,WNOHANG,NULL);
#else
	return;
#endif

36)  mod to src/gui.c

#ifndef MSDOS
/*AppData Rdata;  /* extern'd in mosaic.h */
#else
AppData Rdata;
#endif
	
37) whine.c had redundant copies of mo_send_mail_message,
mo_start_sending_mail_message, etc. commented them out

38) removed call to uname in gui.c

39) commented out a large block of libnut/system.c that made
calls to pipe, fcntl, fork, ...

40) temporarily turned off hotlists in src/hotlist.
    temporarily turned off global history in src/globhist

41) changed name of preferences file in prefs.c
#define PREFERENCES_FILENAME "prefs"


42) in gui.c, look for preferences in TMPDIR, rather than HOME

    if (!(home_ptr=getenv("TMPDIR")))
      return 0;

Also in hotlist.c

43) in libwww2/httcp.c removed checks for EALREADY (dv/x doesn't have EALREADY)

44) change made to HTHostName in libwww2/httcp.c, since
get_host_details can fail in dv/x  -- several other changes in httcp.h as well

45) change in gui-dial.c to mo_post_open_local_window to handle "c:"
in local file name (same as m25 port)

46) change in mo-www.c to handle temporary file names

47) fixed localhost file URL's in
comment.c, pan.c, annotate.c, mo-www.c