xref: /haiku/src/bin/unzip/beos.h (revision 17049c451a91f427aec94b944b75876b611103e7)
1*17049c45SAxel Dörfler /*
2*17049c45SAxel Dörfler   Copyright (c) 1990-2000 Info-ZIP.  All rights reserved.
3*17049c45SAxel Dörfler 
4*17049c45SAxel Dörfler   See the accompanying file LICENSE, version 2000-Apr-09 or later
5*17049c45SAxel Dörfler   (the contents of which are also included in unzip.h) for terms of use.
6*17049c45SAxel Dörfler   If, for some reason, all these files are missing, the Info-ZIP license
7*17049c45SAxel Dörfler   also may be found at:  ftp://ftp.info-zip.org/pub/infozip/license.html
8*17049c45SAxel Dörfler */
9*17049c45SAxel Dörfler /* beos.h -- A few handy things for the BeOS port.     */
10*17049c45SAxel Dörfler /* (c) 1997 Chris Herborth (chrish@qnx.com)            */
11*17049c45SAxel Dörfler /* This is covered under the usual Info-ZIP copyright. */
12*17049c45SAxel Dörfler 
13*17049c45SAxel Dörfler /* "#define EF_BE_FL_UNCMPR 0x01" has been moved into unzpriv.h */
14*17049c45SAxel Dörfler #define EB_BE_FL_BADBITS    0xfe    /* bits currently undefined */
15*17049c45SAxel Dörfler 
16*17049c45SAxel Dörfler #define BEOS_ASSIGN_FILETYPE 1      /* call update_mime_info() */
17*17049c45SAxel Dörfler 
18*17049c45SAxel Dörfler /*
19*17049c45SAxel Dörfler DR9 'Be' extra-field layout:
20*17049c45SAxel Dörfler 
21*17049c45SAxel Dörfler 'Be'      - signature
22*17049c45SAxel Dörfler ef_size   - size of data in this EF (little-endian unsigned short)
23*17049c45SAxel Dörfler full_size - uncompressed data size (little-endian unsigned long)
24*17049c45SAxel Dörfler flag      - flags (byte)
25*17049c45SAxel Dörfler             flags & EB_BE_FL_UNCMPR     = the data is not compressed
26*17049c45SAxel Dörfler             flags & EB_BE_FL_BADBITS    = the data is corrupted or we
27*17049c45SAxel Dörfler                                           can't handle it properly
28*17049c45SAxel Dörfler data      - compressed or uncompressed file attribute data
29*17049c45SAxel Dörfler 
30*17049c45SAxel Dörfler If flag & EB_BE_FL_UNCMPR, the data is not compressed; this optimisation is
31*17049c45SAxel Dörfler necessary to prevent wasted space for files with small attributes (which
32*17049c45SAxel Dörfler appears to be quite common on the Advanced Access DR9 release).  In this
33*17049c45SAxel Dörfler case, there should be ( ef_size - EB_L_BE_LEN ) bytes of data, and full_size
34*17049c45SAxel Dörfler should equal ( ef_size - EB_L_BE_LEN ).
35*17049c45SAxel Dörfler 
36*17049c45SAxel Dörfler If the data is compressed, there will be ( ef_size - EB_L_BE_LEN ) bytes of
37*17049c45SAxel Dörfler compressed data, and full_size bytes of uncompressed data.
38*17049c45SAxel Dörfler 
39*17049c45SAxel Dörfler If a file has absolutely no attributes, there will not be a 'Be' extra field.
40*17049c45SAxel Dörfler 
41*17049c45SAxel Dörfler The uncompressed data is arranged like this:
42*17049c45SAxel Dörfler 
43*17049c45SAxel Dörfler attr_name\0 - C string
44*17049c45SAxel Dörfler struct attr_info (fields in big-endian format)
45*17049c45SAxel Dörfler attr_data (length in attr_info.size)
46*17049c45SAxel Dörfler */
47