REXX Tips & Tricks, Version 2.80


Inf-HTML [About][Toc][Index] 0.9b (c) 1995 Peter Childs


Unzip REXX DLL Documentation


Because the Unzip REXX DLL does not contain the documentation, I've 
included it here: 

UZDropFuncs 

Usage:

  call UZDropFuncs 

Description:

  Use this function to drop all the loaded UnZip functions.
  Once this function is processed by a REXX program, the 
  UnZip functions are not accessible in any OS/2 sessions.


UZLoadFuncs 

Usage:

  call UZLoadFuncs 

Description:

  Use this function to make all of the UnZip functions 
  in this package available to all OS/2 sessions.


UZFileTree 

Description:

  Finds all files in the specified ZIP with the specified 
  filespec and places their descriptions in a stem variable.

Usage:

  rc = UZFileTree( zipfile, stem, [include], [exclude], [options] ) 

Where:

  zipfile - Name of ZIP file to search 

  stem    - Name of the stem variable for results 
            Note: stem.0 contains the number 
            of files found.

  include - Optional stem variable specifying a list 
            of files (including wildcards) to include.
            stem.0 must indicate number of items.

  exclude - Optional stem variable specifying a list of 
            files (including wildcards) to exclude.
            stem.0 must indicate number of items.
            NOTE: If lists are not needed,
                  filespec strings may be passed.

  options - One of the following:
            'O' - Give file names only.  This is the default.
            'F' - Give file statistics in the form:
                  Length Date Time Name 
            'Z' - Also give ZIP statistics in the form:
                  Length Method Size Ratio Date Time CRC-32 Name 

Returns:

  0   Successful 
  2   Error.  Not enough memory.

Examples:

  /* Return a list of all .NDX files in pcboard.qwk */
  rc = UZFileTree( 'pcboard.qwk', 'stem.', '*.ndx' ) 

  /* Return a list of all files except *.NDX and *.DAT */
  exc.0 = 2; exc.1 = '*.ndx'; exc.2 = '*.dat'
  rc = UZFileTree( 'pcboard.qwk', 'stem.',,'exc.' ) 


UZUnZip 

Description:

  Provide a direct entry point to the command line interface.

Usage:

  rc = UZUnZip( 'parameters', [stem] ) 

Where:

  parameters - The entire list of parameters you would use from 
               the command-line

  stem       - The name of an optional stem variable where any 
               output should be redirected.
               NOTE: If a stem is not specified, all output will 
                     go to the console.

Returns:

  UnZip return code 


Examples:

  /* Test the archive 'unzip51s.zip' and return output in stem.*/
  rc = UZUnZip( '-t unzip51s.zip','stem.' ) 

  /* Extract the archive, display output on screen */
  call UZUnZip 'doom.zip'

  /* Extract all .NDX files from the archive */
  call UZUnZip 'pcboard.qwk *.ndx','stem.'


UZUnZipToVar 

Description:

  Unzip one file to a variable.

Usage:

  rc = UZUnZipToVar( 'zipfile', 'filename', [stem] ) 

Where:

  zipfile  - Name of ZIP file to search 

  filename - Name of file to extract from zipfile 

  stem     - Optional stem variable to extract the file to.
             If you specify a stem variable, the file will be extracted 
             to the variable, one line per index, stem.0 containing a 
             line count.  In this case, 0 will be returned in rc.
             If NO stem variable is specified, the entire file will be 
             extracted to rc.

Returns:

  If no stem variable is specified, rc contains the contents of 
  the extracted file if successful or an error-code if not.
  If a stem variable IS specified, rc contains 0 if successful.


UZUnZipToStem 

Description:

  Unzip files to a stem variable.

Usage:

  rc = UZUnZipToStem( zipfile, stem, [include], [exclude], [mode] ) 

Where:

  zipfile - Name of ZIP file to search 

  stem    - Stem variable used to store the extracted files 

  include - Optional stem variable specifying a list of files (including
            wildcards) to include.  stem.0 must indicate number of items.

  exclude - Optional stem variable specifying a list of files (including
            wildcards) to exclude.  stem.0 must indicate number of items.
            NOTE: If lists are not needed, filespec strings may be passed.

  mode    - Optional mode parameter specifies either 'F'lat (the default)
            or 'T'ree mode.

            -- In flat mode, each file is stored in stem.fullname i.e.
               stem.os2/dll/unzipapi.c.  A list of files is created in 
               stem.<index>

            -- In tree mode, slashes are converted to periods in the 
               pathname thus the above file would have been stored in 
               stem.OS2.DLL.unzipapi.c and an index stored for each 
               directory, i.e. stem.OS2.DLL.<index> = "unzipapi.c",
               stem.OS2.<index> = "DLL/", stem.<index> = "OS2/",

Example:

  Assuming a file unzip.zip containing:

    unzip.c, unshrink.c, extract.c,
    os2/makefile.os2, os2/os2.c
    os2/dll/dll.def, os2/dll/unzipapi.c

    rc = UZUnZipToStem( 'unzip.zip', 'stem.' ) 

    Returns:

      stem.0 = 7 
      stem.1 = unzip.c
      stem.2 = unshrink.c
      stem.3 = extract.c
      stem.4 = os2/makefile.os2
      stem.5 = os2/os2.c
      stem.6 = os2/dll/dll.def
      stem.7 = os2/dll/unzipapi.c

      And the following contain the contents of the 
      various files:

      stem.unzip.c
      stem.unshrink.c
      stem.extract.c
      stem.os2/makefile.os2
      stem.os2/os2.c
      stem.os2/dll/dll.def
      stem.os2/dll/unzipapi.c

    rc = UZUnZipToStem( 'unzip.zip', 'stem.',,,'TREE' ) 

    Returns:

      stem.0 = 4 
      stem.1 = unzip.c
      stem.2 = unshrink.c
      stem.3 = extract.c
      stem.4 = OS2/
      stem.OS2.0 = 3 
      stem.OS2.1 = makefile.os2
      stem.OS2.2 = os2.c
      stem.OS2.3 = DLL/
      stem.OS2.DLL.0 = 2 
      stem.OS2.DLL.1 = def 
      stem.OS2.DLL.2 = unzipapi.c

      And the following contain the contents of the 
      various programs:

      stem.unzip.c
      stem.unshrink.c
      stem.extract.c
      stem.OS2.makefile.os2
      stem.OS2.os2.c
      stem.OS2.DLL.dll.def
      stem.OS2.DLL.unzipapi.c


UZVer 

Description:

  Returns the version number of UnZip.

Usage:

  rc = UZVer( [option] ) 

Returns:

  String containing UnZip version info in the form 'x.xx'
  If option is 'L' then info is in the form 'x.xx of <date>'


UZAPIVer 

Description:

  Returns the version number of the API.

Usage:

  rc = UZAPIVer( [option] ) 

Returns:

  String containing API version info in the form 'x.xx'
  If option is 'L' then info is in the form 'x.xx of <date>'

  

Inf-HTML End Run - Successful