summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-reader/pdb.cpp
Unidiff
Diffstat (limited to 'noncore/apps/opie-reader/pdb.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-reader/pdb.cpp38
1 files changed, 34 insertions, 4 deletions
diff --git a/noncore/apps/opie-reader/pdb.cpp b/noncore/apps/opie-reader/pdb.cpp
index dca67ff..39551cc 100644
--- a/noncore/apps/opie-reader/pdb.cpp
+++ b/noncore/apps/opie-reader/pdb.cpp
@@ -5,2 +5,26 @@
5 5
6#include "useqpe.h"
7
8#ifdef USEQPE
9void Cpdb::suspend()
10{
11 CExpander::suspend(fin);
12}
13void Cpdb::unsuspend()
14{
15 CExpander::unsuspend(fin);
16}
17#endif
18
19Cpdb::~Cpdb()
20{
21 if (fin != NULL)
22 {
23#ifdef USEQPE
24 unsuspend();
25#endif
26 fclose(fin);
27 }
28}
29
6size_t Cpdb::recordpos(int n) 30size_t Cpdb::recordpos(int n)
@@ -34,7 +58,7 @@ void Cpdb::gotorecordnumber(int n)
34 58
35bool Cpdb::openfile(const char *src) 59bool Cpdb::openpdbfile(const char *src)
36{ 60{
61 //qDebug("cpdb openfile:%s", src);
37 62
38 // printf("In openfile\n"); 63 // printf("In openfile\n");
39 int ret = 0;
40 // printf("closing fin:%x\n",fin); 64 // printf("closing fin:%x\n",fin);
@@ -51,4 +75,7 @@ bool Cpdb::openfile(const char *src)
51 //char buf[0x100]; 75 //char buf[0x100];
52 fseek(fin,0,SEEK_END); 76 struct stat _stat;
53 file_length = ftell(fin); 77 stat(src,&_stat);
78 file_length = _stat.st_size;
79 // fseek(fin,0,SEEK_END);
80 // file_length = ftell(fin);
54 81
@@ -58,2 +85,5 @@ bool Cpdb::openfile(const char *src)
58 85
86 qDebug("Database name:%s", head.name);
87 qDebug("Total number of records:%u", ntohs(head.recordList.numRecords));
88
59 return true; 89 return true;