Changes between Version 1 and Version 2 of Obsolete/MovedToTree/PackageManagement/FileFormat
- Timestamp:
- Nov 14, 2009, 7:42:34 AM (15 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Obsolete/MovedToTree/PackageManagement/FileFormat
v1 v2 2 2 = Haiku Package Format = 3 3 4 This document specifies the Haiku Package (HPKG) file format, which was designed for efficient use by Haiku's package file system. It is somewhat inspired by the [http://code.google.com/p/xar/ XAR format] (separate TOC and data heap), but aims for greater compactness (no tXML for the TOC).4 This document specifies the Haiku Package (HPKG) file format, which was designed for efficient use by Haiku's package file system. It is somewhat inspired by the [http://code.google.com/p/xar/ XAR format] (separate TOC and data heap), but aims for greater compactness (no XML for the TOC). 5 5 6 6 Three stacked format layers can be identified: … … 21 21 TOC (table of contents):: 22 22 The main section, containing structured data with references to unstructured 23 data in the Heap.23 data in the heap section. 24 24 Package Attributes:: 25 25 A section similar to the TOC. Rather than describing the data contained in … … 108 108 - "count" : int : 100 109 109 110 Attributes often share the same name and data type, particularly when a listof some kind are stored. In order to save space each unique name and data type pair is stored as an attribute type in a separate subsection and is referenced by an index.110 Attributes often share the same name and data type, particularly when lists of some kind are stored. In order to save space each unique name and data type pair is stored as an attribute type in a separate subsection and is referenced by an index. 111 111 112 112 A similar optimization exists for shared string attribute values. A string value used by more than one attribute is stored in the strings subsection and is referenced by an index as well. … … 150 150 Attribute value:: 151 151 The value of the attribute encoded as described below. 152 Attribute child list: 152 Attribute child list:: 153 153 Only if this attribute is marked to have children: A list of attribute 154 154 entries terminated by a 0 byte. … … 194 194 Has children:: 195 195 A uint8: non 0, if the attribute has children, 0 otherwise. 196 Attribute name: 196 Attribute name:: 197 197 A null-terminated UTF-8 string. 198 198 Attribute value:: 199 199 The value of the attribute encoded as described in the Main TOC section. 200 Attribute child list: 200 Attribute child list:: 201 201 Only if this attribute is marked to have children: A list of attribute 202 202 entries terminated by a 0 byte. … … 261 261 - B_HPKG_ATTRIBUTE_NAME_DATA: Only if the entry is a file: The file data. 262 262 - B_HPKG_ATTRIBUTE_NAME_SYMLINK_PATH: Only if the entry is a symlink: The path the symlink points to. 263 - B_HPKG_ATTRIBUTE_NAME_DIRECTORY_ENTRY: Only if the entry is a directory: The child entriesin that directory.263 - B_HPKG_ATTRIBUTE_NAME_DIRECTORY_ENTRY: Only if the entry is a directory: A child entry in that directory. 264 264 265 265 ==== B_HPKG_ATTRIBUTE_NAME_FILE_TYPE ("file:type") ==== … … 306 306 - '''Value:''' The nano seconds fraction of the file access time. 307 307 - '''Allowed Values:''' Any value in [0, 999999999]. 308 - '''Default Value:''' 0 308 309 - '''Child Attributes:''' none 309 310 … … 318 319 - '''Value:''' The nano seconds fraction of the file modified time. 319 320 - '''Allowed Values:''' Any value in [0, 999999999]. 321 - '''Default Value:''' 0 320 322 - '''Child Attributes:''' none 321 323 … … 330 332 - '''Value:''' The nano seconds fraction of the file creation time. 331 333 - '''Allowed Values:''' Any value in [0, 999999999]. 334 - '''Default Value:''' 0 332 335 - '''Child Attributes:''' none 333 336 … … 354 357 storing the data. 355 358 - B_HPKG_ATTRIBUTE_NAME_DATA_SIZE: The size of the uncompressed data. 359 - B_HPKG_ATTRIBUTE_NAME_DATA_CHUNK_SIZE: The size of an uncompressed data chunk. 356 360 357 361 ==== B_HPKG_ATTRIBUTE_NAME_DATA_COMPRESSION ("data:compression") ==== … … 374 378 ==== B_HPKG_ATTRIBUTE_NAME_DATA_CHUNK_SIZE ("data:chunk_size") ==== 375 379 - '''Type:''' uint 376 - '''Value:''' Size of a 380 - '''Value:''' Size of an uncompressed data chunk. 377 381 - '''Allowed Values:''': Any value. 378 382 - '''Default Value:''' … … 400 404 ==== B_HPKG_COMPRESSION_ZLIB ==== 401 405 402 The original data are split into equally sized chunks and compressed individually. The compressed data chunks are stored (in order) without padding, preceded by an uint64 array specifying the relative positions of the compressed data of each chunk. The positions are relative to the first byte following the position array. Since the first chunk is always at position 0, it's array element is omitted. Therefore a uncompressed data split into n chunks will have n - 1 position array elements. 406 The original data are split into equally sized chunks and compressed individually. The compressed data chunks are stored (in order) without padding, preceded by an uint64 array specifying the relative offsets of the compressed data of each chunk. The offsets are relative to the first byte following the offset array. Since the first chunk is always at offset 0, its array element is omitted. Therefore uncompressed data split into n chunks will have n - 1 offset array elements. 407 408 The size of the compressed chunks is implied by the offset differences (respectively for the last chunk the difference to the total size). A compressed chunk is always shorter than the uncompressed chunk. If the chunk data couldn't be compressed, the data are stored uncompressed and the size of the stored chunk will be equal to the uncompressed chunk size. 403 409 404 410