summaryrefslogtreecommitdiff
path: root/utils/rbutilqt/mspack/chm.h
diff options
context:
space:
mode:
Diffstat (limited to 'utils/rbutilqt/mspack/chm.h')
-rw-r--r--utils/rbutilqt/mspack/chm.h122
1 files changed, 122 insertions, 0 deletions
diff --git a/utils/rbutilqt/mspack/chm.h b/utils/rbutilqt/mspack/chm.h
new file mode 100644
index 0000000000..4b19f1505a
--- /dev/null
+++ b/utils/rbutilqt/mspack/chm.h
@@ -0,0 +1,122 @@
1/* This file is part of libmspack.
2 * (C) 2003-2004 Stuart Caie.
3 *
4 * libmspack is free software; you can redistribute it and/or modify it under
5 * the terms of the GNU Lesser General Public License (LGPL) version 2.1
6 *
7 * For further details, see the file COPYING.LIB distributed with libmspack
8 */
9
10#ifndef MSPACK_CHM_H
11#define MSPACK_CHM_H 1
12
13#include "lzx.h"
14
15/* generic CHM definitions */
16
17#define chmhead_Signature (0x0000)
18#define chmhead_Version (0x0004)
19#define chmhead_HeaderLen (0x0008)
20#define chmhead_Unknown1 (0x000C)
21#define chmhead_Timestamp (0x0010)
22#define chmhead_LanguageID (0x0014)
23#define chmhead_GUID1 (0x0018)
24#define chmhead_GUID2 (0x0028)
25#define chmhead_SIZEOF (0x0038)
26
27#define chmhst_OffsetHS0 (0x0000)
28#define chmhst_LengthHS0 (0x0008)
29#define chmhst_OffsetHS1 (0x0010)
30#define chmhst_LengthHS1 (0x0018)
31#define chmhst_SIZEOF (0x0020)
32#define chmhst3_OffsetCS0 (0x0020)
33#define chmhst3_SIZEOF (0x0028)
34
35#define chmhs0_Unknown1 (0x0000)
36#define chmhs0_Unknown2 (0x0004)
37#define chmhs0_FileLen (0x0008)
38#define chmhs0_Unknown3 (0x0010)
39#define chmhs0_Unknown4 (0x0014)
40#define chmhs0_SIZEOF (0x0018)
41
42#define chmhs1_Signature (0x0000)
43#define chmhs1_Version (0x0004)
44#define chmhs1_HeaderLen (0x0008)
45#define chmhs1_Unknown1 (0x000C)
46#define chmhs1_ChunkSize (0x0010)
47#define chmhs1_Density (0x0014)
48#define chmhs1_Depth (0x0018)
49#define chmhs1_IndexRoot (0x001C)
50#define chmhs1_FirstPMGL (0x0020)
51#define chmhs1_LastPMGL (0x0024)
52#define chmhs1_Unknown2 (0x0028)
53#define chmhs1_NumChunks (0x002C)
54#define chmhs1_LanguageID (0x0030)
55#define chmhs1_GUID (0x0034)
56#define chmhs1_Unknown3 (0x0044)
57#define chmhs1_Unknown4 (0x0048)
58#define chmhs1_Unknown5 (0x004C)
59#define chmhs1_Unknown6 (0x0050)
60#define chmhs1_SIZEOF (0x0054)
61
62#define pmgl_Signature (0x0000)
63#define pmgl_QuickRefSize (0x0004)
64#define pmgl_Unknown1 (0x0008)
65#define pmgl_PrevChunk (0x000C)
66#define pmgl_NextChunk (0x0010)
67#define pmgl_Entries (0x0014)
68#define pmgl_headerSIZEOF (0x0014)
69
70#define pmgi_Signature (0x0000)
71#define pmgi_QuickRefSize (0x0004)
72#define pmgi_Entries (0x0008)
73#define pmgi_headerSIZEOF (0x000C)
74
75#define lzxcd_Length (0x0000)
76#define lzxcd_Signature (0x0004)
77#define lzxcd_Version (0x0008)
78#define lzxcd_ResetInterval (0x000C)
79#define lzxcd_WindowSize (0x0010)
80#define lzxcd_CacheSize (0x0014)
81#define lzxcd_Unknown1 (0x0018)
82#define lzxcd_SIZEOF (0x001C)
83
84#define lzxrt_Unknown1 (0x0000)
85#define lzxrt_NumEntries (0x0004)
86#define lzxrt_EntrySize (0x0008)
87#define lzxrt_TableOffset (0x000C)
88#define lzxrt_UncompLen (0x0010)
89#define lzxrt_CompLen (0x0018)
90#define lzxrt_FrameLen (0x0020)
91#define lzxrt_Entries (0x0028)
92#define lzxrt_headerSIZEOF (0x0028)
93
94/* CHM compression definitions */
95
96struct mschm_compressor_p {
97 struct mschm_compressor base;
98 struct mspack_system *system;
99 char *temp_file;
100 int use_temp_file;
101 int error;
102};
103
104/* CHM decompression definitions */
105struct mschmd_decompress_state {
106 struct mschmd_header *chm; /* CHM file being decompressed */
107 off_t offset; /* uncompressed offset within folder */
108 off_t inoffset; /* offset in input file */
109 struct lzxd_stream *state; /* LZX decompressor state */
110 struct mspack_system sys; /* special I/O code for decompressor */
111 struct mspack_file *infh; /* input file handle */
112 struct mspack_file *outfh; /* output file handle */
113};
114
115struct mschm_decompressor_p {
116 struct mschm_decompressor base;
117 struct mspack_system *system;
118 struct mschmd_decompress_state *d;
119 int error;
120};
121
122#endif