                                                18 May 2004.  SMS.

                     Wget 1.9.1 for VMS (1.9.1a)
                     ===========================

------------------------------------------------------------------------

      Disclaimer
      ----------

   No claims of any sort are made herein.  The main Wget developers seem
indifferent to this effort.  Any suggestions for improving the code in
the VMS-specific sections are welcome, but low expectations are more
realistic than high ones.

------------------------------------------------------------------------

      Description
      -----------

   This note accompanies a quick VMS port of Wget version 1.9.1, a GNU
free network utility to retrieve files from the World Wide Web using
HTTP and FTP.  The most obvious features seem to work, but many have not
been tested.

   Built and tested (slightly) in these environments:

OpenVMS Alpha V7.3-1, Compaq C V6.5-001, TCPIP V5.3 - ECO 2

OpenVMS IA64 V8.1, hp C X7.1-024, TCPIP T5.5.  (Woo-hoo.)

OpenVMS VAX V7.3, Compaq C V6.4-005, TCPIP V5.1.

------------------------------------------------------------------------

      News
      ----

   Version 1.9.1a  2004-04-28
   --------------------------

- Changes to VMS-WGET.COM since Wget 1.5.3h:
   - A separate LIST command-line option now controls compiler listing
     files.  The DBG option no longer implies compiler listing files. 
     The LIST option also generates a link map with cross-reference.
   - The DBG option may actually work now.
   - Added support for IA64 architecture.
- Changes to DESCRIP.MMS since Wget 1.5.3h:
   - Compiler listing files (.LIS) and link maps (.MAP) are now put into
     the system-specific directory with the corresponding object files
     (.OBJ), namely, [.SRC.ALPHA], [.SRC.IA64], or [.SRC.VAX]. 
     Previously, they were put into the source directory ([.SRC])
     itself.
   - CLEAN target now deletes any .LIS and .MAP files.
   - New HELP target creates a Wget help library.
   - The OS_TYPE macro is now defined, including the VMS version.
   - No more complaints like "%MMS-W-MBREDEFILL, Illegal attempt to
     redefine macro 'CFLAGS'" on old versions of MMS.
   - A separate LIST macro now controls compiler listing files.  The
     DBG macro no longer implies compiler listing files.
   - New support for IA64 architecture.
- Built-in initialization of some DECC$* run-time options on non-VAX
  systems.  Currently this behavior is compiled in, so any changes must
  be made in the VMS.C source file.  These changes have no effect on VAX
  (or older Alpha) systems where the OS and C run-time support is
  absent.
   - Command-line case preservation.  Wget for VMS enables the following
     DECC$* run-time option:
        DECC$ARGV_PARSE_STYLE
     With extended command parsing enabled ("SET PROCESS
     /PARSE_STYLE = EXTENDED"), command-line case is preserved.  This
     obviates quoting case-sensitive option switches, URLs, and other
     parameters.
   - Extended file names on ODS5 file systems.  Wget for VMS enables the
     following DECC$* run-time options:
        DECC$EFS_CASE_PRESERVE
        DECC$EFS_CHARSET
     Thus, if an OSD5 file system is used as the destination for
     downloaded files, multiple dots will be permitted and case will be
     preserved in file names.  If an ODS2 file system is used, the same
     character substitutions will be made as in Wget 1.5.3h, namely,
     "." -> "_" (where needed), "~" -> "-", and "@" -> "$".

------------------------------------------------------------------------

      Changes to source files (all in [.SRC])
      ---------------------------------------

   Files new for VMS:

      CONFIG.H_VMS       VMS-specific CONFIG.H.

      DESCRIP.MMS        MMK or MMS description ("make") file.

      VMS-WGET.COM       DCL procedure to build the executable from the
                         source, using MMK or MMS (and DESCRIP.MMS).

      VMS.C              Various VMS-specific code: DEC run-time
                         initialization, ODS2-ODS5 file system
                         detection, ODS2 file name adjustment, "utime()"
                         replacement function, and for VMS before V7.0,
                         "getpwuid()" and "localtime_r()".

      VMS.H              VMS-specific header file.  For VMS C RTL before
                         V7.3, replacement for <utime.h>.  For VMS C RTL
                         before V7.0, replacement for <pwd.h>. 
                         Declarations of replacement data
                         types/structures and function prototypes for
                         VMS.C.

      VMS_IP.H           IP software type-specific "#include"
                         directives.  Used by HOST.C.

      VMS_NOTES.TXT      These notes.

      WGET.OPT           LINK options file.

      WGET_MULTINET.OPT  LINK options file supplement for Multinet.


   Files modified for VMS:

      CONVERT.C         Changed to use "_orig" instead of ".orig" as the
                        file name suffix used for the "-K"
                        ("--backup-converted") option.

      COOKIES.C         Fixed %CC-I-QUESTCOMPARE1 with a type cast.
                        Fixed %CC-W-LONGEXTERN by changing 33-character
                        symbol cookie_jar_generate_cookie_header to
                        cookie_jar_generate_cookie_hdr.

      COOKIES.H         Changed cookie_jar_generate_cookie_header to
                        cookie_jar_generate_cookie_hdr (COOKIES.C).

      FTP.C             Changed to eliminate a spurious -debug message
                        ("Unrecognized permissions for <directory>").
                        Changed to eliminate spurious complaints when
                        recursive downloads hit an empty directory.

      FTP-LS.C          Fixed %CC-W-OUTTYPELEN from attempt to fprintf()
                        an int (u->port) using a "%hu" conversion
                        specifier.  It now uses "%d".
                        Changed to open the ".listing" file in text
                        mode, not binary.
                        Changed VMS FTP DIR-parsing code to tolerate
                        more variability (leading blank lines).
                        Added support for the environment variable
                        "WGET_TIMEZONE_DIFFERENTIAL" for file time
                        adjustment (as in Wget 1.5.3h for VMS).

      HOST.C            Added code for Multinet.
      
      HTTP.C            Fixed multiple %CC-I-QUESTCOMPARE1 with type
                        casts.
                        Changed cookie_jar_generate_cookie_header to
                        cookie_jar_generate_cookie_hdr (COOKIES.C).
                        Added code to try using the logical name
                        "SYS$TIMEZONE_DIFFERENTIAL" for UTC-to-local
                        time conversions if "gmtime()" fails.
                        Added code to use SYS$TIMEZONE_DAYLIGHT_SAVING
                        in some local-UTC time conversions.

      INIT.C            Changed to use "SYS$LOGIN:.wgetrc" as the name
                        of the initialization file on VMS.
                        Changed to open this file in text mode, not
                        binary.

      MAIN.C            Changed the program identification debug message
                        ("built on OS_TYPE" instead of "on OS_TYPE").
                        Changed to set ODS5 flag if the download
                        destination is on an ODS5 file system.

      NETRC.C           Changed to use "SYS$LOGIN:.netrc" as the name of
                        the user name and password file on VMS.

      URL.C             Added code to replace unacceptable dots (".")
                        with underscores "_"), tildes ("~") with hyphens
                        ("-"), and at signs ("@") with dollar signs
                        ("$"), respectively, in URL-derived file
                        specifications.

      UTILS.C           Added VMS-specific code to work around the lack
                        of "fork()".
                        Fixed multiple %CC-I-QUESTCOMPARE1 with type
                        casts.
                        Changed to assist ODS2 name reversion.

      VERSION.C         Changed "1.9.1" to "1.9.1a".

