home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 35 Internet / 35-Internet.zip / srev13g.zip / UNZIPAPI.DOC < prev    next >
Text File  |  1998-04-17  |  8KB  |  192 lines

  1. 15 Apr 1998
  2.  
  3. This contains an error-ridden description of UNZIPAPI.DLL.
  4. I've found that in some places where a "stem" variable is
  5. claimed to be needed, you have to use a string instead.
  6. And unziptovar chokes when a file name contains a &.
  7.  
  8. But it's free, so we should be nice.
  9.  
  10. By the way, the sites for the INFO-Zip project (from
  11. whence this hailed) are:
  12.    http://quest.jpl.nasa.gov/Info-ZIP/ 
  13.    ftp://ftp.uu.net/pub/archiving/zip/ 
  14.  
  15. Hint: You might want to consider using the SREF_GZIP and
  16.       SREF_UNGZIP macrospace procedures (that use the GZIP
  17.       program now packaged with SRE-http).
  18.  
  19. -------------------------------------------------------
  20.  
  21. ZDropFuncs
  22.   Use this function to drop all the loaded UnZip functions.
  23.   Once this function is processed by a REXX program, the 
  24.   UnZip functions are not accessible in any OS/2 sessions.  
  25.   
  26. UZLOADFUNCS  
  27.    call UZLoadFuncs
  28.  
  29.                Use this function to make all of the UnZip functions
  30.                in this package available to all OS/2 sessions.
  31.           Example:    call RxFuncAdd 'UZLoadFuncs', 'UNZIPAPI', 'UZLoadFuncs' 
  32.   
  33. UZFILETREE   
  34.    rc = UZFileTree(zipfile, stem, [include], [exclude], [options])  
  35.  
  36.         zipfile    - Name of ZIP file to search 
  37.         stem    - Name of the stem variable for results 
  38.                   Note: stem.0 contains the number of files found.
  39.         include - Optional stem variable specifying a list of files (including 
  40.                   wildcards) to include.  stem.0 must indicate number of items. 
  41.                   exclude - Optional stem variable specifying a list of files 
  42.                   (including  wildcards) to exclude.  
  43.                   stem.0 must indicate number of items.
  44.                NOTE: If lists are not needed, filespec strings may be passed.
  45.         options - One of the following:
  46.                    'O' - Give file names only.  This is the default. 
  47.                    'F' - Give file statistics in the form: 
  48.                               "Length Date Time Name 
  49.                    'Z' - Also give ZIP statistics in the form: 
  50.                             "Length Method Size Ratio Date Time CRC-32 Name
  51.  
  52.      Finds all files in the specified ZIP with the specified
  53.         filespec and places their descriptions in a stem variable.  
  54.         rc:    Return codes 
  55.                 0    Successful 
  56.                 2    Error.  Not enough memory.  
  57.         Examples: 
  58.                 /*Return a list of all .NDX files in pcboard.qwk*/
  59.                  rc = UZFileTree('pcboard.qwk', 'stem.', '*.ndx')
  60.                 /* Return a list of all files except *.NDX and *.DAT */
  61.                 exc.0 = 2; exc.1 = '*.ndx'; exc.2 = '*.dat' 
  62.                 rc = UZFileTree('pcboard.qwk', 'stem.',,'exc.')  
  63.   
  64. UZUNZIP
  65.        rc = UZUnZip('parameters', [stem])  
  66.  
  67.                 parameters    - The entire list of parameters you would use from 
  68.                                   the command-line 
  69.                 stem        - The name of an optional stem variable where any 
  70.                                   output should be redirected. 
  71.                           NOTE: If a stem is not specified, all output will 
  72.                                 go to the console.
  73.  Provide a direct entry point to the command line interface.  
  74.     rc:    UnZip return code  
  75.     Examples:    /* Test the archive 'unzip51s.zip' and return output in stem.*/
  76.                 rc = UZUnZip('-t unzip51s.zip','stem.')
  77.                /* Extract the archive, display output on screen */
  78.                call UZUnZip 'doom.zip' 
  79.                         /* Extract all .NDX files from the archive  */
  80.                         call UZUnZip 'pcboard.qwk *.ndx','stem.'  
  81.   
  82. UZUNZIPTOVAR 
  83.  
  84.      rc = UZUnZipToVar('zipfile', 'filename', [stem])  
  85.                 zipfile     - Name of ZIP file to search 
  86.                 filename - Name of file to extract from zipfile 
  87.                 stem     - Optional stem variable to extract the file to. 
  88.                            If you specify a stem variable, the file will be 
  89.                            extracted to the variable, one line per index, 
  90.                            stem.0 containing a line count.  
  91.                            In this case, 0 will be returned in rc.
  92.                            If NO stem variable is specified, the entire file   
  93.                            will be extracted to rc.
  94.            Unzip one file to a variable.  
  95.     rc:    If no stem variable is specified, rc contains the contents of 
  96.         the extracted file if successful or an error-code if not. 
  97.         If a stem variable IS specified, rc contains 0 if successful. 
  98.   
  99. UZUNZIPTOSTEM
  100.  
  101.   rc = UZUnZipToStem(zipfile, stem, [include], [exclude], [mode]) 
  102.  
  103.     zipfile  - Name of ZIP file to search
  104.     stem    - Stem variable used to store the extracted files 
  105.     include - Optional stem variable specifying a list of files (including 
  106.           wildcards) to include.  stem.0 must indicate number of items. 
  107.     exclude - Optional stem variable specifying a list of files (including 
  108.           wildcards) to exclude.  stem.0 must indicate number of items. 
  109.         NOTE: If lists are not needed, filespec strings may be passed. 
  110.     mode    - Optional mode parameter specifies either 'F'lat (the default) 
  111.           or 'T'ree mode. 
  112.         -- In flat mode, each file is stored in stem.fullname i.e. 
  113.            stem.os2/dll/unzipapi.c.  A list of files is created in 
  114.            stem.<index> 
  115.         -- In tree mode, slashes are converted to periods in the 
  116.            pathname thus the above file would have been stored in 
  117.            stem.OS2.DLL.unzipapi.c and an index stored for each 
  118.            directory, i.e. stem.OS2.DLL.<index> = \"unzipapi.c\", 
  119.            stem.OS2.<index> = \"DLL/\", stem.<index> = \"OS2/\"",
  120.            "Unzip files to a stem variable.  
  121.     Example:    Assuming a file unzip.zip containing: 
  122.               unzip.c, unshrink.c, extract.c, 
  123.               os2/makefile.os2, os2/os2.c 
  124.               os2/dll/dll.def, os2/dll/unzipapi.c  
  125.         rc = UZUnZipToStem('unzip.zip', 'stem.') 
  126.         Returns:    stem.0 = 7 
  127.                 stem.1 = unzip.c 
  128.                 stem.2 = unshrink.c 
  129.                 stem.3 = extract.c 
  130.                 stem.4 = os2/makefile.os2 
  131.                 stem.5 = os2/os2.c 
  132.                 stem.6 = os2/dll/dll.def 
  133.                 stem.7 = os2/dll/unzipapi.c 
  134.             And the following contain the contents of the 
  135.             various files: 
  136.                 stem.unzip.c 
  137.                 stem.unshrink.c 
  138.                 stem.extract.c 
  139.                 stem.os2/makefile.os2 
  140.                 stem.os2/os2.c 
  141.                 stem.os2/dll/dll.def 
  142.                 stem.os2/dll/unzipapi.c  
  143.         rc = UZUnZipToStem('unzip.zip', 'stem.',,,'TREE') 
  144.         Returns:    stem.0 = 4 
  145.             stem.1 = unzip.c 
  146.             stem.2 = unshrink.c 
  147.             stem.3 = extract.c 
  148.             stem.4 = OS2/ 
  149.             stem.OS2.0 = 3 
  150.             stem.OS2.1 = makefile.os2 
  151.             stem.OS2.2 = os2.c 
  152.             stem.OS2.3 = DLL/ 
  153.             stem.OS2.DLL.0 = 2 
  154.             stem.OS2.DLL.1 = def 
  155.             stem.OS2.DLL.2 = unzipapi.c 
  156.  
  157.         And the following contain the contents of the 
  158.         various programs: 
  159.             stem.unzip.c 
  160.             stem.unshrink.c 
  161.             stem.extract.c 
  162.             stem.OS2.makefile.os2 
  163.             stem.OS2.os2.c 
  164.             stem.OS2.DLL.dll.def 
  165.             stem.OS2.DLL.unzipapi.c  },
  166.  
  167. UZVer  
  168.     rc = UZVer([option])  
  169.         rc    String containing UnZip version info in the form 'x.xx'
  170.             If option is 'L' then info is in the form 'x.xx of <date>
  171.     Returns the version number of UnZip  
  172.  
  173. UZAPIVER  
  174.       rc = UZAPIVer([option])  
  175.         rcString containing API version info in the form 'x.xx' 
  176.                 If option is 'L' then info is in the form 'x.xx of <date>
  177.         Returns the version number of the API  
  178.  
  179.  
  180. REXX functions:
  181.   UZDropFuncs     -- Makes all functions in this package unknown to REXX 
  182.   UZLoadFuncs     -- Makes all functions in this package known to REXX 
  183.   UZFileTree      -- Searches for files matching a given filespec 
  184.   UZUnZip      -- UnZip command-line entry point 
  185.   UZUnZipToVar    -- Unzip one file to a variable 
  186.   UZUnZipToStem   -- Unzip files to a variable array 
  187.   UZVer           -- Returns the UnZip version number 
  188.   UZAPIVer        -- Returns the API version number 
  189.  
  190.  
  191. #endif
  192.