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