------------------------------------------------------------------------

      Home source URL
      ---------------

http://www.gnu.org/directory/wget.html
http://ftp.gnu.org/gnu/wget/
ftp://ftp.gnu.org/gnu/wget/

------------------------------------------------------------------------

      Instructions
      ------------

   Extract the files from the distribution kit.  The kit includes an
Alpha executable, "[.WGET-1_9_1A.SRC.ALPHA]WGET.EXE", and a VAX
executable, "[.WGET-1_9_1A.SRC.VAX]WGET.EXE".

   The command procedure VMS-WGET.COM attempts to determine the CPU type
and the IP package, defines the appropriate macros for MMK or MMS, and
then builds the appropriate executable from the source:

      SET DEFAULT [.WGET-1_9_1A.SRC]
      @ VMS-WGET CLEAN ! Deletes all object, list, map, and executable
                       ! files for the current CPU type.
      @ VMS-WGET       ! Copies CONFIG.H_VMS to CONFIG.H, compiles the
                       ! source files, and links the executable,
                       ! WGET.EXE.  Add "DASHD" to this command line to
                       ! enable the Wget "-d" command-line option.  Add
                       ! "DBG" to this command line to build a debug
                       ! executable.  Add "LIST" if compiler listing and
                       ! link map files are desired.
      @ VMS-WGET HELP  ! Creates a help library.  (Optional.  See
                       ! below.)

   Set the symbol for the foreign command:

      WGET :== $ {actual_device_and_directory}WGET.EXE

   A very basic VMS HELP file is supplied in [.DOC]WGET.HLP.  To be
used, it must be added to a HELP library, either an existing library or
one just for Wget.  As mentioned above, a new Wget help library may be
created using the command, "@ VMS-WGET HELP".

   When a new HELP library is created, a logical name "HLP$LIBRARY_n"
may be defined to allow the HELP utility to find it.  See "HELP
/USERLIBRARY" for details.

   Try to read the original documentation to learn how to use Wget.  The
principal differences in this VMS adaptation are:

   "-b" ("background") has no effect.  (It uses "fork()".)

   Excess dots are replaced by underscores in URL-derived file
specifications on ODS2 file systems.  For example, on a UNIX system, the
URL "ftp://ftp.anywhere.org/x.y.z/a.b.c" could produce the local file
"ftp.anywhere.org/x.y.z/a.b.c".  With this VMS adaptation, the local
ODS2 file would be "[.FTP_ANYWHERE_ORG.X_Y_Z]A_B.C".  On an ODS5 file
system, the file would be [.ftp^.anywhere^.org.x^.y^.z]a^.b.c".

------------------------------------------------------------------------

   The accompanying source kit suffers from storage on an ODS2 file
system, which does not preserve case or allow multiple dots in a file
name.  Building this kit should work on VMS,  but it may be expected to
fail on other systems.  To use this kit on a non-VMS system, the files
must be renamed to restore their original mixed-case names.

------------------------------------------------------------------------

   Steven M. Schweda               (+1) 651-699-9818  (voice)
   382 South Warwick Street        sms@antinode.org
   Saint Paul  MN  55105-2547

