xref: /trunk/main/filter/source/placeware/zipfile.hxx (revision 22e87013)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 /* Local file head offsets.  The header is followed by the filename and
25    possibly the extra field. */
26 #define zf_lfhSig		0
27 #define zf_lfhExVers		4
28 #define zf_lfhFlags		6
29 #define zf_lfhComp		8
30 #define zf_lfhModTime		10
31 #define zf_lfhModDate		12
32 #define zf_lfhCRC		14
33 #define zf_lfhCompSize		18
34 #define zf_lfhUncompSize	22
35 #define zf_lfhNameLen		26
36 #define zf_lfhExtraLen		28
37 #define zf_lfhSIZE		30 /* total size of header */
38 
39 /* We don't write data descriptors. */
40 
41 /* Central dir file header offsets.  Each entry is followed by the filename,
42    optional extra field, and file comment. */
43 #define zf_cdhSig		0
44 #define zf_cdhVers		4
45 #define zf_cdhExVers		6
46 #define zf_cdhFlags		8
47 #define zf_cdhComp		10
48 #define zf_cdhTime		12
49 #define zf_cdhDate		14
50 #define zf_cdhCRC		16
51 #define zf_cdhCompSize		20
52 #define zf_cdhUncompSize	24
53 #define zf_cdhNameLen		28
54 #define zf_cdhExtraLen		30
55 #define zf_cdhCommentLen	32
56 #define zf_cdhDiskNum		34
57 #define zf_cdhIFAttrs		36
58 #define zf_cdhEFAttrs		38
59 #define zf_cdhLHOffset		42
60 #define zf_cdhSIZE		46 /* total size of header */
61 
62 /* End of central dir record offsets.  It is followed by the zipfile
63    comment. */
64 #define zf_ecdSig		0
65 #define zf_ecdDiskNum		4
66 #define zf_ecdDirDiskNum	6
67 #define zf_ecdNumEntries	8
68 #define zf_ecdTotalEntries	10
69 #define zf_ecdDirSize		12
70 #define zf_ecdDirOffset		16
71 #define zf_ecdCommentLen	20
72 #define zf_ecdSIZE		22 /* total size */
73 
74 /* Magic constants to put in these structures. */
75 #define zf_LFHSIGValue		0x04034b50
76 #define zf_CDHSIGValue		0x02014b50
77 #define zf_ECDSIGValue		0x06054b50
78 
79 /* OS values for upper byte of version field. */
80 #define zf_osUnix		3
81 
82 /* Encode a major,minor version in a byte. */
83 #define zf_Vers(major,minor)	((major) * 10 + (minor))
84 
85 /* Compression values. */
86 #define zf_compNone		0
87 
88