HA Format
Intel byte order

Information from File Format List 2.0 by Max Maischein.

--------!-CONTACT_INFO----------------------
If you notice any mistakes or omissions, please let me know!  It is only
with YOUR help that the list can continue to grow.  Please send
all changes to me rather than distributing a modified version of the list.

This file has been authored in the style of the INTERxxy.* file list
by Ralf Brown, and uses almost the same format.

Please read the file FILEFMTS.1ST before asking me any questions. You may find
that they have already been addressed.

         Max Maischein

Max Maischein, 2:244/1106.17
Max_Maischein@spam.fido.de
corion@informatik.uni-frankfurt.de
Corion on #coders@IRC
--------!-DISCLAIMER------------------------
DISCLAIMER:  THIS MATERIAL IS PROVIDED "AS IS".  I verify the information
contained in this list to the best of my ability, but I cannot be held
responsible for any problems caused by use or misuse of the information,
especially for those file formats foreign to the PC, like AMIGA or SUN file
formats. If an information it is marked "guesswork" or undocumented, you
should check it carefully to make sure your program will not break with
an unexpected value (and please let me know whether or not it works
the same way).

Information marked with "???" is known to be incomplete or guesswork.

Some file formats were not released by their creators, others are regarded
as proprietary, which means that if your programs deal with them, you might
be looking for trouble. I don't care about this.
--------------------------------------------

HA files (not to be confused with HamarSoft's HAP files [3]) contain a 
small archive header with a word count of the number of files in the 
archive. The constituent files stored sequentially with a header followed 
by the compressed data, as is with most archives.

The main file header is formatted as follows:
OFFSET              Count TYPE   Description
0000h                   2 char   ID='HA'
0002h                   1 word   Number of files in archive

Every compressed file has a header before it, like this :

OFFSET              Count TYPE   Description
0000h                   1 byte   Version & compression type
0001h                   1 dword  Compressed file size
0005h                   1 dword  Original file size
0009h                   1 dword  CCITT CRC-32 (same as ZModem/PkZIP)
000Dh                   1 dword  File time-stamp (Unix format)
   ?                    ? char   ASCIIZ pathname
   ?                    ? char   ASCIIZ filename
????h                   1 byte   Length of machine specific information
                        ? byte   Machine specific information

Note that the path separator for pathnames is the 0FFh (255) character.

The high nybble of the version & compression type field contains the
version information (0=HA 0.98), the low nybble is the compression type :

(Table 0012)
HA compression types
    0           "CPY"           File is stored (no compression)
    1           "ASC"           Default compression method, using a sliding
                                window dictionary with an arithmetic coder. 
    2           "HSC"           Compression using a "finite context [sic]
                                model and arithmetic coder"
   14           "DIR"           Directory entry
   15           "SPECIAL"       Used with HA 0.99B (?)
                   

Machine specific information known:
    
    1 byte      Machine type (Host-OS)

                        1 = MS DOS
                        2 = Linux (Unix)
    
    ? bytes     Information (currently only file-attribute info)

EXTENSION:HA
OCCURENCES:PC, Linux
PROGRAMS:HA
REFERENCE:
