home *** CD-ROM | disk | FTP | other *** search
/ Current Shareware 1994 January / SHAR194.ISO / dos_util / af126.zip / AF.INF < prev    next >
Text File  |  1993-08-10  |  27KB  |  758 lines

  1. ---------------------------------------------------------------------------
  2. Annexe à la documentation de AF.EXE
  3. ---------------------------------------------------------------------------
  4. Ce fichier contient la totalité des informations à ma disposition pour
  5. la création de ce programme. Il pourra vous être utile un jour, peut-être.
  6. ---------------------------------------------------------------------------
  7.  
  8.  
  9.  
  10.  
  11. -----------------------------
  12. ARJ - Extrait de TECHNOTE.DOC
  13. -----------------------------
  14.     ARJ archives contains two types of header blocks:
  15.  
  16.        Archive main header - This is located at the head of the archive
  17.        Local file header   - This is located before each archived file
  18.  
  19.     Structure of archive block (low order byte first):
  20.  
  21.     Bytes Description
  22.     ----- -------------------------------------------------------------------
  23.       2   header id (main and local file) = 0xEA60 or 60000U
  24.       2   basic header size (from 'first_hdr_size' thru 'comment' below)
  25.                 = first_hdr_size + strlen(filename) + 1 + strlen(comment) + 1
  26.                 = 0 if end of archive
  27.  
  28.       1   first_hdr_size (size up to and including 'extra data')
  29.       1   archiver version number
  30.       1   minimum archiver version to extract
  31.       1   host OS   (0 = MSDOS, 1 = PRIMOS, 2 = UNIX, 3 = AMIGA, 4 = MACDOS)
  32.       1   arj flags (0x01 = GARBLED_FLAG) indicates passworded file
  33.                     (0x02 = RESERVED)
  34.                     (0x04 = VOLUME_FLAG)  indicates continued file to next
  35.                                           volume
  36.                     (0x08 = EXTFILE_FLAG) indicates file starting position field
  37.                     (0x10 = PATHSYM_FLAG) indicates path translated
  38.                                           ("\" changed to "/")
  39.       1   method    (0 = stored, 1 = compressed most ... 4 compressed fastest)
  40.       1   file type (0 = binary, 1 = 7-bit text, 2 = comment header)
  41.                     (3 = directory)
  42.       1   reserved
  43.       4   date time modified
  44.       4   compressed size
  45.       4   original size (this will be different for text mode compression)
  46.       4   original file's CRC
  47.       2   filespec position in filename
  48.       2   file access mode
  49.       2   host data (currently not used)
  50.       ?   extra data
  51.           4 bytes for extended file position when used
  52.           (this is present when EXTFILE_FLAG is set)
  53.  
  54.       ?   filename (null-terminated string)
  55.       ?   comment  (null-terminated string)
  56.  
  57.       4   basic header CRC
  58.  
  59.       2   1st extended header size (0 if none)
  60.       ?   1st extended header (not currently used)
  61.       4   1st extended header's CRC
  62.       ...
  63.       ?   compressed file
  64.  
  65.  
  66.     Time stamp format:
  67.  
  68.        31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
  69.       |<---- year-1980 --->|<- month ->|<--- day ---->|
  70.  
  71.        15 14 13 12 11 10  9  8  7  6  5  4  3  2  1  0
  72.       |<--- hour --->|<---- minute --->|<- second/2 ->|
  73.  
  74.  
  75. ZIP - Extrait de AppNote.Txt
  76. ----------------------------
  77. General Format of a ZIP file
  78. ----------------------------
  79.  
  80.   Files stored in arbitrary order.  Large zipfiles can span multiple
  81.   diskette media.
  82.  
  83.   Overall zipfile format:
  84.  
  85.     [local file header+file data] . . .
  86.     [central directory] end of central directory record
  87.  
  88.  
  89.   A.  Local file header:
  90.  
  91.     local file header signature   4 bytes  (0x04034b50)
  92.     version needed to extract     2 bytes
  93.     general purpose bit flag      2 bytes
  94.     compression method            2 bytes
  95.     last mod file time            2 bytes
  96.     last mod file date            2 bytes
  97.     crc-32                        4 bytes
  98.     compressed size               4 bytes
  99.     uncompressed size             4 bytes
  100.     filename length               2 bytes
  101.     extra field length            2 bytes
  102.  
  103.     filename (variable size)
  104.     extra field (variable size)
  105.  
  106.  
  107.   B.  Central directory structure:
  108.  
  109.       [file header] . . .  end of central dir record
  110.  
  111.       File header:
  112.  
  113.     central file header signature    4 bytes  (0x02014b50)
  114.     version made by            2 bytes
  115.     version needed to extract    2 bytes
  116.     general purpose bit flag    2 bytes
  117.     compression method        2 bytes
  118.     last mod file time         2 bytes
  119.     last mod file date        2 bytes
  120.     crc-32               4 bytes
  121.     compressed size            4 bytes
  122.     uncompressed size        4 bytes
  123.     filename length            2 bytes
  124.     extra field length        2 bytes
  125.     file comment length        2 bytes
  126.      disk number start        2 bytes
  127.     internal file attributes    2 bytes
  128.     external file attributes    4 bytes
  129.     relative offset of local header    4 bytes
  130.  
  131.     filename (variable size)
  132.     extra field (variable size)
  133.     file comment (variable size)
  134.  
  135.       End of central dir record:
  136.  
  137.     end of central dir signature    4 bytes  (0x06054b50)
  138.     number of this disk        2 bytes
  139.     number of the disk with the
  140.     start of the central directory    2 bytes
  141.     total number of entries in
  142.     the central dir on this disk    2 bytes
  143.     total number of entries in
  144.     the central dir            2 bytes
  145.     size of the central directory   4 bytes
  146.     offset of start of central
  147.     directory with respect to
  148.     the starting disk number    4 bytes
  149.     zipfile comment length        2 bytes
  150.     zipfile comment (variable size)
  151.  
  152.  
  153.  
  154.  
  155.   C.  Explanation of fields:
  156.  
  157.       version made by
  158.  
  159.       The upper byte indicates the host system (OS) for the
  160.       file.  Software can use this information to determine
  161.       the line record format for text files etc.  The current
  162.       mappings are:
  163.  
  164.       0 - MS-DOS and OS/2 (F.A.T. file systems)
  165.       1 - Amiga    2 - VMS        3 - *nix    4 - VM/CMS
  166.       5 - Atari ST                  6 - OS/2 1.2 extended file systems
  167.       7 - Macintosh            8 thru 255 - unused
  168.  
  169.       The lower byte indicates the version number of the
  170.       software used to encode the file.  The value/10
  171.       indicates the major version number, and the value
  172.       mod 10 is the minor version number.
  173.  
  174.       version needed to extract
  175.  
  176.       The minimum software version needed to extract the
  177.       file, mapped as above.
  178.  
  179.       general purpose bit flag:
  180.  
  181.           bit 0: If set, indicates that the file is encrypted.
  182.           bit 1: If the compression method used was type 6,
  183.          Imploding, then this bit, if set, indicates
  184.          an 8K sliding dictionary was used.  If clear,
  185.          then a 4K sliding dictionary was used.
  186.           bit 2: If the compression method used was type 6,
  187.          Imploding, then this bit, if set, indicates
  188.          an 3 Shannon-Fano trees were used to encode the
  189.          sliding dictionary output.  If clear, then 2
  190.          Shannon-Fano trees were used.
  191.       Note:  Bits 1 and 2 are undefined if the compression
  192.          method is other than type 6 (Imploding).
  193.  
  194.           The upper three bits are reserved and used internally
  195.       by the software when processing the zipfile.  The
  196.       remaining bits are unused in version 1.0.
  197.  
  198.       compression method:
  199.  
  200.       (see accompanying documentation for algorithm
  201.       descriptions)
  202.  
  203.       0 - The file is stored (no compression)
  204.       1 - The file is Shrunk
  205.       2 - The file is Reduced with compression factor 1
  206.       3 - The file is Reduced with compression factor 2
  207.       4 - The file is Reduced with compression factor 3
  208.       5 - The file is Reduced with compression factor 4
  209.           6 - The file is Imploded
  210.  
  211.       date and time fields:
  212.  
  213.       The date and time are encoded in standard MS-DOS
  214.       format.
  215.  
  216.       CRC-32:
  217.  
  218.       The CRC-32 algorithm was generously contributed by
  219.       David Schwaderer and can be found in his excellent
  220.       book "C Programmers Guide to NetBIOS" published by
  221.       Howard W. Sams & Co. Inc.  The 'magic number' for
  222.       the CRC is 0xdebb20e3.  The proper CRC pre and post
  223.       conditioning is used, meaning that the CRC register
  224.       is pre-conditioned with all ones (a starting value
  225.       of 0xffffffff) and the value is post-conditioned by
  226.       taking the one's complement of the CRC residual.
  227.  
  228.       compressed size:
  229.       uncompressed size:
  230.  
  231.       The size of the file compressed and uncompressed,
  232.       respectively.
  233.  
  234.       filename length:
  235.       extra field length:
  236.       file comment length:
  237.  
  238.       The length of the filename, extra field, and comment
  239.       fields respectively.  The combined length of any
  240.       directory record and these three fields should not
  241.       generally exceed 65,535 bytes.
  242.  
  243.       disk number start:
  244.  
  245.       The number of the disk on which this file begins.
  246.  
  247.       internal file attributes:
  248.  
  249.       The lowest bit of this field indicates, if set, that
  250.       the file is apparently an ASCII or text file.  If not
  251.       set, that the file apparently contains binary data.
  252.       The remaining bits are unused in version 1.0.
  253.  
  254.       external file attributes:
  255.  
  256.       The mapping of the external attributes is
  257.       host-system dependent (see 'version made by').  For
  258.       MS-DOS, the low order byte is the MS-DOS directory
  259.       attribute byte.
  260.  
  261.       relative offset of local header:
  262.  
  263.       This is the offset from the start of the first disk on
  264.       which this file appears, to where the local header should
  265.       be found.
  266.  
  267.       filename:
  268.  
  269.       The name of the file, with optional relative path.
  270.       The path stored should not contain a drive or
  271.       device letter, or a leading slash.  All slashes
  272.       should be forward slashes '/' as opposed to
  273.       backwards slashes '\' for compatibility with Amiga
  274.       and Unix file systems etc.
  275.  
  276.       extra field:
  277.  
  278.       This is for future expansion.  If additional information
  279.       needs to be stored in the future, it should be stored
  280.       here.  Earlier versions of the software can then safely
  281.       skip this file, and find the next file or header.  This
  282.       field will be 0 length in version 1.0.
  283.  
  284.       In order to allow different programs and different types
  285.       of information to be stored in the 'extra' field in .ZIP
  286.       files, the following structure should be used for all
  287.       programs storing data in this field:
  288.  
  289.       header1+data1 + header2+data2 . . .
  290.  
  291.       Each header should consist of:
  292.  
  293.         Header ID - 2 bytes
  294.         Data Size - 2 bytes
  295.  
  296.       Note: all fields stored in Intel low-byte/high-byte order.
  297.  
  298.       The Header ID field indicates the type of data that is in
  299.       the following data block.
  300.  
  301.       Header ID's of 0 thru 31 are reserved for use by PKWARE.
  302.       The remaining ID's can be used by third party vendors for
  303.       proprietary usage.
  304.  
  305.  
  306.       The Data Size field indicates the size of the following
  307.       data block. Programs can use this value to skip to the
  308.       next header block, passing over any data blocks that are
  309.       not of interest.
  310.  
  311.       Note: As stated in the standard PKZIP application notes,
  312.         the size of the entire .ZIP file header, including the
  313.         filename, comment, and extra field should not exceed 64K
  314.         in size.
  315.  
  316.  
  317.       In case two different programs should appropriate the same
  318.       Header ID value, it is strongly recommended that each
  319.       program place a unique signature of at least two bytes in
  320.       size (and preferably 4 bytes or bigger) at the start of
  321.       each data area.  Every program should verify that it's
  322.       unique signature is present, in addition to the Header ID
  323.       value being correct, before assuming that it is a block of
  324.       known type.
  325.  
  326.  
  327.       file comment:
  328.  
  329.       The comment for this file.
  330.  
  331.  
  332.       number of this disk:
  333.  
  334.       The number of this disk, which contains central
  335.       directory end record.
  336.  
  337.       number of the disk with the start of the central directory:
  338.  
  339.       The number of the disk on which the central
  340.       directory starts.
  341.  
  342.       total number of entries in the central dir on this disk:
  343.  
  344.       The number of central directory entries on this disk.
  345.  
  346.       total number of entries in the central dir:
  347.  
  348.       The total number of files in the zipfile.
  349.  
  350.  
  351.       size of the central directory:
  352.  
  353.       The size (in bytes) of the entire central directory.
  354.  
  355.       offset of start of central directory with respect to
  356.       the starting disk number:
  357.  
  358.       Offset of the start of the central direcory on the
  359.       disk on which the central directory starts.
  360.  
  361.       zipfile comment length:
  362.  
  363.       The length of the comment for this zipfile.
  364.  
  365.       zipfile comment:
  366.  
  367.       The comment for this zipfile.
  368.  
  369.  
  370.   D.  General notes:
  371.  
  372.       1)  All fields unless otherwise noted are unsigned and stored
  373.       in Intel low-byte:high-byte, low-word:high-word order.
  374.  
  375.       2)  String fields are not null terminated, since the
  376.       length is given explicitly.
  377.  
  378.       3)  Local headers should not span disk boundries.  Also, even
  379.       though the central directory can span disk boundries, no
  380.       single record in the central directory should be split
  381.       across disks.
  382.  
  383.       4)  The entries in the central directory may not necessarily
  384.       be in the same order that files appear in the zipfile.
  385.  
  386.  
  387. --------------------------
  388. ARC - Extrait de PkPak.Doc
  389. --------------------------
  390.  
  391. The general format for an archive file is:
  392.  
  393. [[archive-mark + header_version + file header + file data]...] +
  394. archive-mark + end-of-arc-mark
  395.  
  396. The archive-mark is 1 byte and is the value 1A hex.  The file header
  397. can be defined by the following 'C' structure, and is 27 bytes in size.
  398. Note that this is a "packed" structure with fields aligned on odd-address
  399. boundries.
  400.  
  401. typedef struct archive_file_header
  402.   { char name[13];        /* file name */
  403.     unsigned long size;        /* size of compressed file */
  404.     unsigned short date;    /* file date */
  405.     unsigned short time;    /* file time */
  406.     unsigned short crc;        /* cyclic redundancy check */
  407.     unsigned long length;    /* size of uncompressed file */
  408.   };
  409.  
  410. The name field is the null terminated file name.
  411.  
  412. The size is the number of bytes in the file data area following the
  413. header.
  414.  
  415. The date and time are stored in the same packed format as a DOS
  416. directory entry.
  417.  
  418. The CRC is a 16-bit CRC on the file data area based on a CRC polynomial
  419. from the article by David Schwaderer in the April 1985 issue of PC
  420. Technical Journal.
  421.  
  422. The length is the actual uncompressed size of the file.
  423.  
  424. The header versions are defined as follows:
  425.  
  426. Value    Method        Notes
  427. -----    --------    -----------------------------------------------------
  428.   0      -        This is used to indicate the end of the archive.
  429.   1    Stored        (obsolete) (note 1)
  430.   2    Stored        The file is stored (no compression)
  431.   3    Packed        The file is packed with non-repeat packing.
  432.   4    Squeezed    The file is squeezed with standard Huffman squeezing.
  433.   5    crunched    The file was compressed with 12-bit static Ziv-Lempel-
  434.             Welch compression without non-repeat packing.
  435.   6    crunched    The file was compressed with 12-bit static Ziv-Lempel-
  436.             Welch compression with non-repeat packing.
  437.   7    crunched    (internal to SEA) same as above but with different
  438.             hashing formula.
  439.   8    Crunched    The file was compressed with Dynamic Ziv-Lempel-Welch
  440.             compression with non-repeat packing.  The initial
  441.             ZLW code size is 9-bits with a maximum code size
  442.             of 12-bits (note 2).  An adaptive reset is used
  443.             on the ZLW table when it becomes full.
  444.   9    Squashed    The file was compressed with Dynamic Ziv-Lempel-Welch
  445.             compression without non-repeat packing.  The initial
  446.             ZLW code size is 9-bits with a maximum code size
  447.             of 13-bits (note 3).  An adaptive reset is used
  448.             on the ZLW table when it becomes full.
  449.  
  450. Note 1:
  451.   For type 1 stored files, the file header is only 23 bytes in size,
  452.   with the length field not present.  In this case, the file length
  453.   is the same as the size field since the file is stored without
  454.   compression.
  455.  
  456. Note 2:
  457.   The first byte of the data area following the header is used to
  458.   indicate the maximum code size, however only a value of 12 (decimal)
  459.   is currently used or accepted by existing archive programs.
  460.  
  461. Note 3:
  462.   The algorithm used is identical to type 8 crunched files with the
  463.   exception that the maximum code size is 13 bits - i.e. an 8K entry
  464.   ZLW table.  However, unlike type 8 files, the first byte following
  465.   the file header is actual data, no maximum code size is stored.
  466.  
  467.  
  468.  
  469. ZOO - Extrait de PIBCATZ.PAS
  470. ----------------------------
  471.  
  472. (*----------------------------------------------------------------------*)
  473. (*                  Maps of ZOO file headers and entries                *)
  474. (*----------------------------------------------------------------------*)
  475.  
  476. CONST
  477.    PATHSIZE   = 256                  (* Max length of pathname *);
  478.    FNAMESIZE  = 13                   (* Size of DOS filename   *);
  479.    LFNAMESIZE = 256                  (* Size of long filename  *);
  480.    SIZ_TEXT   = 20                   (* Length of header text  *);
  481.    Valid_ZOO  = $FDC4A7DC            (* Valid ZOO tag          *);
  482.  
  483. TYPE
  484.    Header_Text_Type = ARRAY[ 1 .. SIZ_TEXT   ] OF CHAR;
  485.    FName_Type       = ARRAY[ 1 .. FNAMESIZE  ] OF CHAR;
  486.    LFname_Type      = ARRAY[ 1 .. LFNAMESIZE ] OF CHAR;
  487.    Path_Type        = ARRAY[ 1 .. PATHSIZE   ] OF CHAR;
  488.  
  489.                                    (* ZOO file header *)
  490.    ZOO_Header_Type =  RECORD
  491.                          Header_Text : Header_Text_Type     (* Character text      *);
  492.                          ZOO_Tag     : LONGINT              (* Identifies archives *);
  493.                          ZOO_Start   : LONGINT              (* Where data starts   *);
  494.                          ZOO_Minus   : LONGINT              (* Consistency check   *);
  495.                          ZOO_Major   : CHAR                 (* Major version #     *);
  496.                          ZOO_Minor   : CHAR                 (* Minor version #     *);
  497.                       END;
  498.                                    (* One entry in ZOO library *)
  499.                                    (* Fixed part of entry      *)
  500.    ZOO_Fixed_Type  =  RECORD
  501.                                    (* Fixed part of entry *)
  502.  
  503.                          ZOO_Tag     : LONGINT              (* Tag -- redundancy check *);
  504.                          ZOO_Type    : BYTE                 (* Type of directory entry *);
  505.                          Pack_Method : BYTE                 (* 0 = no packing, 1 = normal LZW *);
  506.                          Next        : LONGINT              (* Pos'n of next directory entry *);
  507.                          Offset      : LONGINT              (* Position of this file *);
  508.                          Date        : WORD                 (* DOS format date *);
  509.                          Time        : WORD                 (* DOS format time *);
  510.                          File_CRC    : WORD                 (* CRC of this file *);
  511.                          Org_Size    : LONGINT              (* Original file size *);
  512.                          Size_Now    : LONGINT              (* Compressed file size *);
  513.                          Major_Ver   : BYTE                 (* Version required to extract ... *);
  514.                          Minor_Ver   : BYTE                 (* this file (minimum)             *);
  515.                          Deleted     : BYTE                 (* Will be 1 if deleted, 0 if not *);
  516.                          Struc       : BYTE                 (* File structure if any *);
  517.                          Comment     : LONGINT              (* Points to comment;  zero if none *);
  518.                          Cmt_Size    : WORD                 (* Length of comment, 0 if none *);
  519.                          FName       : FName_Type           (* Filename *);
  520.  
  521.                          Var_Dir_Len : INTEGER              (* Length of variable part of dir entry *);
  522.                          Time_Zone   : BYTE                 (* Time zone where file was created *);
  523.                          Dir_CRC     : WORD                 (* CRC of directory entry *);
  524.  
  525.                       END;
  526.  
  527.                                    (* Variable part of entry *)
  528.  
  529.    ZOO_Varying_Type = ARRAY[1..4+PATHSIZE+LFNAMESIZE] OF CHAR;
  530.  
  531.                                    (* Varying field definitions follow  *)
  532.                                    (* for descriptive purposes.  Any or *)
  533.                                    (* all of these can be missing,      *)
  534.                                    (* depending upon the setting of     *)
  535.                                    (* Var_Dir_Len above and NamLen and  *)
  536.                                    (* DirLen here.                      *)
  537.  
  538.  
  539. LZH - Recherche personnelle
  540. ---------------------------
  541. Nbr  Oct  Signification
  542. ---  ---  -------------
  543.  1    1   ? Taille du Header - 3
  544.  1    2   ? CheckSum du Header
  545.  5    3   Algorithme utilisé de la forme -lhX- où X est le numéro de l'algo
  546.  4    8   Taille compressée
  547.  4   12   Taille normale
  548.  2   16   Heure
  549.  2   18   Date
  550.  1   20   Attribut du fichier
  551.  1   21   ? Niveau de Header
  552.  1   22   Longueur du nom du fichier
  553.  ?   23   Nom du fichier terminé par $00 (chaîne ASCIIZ)
  554.  
  555. Les significations précédées d'un '?' sont de pures supputations de ma
  556. part et n'engagent que moi, n'ayant qu'un vocabulaire Japonais très limité
  557. et un goût pour le langage C encore plus limité ;-) .
  558.  
  559.  
  560. SQZ - Tiré de TECH.ENG
  561. -------------------------------------------------------------------------------
  562. Archive header:
  563.     offset  0..4:   Id:     HLSQZ        (072d 076d 083d 081d 090d)
  564.         5:        Version:    1        (049d)
  565.         6:        OS:     76543210
  566.                 xxxxx000    0   PC-DOS
  567.                 xxxxx001    1   OS/2
  568.                 xxxxx010    2   MVS
  569.                 xxxxx011    3   HPSF(OS/2)
  570.                 xxxxx100    4   Amiga
  571.                 xxxxx101    5   Macintosh
  572.                 xxxxx110    6   *nix
  573.                 xxxxx111    7   Future use
  574.                 XXXXXxxx        Future use
  575.         7:        Flag    76543210
  576.                 xxxxxxxX        byte order
  577.                    0        Little Endian, Motorola order
  578.                    1        Big Endian, Intel order
  579.                 xxxxxxXx        Format for Data and time
  580.                   0        UNIX format. Number of seconds
  581.                         since 1:st of january 1970.
  582.                   1        DOS format for Date and Time
  583.                         in file: E8631E19.
  584.                         Decoded:    1992/08/30 12.31.32
  585.                         MSB             LSB
  586.                         19        1E        63        E8
  587.                         76543210765432107654321076543210
  588.                         00011001000111100110001111101000
  589.                         YYYYYYYMMMMDDDDDHHHHHMMMMMM22222
  590.                         12       8   30   12     31    16
  591.                         +=1980               *=2
  592.                         1992   08  30   12     31    32
  593.                 xxxxx1xx        Security Envelope
  594.                         No modifications allowed!
  595.                         If you do any thing, you'll ruin it
  596.                 xxxx1xxx        Whole archive encrypted! Keep OUT
  597.                         When I say whole, I mean WHOLE.
  598.                         There's nothing that you can do,
  599.                         just stay out of trouble.
  600.                         This archive can't be used until
  601.                         it's decrypted.
  602.                 xxx1xxxx        Unified data
  603.                 XXXxxxxx        Future use
  604.  
  605.  
  606. -------------------------------------------------------------------------------
  607. File header:
  608.  
  609.     offset  Size    Comment
  610.     0        1        Header size and type
  611.             0    ->  End of archive
  612.             1..18    Se below (Extra data)
  613.             19..    ->  normal file header
  614.             if normal file
  615.     1        1        Header algebraic sum  & 0FFh
  616.     0        1:76543210
  617.           xxxxXXXX    Method 0..4(15)
  618.           XXXXxxxx    Future use
  619.     1        4        Compressed size
  620.     5        4        Original size
  621.     9        4        Last DateTime
  622.     13        1        Attributes
  623.     14        4        CRC
  624.     18..    (size-18)    filename, w/o \0.
  625.  
  626.  
  627. -------------------------------------------------------------------------------
  628. How to read a SQZ-archive
  629.  
  630. Do
  631. If  > 18. Normal file
  632.     Read HeaderSum(1 byte)
  633.     Read size bytes
  634.     Calculate headersum
  635.     {short i; unsigned short s = 0U;
  636.     for(i = 0; i < size; i++)
  637.         s += header[i];
  638.     if(headersum != (unsigned char)s) WRONG HEADERSUM
  639.     header[size] = '\0';    // just to makes things easier to handle, ie.
  640.                 // zero terminate filename
  641.  
  642. If  == 0. End of archive. Terminate
  643.  
  644. If  <= 18. Extra data, se below
  645.     switch
  646.     case 1: COMMENT
  647.     case 2: PASSWORD
  648.     case 3: POSTFIX
  649.     case 4: SECURITY ENVELOPE
  650.     case 5: VOLUME LABEL
  651.     case 6: DIRECTORY
  652.     case 7: COMMENT, version 2
  653.     else    Read one word and then skip that many bytes.
  654.     end
  655.     Read one word (size)
  656.     skip that many bytes, if you don't know how to handle it.
  657.  
  658. while not End of archive
  659.  
  660.  
  661. -------------------------------------------------------------------------------
  662. Extra data
  663.  
  664.     00d     END_OF_ARC: Well, what's there to say?
  665.  
  666.     01d     COMMENT: Created by SQZ 1.08.2
  667.     0   2        Number of bytes in comment
  668.             Uncompressed size = this field - 7
  669.     2   2        Number of bytes compressed
  670.     4   1:76543210
  671.           xxxxXXXX    Method 0..4(15)
  672.           XXXXxxxx    Future use
  673.     5   4        CRC
  674.     9   size-7    Comment
  675.  
  676.  
  677.     02d     PASSWORD:
  678.     0   2        n
  679.     2   1    76543210
  680.         xxxxxxx1    Public
  681.         xxxxxx1x    Not public
  682.         xxxxx1xx    Signature included
  683.         XXXXXxxx    Future use
  684.     3   n-1
  685.         **************************************************************
  686.         I'm not done thinking about this one yet, so I'll be in touch.
  687.         I've been thinking and... see ya l'ter
  688.         **************************************************************
  689.  
  690.     03d     POSTFIX:    This code are among the last one in the archive (<256)
  691.     0   2        5
  692.     2   5        HLSQZ
  693.             Postfix are automatically added when closing a modified
  694.             archive, but, who knows, it might change in the future
  695.             so please check the last 256 bytes, just not the last
  696.             nine ones, 'cause who knows, someone might have been
  697.             using XModem...
  698.  
  699.     04d     SECURITY ENVELOPE:
  700.     0   2        n
  701.     2   2        SE version (major.minor.test.mask)0010
  702.         76543210
  703.         testmask
  704.         majomino
  705.     2   2        SE revision.
  706.     6   n-2     None of your business
  707.  
  708.     05d     VOLUME LABEL
  709.     0   2        Number of bytes
  710.     2   4        Time for creation of volume
  711.     6   1        Attribute, bit 3 always set (if DOS)
  712.     7   4        Serial number, if available, otherwise 00000000h
  713.        11   n        Label
  714.             Number of bytes - 9 -> length of label.
  715.  
  716.     06d     DIRECTORY
  717.     0   2        Number of bytes
  718.     2   1        Algebraic sum & 0xFF
  719.     3   4        Time for creation of directory
  720.     7   1        Attribute
  721.     8   n        Path
  722.             Number of bytes - 6 --> length of path
  723.  
  724.     07d     COMMENT: Created by SQZ 1.08.3 and later
  725.     0   2        Number of bytes in field
  726.             Compressed size = this field - 7
  727.     2   2        Number of uncompressed bytes
  728.     4   1:76543210
  729.           xxxxXXXX    Method 0..4(15)
  730.           XXXXxxxx    Future use
  731.     5   4        CRC
  732.     9   size-7    Comment
  733.  
  734.     ??d     OTHERWISE:
  735.     0   2        Number of bytes to skip
  736.  
  737.  
  738. -------------------------------------------------------------------------------
  739.  
  740. ---------------------------------------------------------------------
  741.  
  742. Je sais que la documentation des programmes ne doit pas être diffusée
  743. autrement que complète, mais j'espère que les différents auteurs ne
  744. me tiendront pas rigueur de cet écart.
  745.  
  746. I know that the documentations of programs sould not be cut in parts
  747. and distributed this way, but I hope that different authors will let me
  748. do it. Archive Finder is a public domain program and I don't win any
  749. money for writing it. The present file was made for my own use but I
  750. thought these condensed informations might help.
  751. If you are the author of one of the mentionned programs and you do not
  752. want this technical stuff to be present in this file, please let me know
  753. (real and virtual addresses are in file AF.ENG), I'll suppress it in
  754. future releases.
  755. Thank you.
  756.  
  757. ---------------------------------------------------------------------
  758.