Diffstat (limited to 'noncore/apps/opie-reader/pdb.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/opie-reader/pdb.h | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/noncore/apps/opie-reader/pdb.h b/noncore/apps/opie-reader/pdb.h index 7458919..a0abd1b 100644 --- a/noncore/apps/opie-reader/pdb.h +++ b/noncore/apps/opie-reader/pdb.h | |||
@@ -2,39 +2,37 @@ | |||
2 | /* | 2 | /* |
3 | * This header file defines some structures and types normally found in the | 3 | * This header file defines some structures and types normally found in the |
4 | * Palm SDK. However, I don't want to require the presense of the SDK for a | 4 | * Palm SDK. However, I don't want to require the presense of the SDK for a |
5 | * small utility since most Palm owners won't have it. | 5 | * small utility since most Palm owners won't have it. |
6 | * | 6 | * |
7 | * $Id$ | 7 | * $Id$ |
8 | * | 8 | * |
9 | */ | 9 | */ |
10 | 10 | ||
11 | #ifndef __PDB_H__ | 11 | #ifndef __PDB_H__ |
12 | #define __PDB_H__ | 12 | #define __PDB_H__ |
13 | 13 | ||
14 | #ifndef _WINDOWS | 14 | #ifndef _WINDOWS |
15 | #include <netinet/in.h> | 15 | #include <netinet/in.h> |
16 | #endif | 16 | #endif |
17 | #include <stdio.h> | 17 | #include <stdio.h> |
18 | |||
18 | #include "CExpander.h" | 19 | #include "CExpander.h" |
19 | 20 | ||
20 | /* Normal Palm typedefs */ | 21 | /* Normal Palm typedefs */ |
21 | typedef unsigned char UInt8; | 22 | #include "mytypes.h" |
22 | typedef unsigned short UInt16; | ||
23 | typedef signed short Int16; | ||
24 | typedef unsigned long UInt32; | ||
25 | typedef UInt32 LocalID; | 23 | typedef UInt32 LocalID; |
26 | 24 | ||
27 | /* Max length of DB name */ | 25 | /* Max length of DB name */ |
28 | #define dmDBNameLength 0x20 | 26 | #define dmDBNameLength 0x20 |
29 | 27 | ||
30 | 28 | ||
31 | /************************************************************ | 29 | /************************************************************ |
32 | * Structure of a Record entry | 30 | * Structure of a Record entry |
33 | *************************************************************/ | 31 | *************************************************************/ |
34 | typedef struct { | 32 | typedef struct { |
35 | LocalID localChunkID; // local chunkID of a record | 33 | LocalID localChunkID; // local chunkID of a record |
36 | UInt8 attributes; // record attributes; | 34 | UInt8 attributes; // record attributes; |
37 | UInt8 uniqueID[3]; // unique ID of record; should | 35 | UInt8 uniqueID[3]; // unique ID of record; should |
38 | // not be 0 for a legal record. | 36 | // not be 0 for a legal record. |
39 | } RecordEntryType; | 37 | } RecordEntryType; |
40 | 38 | ||
@@ -79,22 +77,25 @@ typedef struct { | |||
79 | 77 | ||
80 | class Cpdb : public CExpander | 78 | class Cpdb : public CExpander |
81 | { | 79 | { |
82 | protected: | 80 | protected: |
83 | size_t file_length; | 81 | size_t file_length; |
84 | FILE* fin; | 82 | FILE* fin; |
85 | size_t recordpos(int); | 83 | size_t recordpos(int); |
86 | size_t recordlength(int); | 84 | size_t recordlength(int); |
87 | void gotorecordnumber(int); | 85 | void gotorecordnumber(int); |
88 | DatabaseHdrType head; | 86 | DatabaseHdrType head; |
89 | bool openpdbfile(const char* src); | 87 | bool openpdbfile(const char* src); |
90 | Cpdb() : fin(NULL) {} | 88 | Cpdb() : fin(NULL) {} |
91 | ~Cpdb(); | 89 | ~Cpdb(); |
92 | #ifdef USEQPE | 90 | #ifdef USEQPE |
93 | void suspend(); | 91 | void suspend(); |
94 | void unsuspend(); | 92 | void unsuspend(); |
93 | #else | ||
94 | void suspend() {} | ||
95 | void unsuspend() {} | ||
95 | #endif | 96 | #endif |
96 | public: | 97 | public: |
97 | virtual void sizes(unsigned long& _file, unsigned long& _text) = 0; | 98 | virtual void sizes(unsigned long& _file, unsigned long& _text) = 0; |
98 | }; | 99 | }; |
99 | #endif | 100 | #endif |
100 | 101 | ||