1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189
|
/* header.doc (In English) */
Header structure used in LHa for UNIX Mar. 2, 1992, Masaru Oki.
(Translated by Osamu Aoki)
----------------------------------------------------------------
This version, as a transitional mreasure, uses level-1 as default value while
offering 3 types of header types. In the future, I plan to use level-2 which
has no limit on number of characters for the path mname.
A. Spec for header
Basic part
-----------------------------------------------------------------------------
level-0 level-1 level-2
-----------------------------------------------------------------------------
1 header size 1 header size 2 total header size
1 header sum 1 header sum
5 method ID 5 method ID 5 method ID
4 packed size 4 skip size 4 packed size
4 original size 4 original size 4 original size
2 time 2 time 4 time(UNIX type)
2 date 2 date
1 attribute 1 0x20 1 RESERVED
1 level 0x00 1 level 0x01 1 level 0x02
1 name length 1 name length
? pathname ? filename
2 file crc 2 file crc 2 file crc
. ........ 1 OS ID 'U' 1 OS ID 'U'
. ........
2 next-header size 2 next-header size
*************************************************************************
24 + ? 27 + ? 26
Extension part
-----------------------------------------------------------------------------
1 ext-type 1 ext-type
. ........ . ........
2 next-header size 2 next-header size
-----------------------------------------------------------------------------
a. Types of header
level-0 header
Same format as conventional LHarc, LArc. Separator for directory
name is '\' as default.
level-1 header
This header is used as default. Archive type -lh0 made with -x0 can
be unfrozen by LHarc but there will be no checking on CRC.
level-2 header
Header for supporting long file names. I would like to standarize
on this format in the future. Please follow this if you wish to
make utilities related ti LH.
b. method ID for freeze/unfreeze
* these methods are freeze/unfreeze, others are unfreeze only
-lh0- * no compression
-lh1- * 4k sliding dictionary(max 60 bytes) + dynamic Huffman
+ fixed encoding of position
-lh2- 8k sliding dictionary(max 256 bytes) + dynamic Huffman
-lh3- 8k sliding dictionary(max 256 bytes) + static Huffman
-lh4- * 4k sliding dictionary(max 256 bytes) + static Huffman
+ improved encoding of position and trees
-lh5- * 8k sliding dictionary(max 256 bytes) + static Huffman
+ improved encoding of position and trees
-lh6- 32k sliding dictionary(max 256 bytes) + static Huffman
+ improved encoding of position and trees
-lh7- 64k sliding dictionary(max 256 bytes) + static Huffman
+ improved encoding of position and trees
-lzs- 2k sliding dictionary(max 17 bytes)
-lz4- no compression
-lz5- 4k sliding dictionary(max 17 bytes)
c. About OS ID
Following OS ID are reserved.
MS-DOS 'M'
OS/2 '2'
OS9 '9'
OS/68K 'K'
OS/386 '3'
HUMAN 'H'
UNIX 'U'
CP/M 'C'
FLEX 'F'
Mac 'm'
Runser 'R'
B. Extension
a. OS independent (0x00 - 0x3f)
common header
1 0x00
2 header crc
( 1 information )
2 next-header size
filename header
1 0x01
? filename
2 next-header size
dirname header
1 0x02
? dirname
2 next-header size
comment header
1 0x3f
? comments
2 next-header size
(Above portion, from lhx.doc by Mr. Yoshizaki)
----------------------------------------------------------------
LHa for UNIX : specification for extension header
* Category of machine specific information (Information to be recorded)
Followings are UNIX specific information which requires to be recorded
(1) Permission
(2) GID,UID
(3) Group name, User name
(4) Last change time (UNIX time)
* Type of machine specific information (ext-type)
First 1 byte of extension header contain value to distinguish types of
the infoemation. Foe UNIX specific information, 0x50 - 0x54 will be
used.
* Method to store
Above categories (1) - (4) will be different type.
(1) Pemission
size value
1 0x50
2 Valur of permission
2 next-header size
(2)GID,UID
size value
1 0x51
2 GID
2 UID
2 next-header size
(3)-1 Group name
1 0x52
? Group name string
2 next-header size
(3)-2 user name
1 0x53
? User name string
2 next-header size
(4) Last change time (for header_level1)
1 0x54
4 UNIX time
2 next-header size
* Implimentation of LHa for UNIX ver 1.14 (Watazaki)
Above (3) is not supported
Group name and user name specified by (3) is not used to make an
archive thus ignored during expansion.
Also (4) is contained only in level-1 archive.
----------------------------------------------------------------
That's all folks :)
Partially modified by
Nobutaka Watazaki
watazaki@shimadzu.co.jp
|