summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-reader/pdb.cpp
Side-by-side diff
Diffstat (limited to 'noncore/apps/opie-reader/pdb.cpp') (more/less context) (show 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 @@
+#include "useqpe.h"
+
+#ifdef USEQPE
+void Cpdb::suspend()
+{
+ CExpander::suspend(fin);
+}
+void Cpdb::unsuspend()
+{
+ CExpander::unsuspend(fin);
+}
+#endif
+
+Cpdb::~Cpdb()
+{
+ if (fin != NULL)
+ {
+#ifdef USEQPE
+ unsuspend();
+#endif
+ fclose(fin);
+ }
+}
+
size_t Cpdb::recordpos(int n)
@@ -34,7 +58,7 @@ void Cpdb::gotorecordnumber(int n)
-bool Cpdb::openfile(const char *src)
+bool Cpdb::openpdbfile(const char *src)
{
+ //qDebug("cpdb openfile:%s", src);
// printf("In openfile\n");
- int ret = 0;
// printf("closing fin:%x\n",fin);
@@ -51,4 +75,7 @@ bool Cpdb::openfile(const char *src)
// char buf[0x100];
- fseek(fin,0,SEEK_END);
- file_length = ftell(fin);
+ struct stat _stat;
+ stat(src,&_stat);
+ file_length = _stat.st_size;
+ // fseek(fin,0,SEEK_END);
+ // file_length = ftell(fin);
@@ -58,2 +85,5 @@ bool Cpdb::openfile(const char *src)
+ qDebug("Database name:%s", head.name);
+ qDebug("Total number of records:%u", ntohs(head.recordList.numRecords));
+
return true;