Diffstat (limited to 'noncore/apps/opie-reader/ztxt.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/opie-reader/ztxt.h | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/noncore/apps/opie-reader/ztxt.h b/noncore/apps/opie-reader/ztxt.h index 7be45c0..20558a6 100644 --- a/noncore/apps/opie-reader/ztxt.h +++ b/noncore/apps/opie-reader/ztxt.h | |||
@@ -1,29 +1,29 @@ | |||
1 | #ifndef __ztxt_h | 1 | #ifndef __ztxt_h |
2 | #define __ztxt_h | 2 | #define __ztxt_h |
3 | 3 | ||
4 | #include "CExpander.h" | 4 | #include "CExpander.h" |
5 | #include <zlib.h> | 5 | #include "zlib/zlib.h" |
6 | #include "pdb.h" | 6 | #include "pdb.h" |
7 | /* | 7 | /* |
8 | * Stuff common to both Weasel Reader and makeztxt | 8 | * Stuff common to both Weasel Reader and makeztxt |
9 | * | 9 | * |
10 | * $Id$ | 10 | * $Id$ |
11 | * | 11 | * |
12 | */ | 12 | */ |
13 | 13 | ||
14 | #ifndef _WEASEL_COMMON_H_ | 14 | #ifndef _WEASEL_COMMON_H_ |
15 | #define _WEASEL_COMMON_H_ 1 | 15 | #define _WEASEL_COMMON_H_ 1 |
16 | 16 | ||
17 | 17 | ||
18 | /* Padding is no good */ | 18 | /* Padding is no good */ |
19 | #if defined(__GNUC__) && defined(__UNIX__) | 19 | #if defined(__GNUC__) && defined(__UNIX__) |
20 | # pragma pack(2) | 20 | # pragma pack(2) |
21 | #endif | 21 | #endif |
22 | 22 | ||
23 | /* The default creator is Weasel Reader 'GPlm' */ | 23 | /* The default creator is Weasel Reader 'GPlm' */ |
24 | #define GPLM_CREATOR_ID "GPlm" | 24 | #define GPLM_CREATOR_ID "GPlm" |
25 | /* Databases of type 'zTXT' */ | 25 | /* Databases of type 'zTXT' */ |
26 | #define ZTXT_TYPE_ID "zTXT" | 26 | #define ZTXT_TYPE_ID "zTXT" |
27 | /* Size of one database record */ | 27 | /* Size of one database record */ |
28 | #define RECORD_SIZE 8192 | 28 | #define RECORD_SIZE 8192 |
29 | /* Allow largest WBIT size for data. Lower with command line options | 29 | /* Allow largest WBIT size for data. Lower with command line options |
@@ -55,51 +55,51 @@ struct zTXTbkmk | |||
55 | UInt32 offset; | 55 | UInt32 offset; |
56 | tchar title[MAX_BMRK_LENGTH]; | 56 | tchar title[MAX_BMRK_LENGTH]; |
57 | }; | 57 | }; |
58 | 58 | ||
59 | #endif | 59 | #endif |
60 | 60 | ||
61 | 61 | ||
62 | const UInt32 ZTXT_ID = 0x5458547a; | 62 | const UInt32 ZTXT_ID = 0x5458547a; |
63 | 63 | ||
64 | class ztxt : public CExpander, Cpdb | 64 | class ztxt : public CExpander, Cpdb |
65 | { | 65 | { |
66 | bool bInit; | 66 | bool bInit; |
67 | UInt32 buffersize; | 67 | UInt32 buffersize; |
68 | UInt32 buffercontent; | 68 | UInt32 buffercontent; |
69 | UInt8* expandedtextbuffer; | 69 | UInt8* expandedtextbuffer; |
70 | UInt8* compressedtextbuffer; | 70 | UInt8* compressedtextbuffer; |
71 | z_stream zstream; | 71 | z_stream zstream; |
72 | size_t bufferpos; | 72 | size_t bufferpos; |
73 | UInt16 bufferrec; | 73 | UInt16 bufferrec; |
74 | zTXT_record0 hdr0; | 74 | zTXT_record0 hdr0; |
75 | size_t currentpos; | 75 | size_t currentpos; |
76 | void home(); | 76 | void home(); |
77 | public: | 77 | public: |
78 | virtual void sizes(unsigned long& _file, unsigned long& _text) | 78 | virtual void sizes(unsigned long& _file, unsigned long& _text) |
79 | { | 79 | { |
80 | _file = file_length; | 80 | _file = file_length; |
81 | _text = ntohl(hdr0.size); | 81 | _text = ntohl(hdr0.size); |
82 | } | 82 | } |
83 | virtual bool hasrandomaccess() { return (hdr0.randomAccess != 0); } | 83 | virtual bool hasrandomaccess() { return (hdr0.randomAccess != 0); } |
84 | virtual ~ztxt() | 84 | virtual ~ztxt() |
85 | { | 85 | { |
86 | if (expandedtextbuffer != NULL) delete [] expandedtextbuffer; | 86 | if (expandedtextbuffer != NULL) delete [] expandedtextbuffer; |
87 | if (compressedtextbuffer != NULL) delete [] compressedtextbuffer; | 87 | if (compressedtextbuffer != NULL) delete [] compressedtextbuffer; |
88 | if (bInit) | 88 | if (bInit) |
89 | { | 89 | { |
90 | inflateEnd(&zstream); | 90 | inflateEnd(&zstream); |
91 | } | 91 | } |
92 | } | 92 | } |
93 | ztxt(); | 93 | ztxt(); |
94 | virtual int openfile(const char *src); | 94 | virtual int openfile(const char *src); |
95 | virtual int getch(); | 95 | virtual int getch(); |
96 | virtual unsigned int locate(); | 96 | virtual unsigned int locate(); |
97 | virtual void locate(unsigned int n); | 97 | virtual void locate(unsigned int n); |
98 | virtual CList<Bkmk>* getbkmklist(); | 98 | virtual CList<Bkmk>* getbkmklist(); |
99 | virtual MarkupType PreferredMarkup() | 99 | virtual MarkupType PreferredMarkup() |
100 | { | 100 | { |
101 | return cTEXT; | 101 | return cTEXT; |
102 | } | 102 | } |
103 | }; | 103 | }; |
104 | 104 | ||
105 | #endif | 105 | #endif |