OSDN Git Service

Merge pull request #11 from yoheie/fix_path_compare
[lha/lha.git] / header.doc.jp
1 /* header.doc (In Japanese) */
2 LHa for UNIX で使用されるヘッダ構造について      Mar. 2, 1992, Masaru Oki.
3
4 ----------------------------------------------------------------
5     本バージョンでは過渡的な措置として3種類のヘッダ形式を用意し、level-1
6   を既定値としていますが、将来的にはパス名の文字数に制限のない level-2に
7   統一する方針です。
8
9
10   A. ヘッダの仕様
11
12 -----------------------------------------------------------------------------
13         level-0                 level-1                 level-2
14 -----------------------------------------------------------------------------
15       1 header size           1 header size           2 total header size
16       1 header sum            1 header sum
17       5 method ID             5 method ID             5 method ID
18 基    4 packed size           4 skip size             4 packed size
19       4 original size         4 original size         4 original size
20 本    2 time                  2 time                  4 time(UNIX type)
21       2 date                  2 date
22 部    1 attribute             1 0x20                  1 RESERVED
23       1 level 0x00            1 level 0x01            1 level 0x02
24 分    1 name length           1 name length
25       ? pathname              ? filename
26       2 file crc              2 file crc              2 file crc
27       . ........              1 OS ID 'U'             1 OS ID 'U'
28                               . ........
29                               2 next-header size      2 next-header size
30     *************************************************************************
31      24 + ?                  27 + ?                  26
32 -----------------------------------------------------------------------------
33 拡                            1 ext-type              1 ext-type
34 張                            . ........              . ........
35 部                            2 next-header size      2 next-header size
36
37 -----------------------------------------------------------------------------
38
39     a. ヘッダの種類
40
41       level-0 ヘッダ
42           従来の LHarc, LArc と同じ形式です。ディレクトリ名の区切りは '\'
43         を標準としています。
44
45       level-1 ヘッダ
46           既定値でこのヘッダが作成されます。-x0 で作成された -lh0- の書庫
47         は LHarc で解凍可能ですが、解凍時に CRC チェックは行われません。
48
49       level-2 ヘッダ
50           長いファイル名をサポートするためのヘッダです。将来的には本ヘッ
51         ダを標準としたいので、LH 関連のユーティリティを作成される方は今後
52         準拠してくださるようにお願いします。
53
54     b. 凍結・解凍可能な method ID について
55
56       * は作成可能な method
57
58       -lh0- * no compression
59
60       -lh1- * 4k sliding dictionary(max 60 bytes) + dynamic Huffman
61               + fixed encoding of position
62
63       -lh2-   8k sliding dictionary(max 256 bytes) + dynamic Huffman
64
65       -lh3-   8k sliding dictionary(max 256 bytes) + static Huffman
66
67       -lh4- * 4k sliding dictionary(max 256 bytes) + static Huffman
68               + improved encoding of position and trees
69
70       -lh5- * 8k sliding dictionary(max 256 bytes) + static Huffman
71               + improved encoding of position and trees
72
73       -lh6-   32k sliding dictionary(max 256 bytes) + static Huffman
74                           + improved encoding of position and trees
75
76       -lh7-   64k sliding dictionary(max 256 bytes) + static Huffman
77                           + improved encoding of position and trees
78
79       -lzs-   2k sliding dictionary(max 17 bytes)
80
81       -lz4-   no compression
82
83       -lz5-   4k sliding dictionary(max 17 bytes)
84
85     c. OS ID について
86
87       現在のところ、以下の ID を予約しています。
88
89         MS-DOS  'M'
90         OS/2    '2'
91         OS9     '9'
92         OS/68K  'K'
93         OS/386  '3'
94         HUMAN   'H'
95         UNIX    'U'
96         CP/M    'C'
97         FLEX    'F'
98         Mac     'm'
99         Runser  'R'
100
101   B. 拡張部分
102
103     a. OS 非依存 (0x00 - 0x3f)
104
105         common header
106          1 0x00
107          2 header crc
108        ( 1 information )
109          2 next-header size
110
111         filename header
112          1 0x01
113          ? filename
114          2 next-header size
115
116         dirname header
117          1 0x02
118          ? dirname
119          2 next-header size
120
121         comment header
122          1 0x3f
123          ? comments
124          2 next-header size
125
126 (以上、吉崎氏の lhx.doc より)
127 ----------------------------------------------------------------
128 LHa for UNIX 拡張ヘッダ仕様
129
130 ・依存情報の種類(格納すべき情報)
131         UNIX に依存する情報で記録すべきは以下のものである。
132         (1) パーミッション
133         (2) GID,UID
134         (3) グループ名、ユーザ名
135         (4) 最終変更時刻(UNIX time)
136
137 ・依存情報のタイプ(ext-type)
138           拡張ヘッダの先頭1バイトには情報が何を示すもの
139         か識別するための値が格納されている。
140         UNIX依存情報として 0x50 - 0x54 を使用する。
141
142 ・依存情報の格納方法
143         上記 (1) - (4) をそれぞれ別のタイプとする。
144
145         (1)パーミッション
146                 size    値
147                 1       0x50
148                 2       パーミッション値
149                 2       next-header size
150
151         (2)GID,UID
152                 size    値
153                 1       0x51
154                 2       GID
155                 2       UID
156                 2       next-header size
157
158         (3)-1 グループ名
159                 1       0x52
160                 ?       グループ名文字列
161                 2       next-header size
162
163         (3)-2 ユーザ名
164                 1       0x53
165                 ?       ユーザ名文字列
166                 2       next-header size
167
168         (4) 最終変更時刻 (for header_level1)
169                 1       0x54
170                 4       UNIX 時間
171                 2       next-header size
172
173 ・LHa for UNIX ver 1.14 での実装(綿崎)
174         上記(3)をサポートしていない。
175         (3)のグループ名、ユーザ名の情報を含む書庫を作成すること
176         はなく、展開時には無視する。
177         また、(4)はヘッダレベル1の書庫にのみ含まれる。
178
179         (3) を作成するようにしてみました。展開と一覧表示のときに (3) 
180         の情報があれば ID に優先します。
181         作成は configure オプション --enable-user-name-header を指定して
182         build したときに有効になります。(2002-06-04 新井)
183
184 ----------------------------------------------------------------
185 以上。
186
187 一部改変:
188 綿崎 修隆 (Nobutaka Watazaki)
189 watazaki@shimadzu.co.jp