home *** CD-ROM | disk | FTP | other *** search
/ The Original Shareware 1992 / TheOrigSharewareV1.cdr / 25 / arj200.exe / arj / TECHNOTE.DOC < prev    next >
Text File  |  1991-04-10  |  5KB  |  141 lines

  1.  
  2.     ARJ TECHNICAL INFORMATION                            March 1991
  3.  
  4.  
  5.     Modification history:
  6.     Date      Description of modification:
  7.     03/11/91  Added test_dirtype().  Added directory file type.
  8.     02/23/91  Added more comments.
  9.     02/19/91  Added get_line() function.
  10.     01/21/91  Added get_recd_size() function.
  11.     01/10/91  Corrected timestamp description and header order of file mode.
  12.     10/30/90  Corrected values of flags in ARJ flags.
  13.  
  14.  
  15.     ARJ archives contains two types of header blocks:
  16.  
  17.        Archive main header - This is located at the head of the archive
  18.        Local file header   - This is located before each archived file
  19.  
  20.     Structure of archive block (low order byte first):
  21.  
  22.     Bytes Description
  23.     ----- -------------------------------------------------------------------
  24.       2   header id (main and local file) = 0xEA60 or 60000U
  25.       2   basic header size (from 'first_hdr_size' thru 'comment' below)
  26.                 = first_hdr_size + strlen(filename) + 1 + strlen(comment) + 1
  27.                 = 0 if end of archive
  28.  
  29.       1   first_hdr_size (size up to and including 'extra data')
  30.       1   archiver version number
  31.       1   minimum archiver version to extract
  32.       1   host OS   (0 = MSDOS, 1 = PRIMOS, 2 = UNIX, 3 = AMIGA, 4 = MACDOS)
  33.       1   arj flags (0x01 = GARBLED_FLAG) indicates passworded file
  34.                     (0x02 = RESERVED)
  35.                     (0x04 = VOLUME_FLAG)  indicates continued file to next
  36.                                           volume
  37.                     (0x08 = EXTFILE_FLAG) indicates file starting position field
  38.                     (0x10 = PATHSYM_FLAG) indicates path translated
  39.                                           ("\" changed to "/")
  40.       1   method    (0 = stored, 1 = compressed most ... 4 compressed fastest)
  41.       1   file type (0 = binary, 1 = 7-bit text, 2 = comment header)
  42.                     (3 = directory)
  43.       1   reserved
  44.       4   date time modified
  45.       4   compressed size
  46.       4   original size (this will be different for text mode compression)
  47.       4   original file's CRC
  48.       2   filespec position in filename
  49.       2   file access mode
  50.       2   host data (currently not used)
  51.       ?   extra data
  52.           4 bytes for extended file position when used
  53.           (this is present when EXTFILE_FLAG is set)
  54.  
  55.       ?   filename (null-terminated string)
  56.       ?   comment  (null-terminated string)
  57.  
  58.       4   basic header CRC
  59.  
  60.       2   1st extended header size (0 if none)
  61.       ?   1st extended header (not currently used)
  62.       4   1st extended header's CRC
  63.       ...
  64.       ?   compressed file
  65.  
  66.  
  67.     Time stamp format:
  68.  
  69.        31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
  70.       |<---- year-1980 --->|<- month ->|<--- day ---->|
  71.  
  72.        15 14 13 12 11 10  9  8  7  6  5  4  3  2  1  0
  73.       |<--- hour --->|<---- minute --->|<- second/2 ->|
  74.  
  75.  
  76.  
  77.     Compression methods:
  78.  
  79.  
  80.     ARJ methods 1 to 3 use Lempel-Ziv 77 sliding window with static Huffman
  81.     encoding.
  82.  
  83.     ARJ method 4 uses Lempel-Ziv 77 sliding window with pointer/length
  84.     unary encoding.
  85.  
  86.     There is one decoder for methods 1 to 3 and one decoder for method 4.
  87.  
  88.  
  89.  
  90.     Encryption technology:
  91.  
  92.  
  93.     ARJ does NOT use DES encryption algorithms.  It uses a combination of
  94.     simple exclusive-or operations.
  95.  
  96.  
  97.  
  98.     Source code description:
  99.  
  100.  
  101.     ARJ is written in ANSI C using only ANSI C library calls.  All machine
  102.     dependent routines are located in an environment module. Simplified
  103.     versions allow porting to other operating systems with some loss of
  104.     functionality.  The current version has been compiled with TURBO C++
  105.     1.0.
  106.  
  107.     Data is stored in low-byte order first and read back the same way to
  108.     avoid the "endia" issue.
  109.  
  110.  
  111.  
  112.     The environment routines are:
  113.  
  114.  
  115.     case_path()       Uppercase pathname if case is not significant for OS
  116.     file_exists()     Check for file existence
  117.     fix_path()        Clean up file pathname (remove drive and root)
  118.     get_archive()     Get state of archive bit
  119.     get_disk_avail()  Get disk space availability
  120.     get_line()        Get STDIN line of text.
  121.     get_recd_size()   Get minimum disk record size
  122.     get_fsize()       Get file size (return -1 if getting size is too
  123.                       expensive)
  124.     get_ftime()       Get file date-time modified
  125.     get_fmode()       Get file access mode
  126.     get_mode_str()    Convert access mode to displayable text (A--W)
  127.     match_wild()      Provide filename component matching
  128.     reset_archive()   Reset archive bit
  129.     set_fmode()       Set file access mode
  130.     set_ftime()       Set file date-time modified
  131.     set_stream()      Set stream file translation mode.
  132.     test_ftype()      Test the output file type for valid flat file
  133.     test_dirtype()    Test the file for the directory type.
  134.     test_dir()        Test if file path exist.  If not, create it with
  135.                       permission.
  136.     wild_list()       Expand wildnames and recurse subdirectories if necessary
  137.  
  138.  
  139.     end of document
  140.  
  141.