summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-reader/pdb.h
Unidiff
Diffstat (limited to 'noncore/apps/opie-reader/pdb.h') (more/less context) (show whitespace changes)
-rw-r--r--noncore/apps/opie-reader/pdb.h14
1 files changed, 11 insertions, 3 deletions
diff --git a/noncore/apps/opie-reader/pdb.h b/noncore/apps/opie-reader/pdb.h
index eac3ae6..7a6580d 100644
--- a/noncore/apps/opie-reader/pdb.h
+++ b/noncore/apps/opie-reader/pdb.h
@@ -6,24 +6,26 @@
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#include "useqpe.h"
19#include "CExpander.h"
18 20
19/* Normal Palm typedefs */ 21/* Normal Palm typedefs */
20typedef unsigned char UInt8; 22typedef unsigned char UInt8;
21typedef unsigned short UInt16; 23typedef unsigned short UInt16;
22typedef signed short Int16; 24typedef signed short Int16;
23typedef unsigned long UInt32; 25typedef unsigned long UInt32;
24typedef UInt32 LocalID; 26typedef UInt32 LocalID;
25 27
26/* Max length of DB name */ 28/* Max length of DB name */
27#define dmDBNameLength 0x20 29#define dmDBNameLength 0x20
28 30
29 31
@@ -67,27 +69,33 @@ typedef struct {
67 UInt32 type; // database type 69 UInt32 type; // database type
68 UInt32 creator; // database creator 70 UInt32 creator; // database creator
69 UInt32 uniqueIDSeed; // used to generate unique IDs. 71 UInt32 uniqueIDSeed; // used to generate unique IDs.
70 // Note that only the low order 72 // Note that only the low order
71 // 3 bytes of this is used (in 73 // 3 bytes of this is used (in
72 // RecordEntryType.uniqueID). 74 // RecordEntryType.uniqueID).
73 // We are keeping 4 bytes for 75 // We are keeping 4 bytes for
74 // alignment purposes. 76 // alignment purposes.
75 RecordListType recordList; // first record list 77 RecordListType recordList; // first record list
76} DatabaseHdrType; 78} DatabaseHdrType;
77 79
78 80
79class Cpdb 81class Cpdb : public CExpander
80{ 82{
81 protected: 83 protected:
82 size_t file_length; 84 size_t file_length;
83 FILE* fin; 85 FILE* fin;
84 size_t recordpos(int); 86 size_t recordpos(int);
85 size_t recordlength(int); 87 size_t recordlength(int);
86 void gotorecordnumber(int); 88 void gotorecordnumber(int);
87 DatabaseHdrType head; 89 DatabaseHdrType head;
88 bool openfile(const char* src); 90 bool openpdbfile(const char* src);
89 Cpdb() : fin(NULL) {} 91 Cpdb() : fin(NULL) {}
90 ~Cpdb() { if (fin != NULL) fclose(fin); } 92 ~Cpdb();
93#ifdef USEQPE
94 void suspend();
95 void unsuspend();
96#endif
97 public:
98 virtual void sizes(unsigned long& _file, unsigned long& _text) = 0;
91}; 99};
92#endif 100#endif
93 101