author | pohly <pohly> | 2004-08-24 20:52:45 (UTC) |
---|---|---|
committer | pohly <pohly> | 2004-08-24 20:52:45 (UTC) |
commit | 73253e93327cf4ef0932de1b4afb56af22a0f37e (patch) (side-by-side diff) | |
tree | 1c9a7a6dd3341e036a894d348a3372525d29acec /noncore/apps/opie-reader/pdb.cpp | |
parent | e90847c784c48bd21bf8768cb38edb853b832697 (diff) | |
download | opie-73253e93327cf4ef0932de1b4afb56af22a0f37e.zip opie-73253e93327cf4ef0932de1b4afb56af22a0f37e.tar.gz opie-73253e93327cf4ef0932de1b4afb56af22a0f37e.tar.bz2 |
updated source to opie-reader 0.7g
Diffstat (limited to 'noncore/apps/opie-reader/pdb.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/opie-reader/pdb.cpp | 38 |
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 @@ -4,4 +4,28 @@ #endif +#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) { @@ -33,9 +57,9 @@ 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); if (fin != NULL) fclose(fin); @@ -50,6 +74,9 @@ bool Cpdb::openfile(const char *src) // just holds the first few chars of the file // 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); fseek(fin,0,SEEK_SET); @@ -57,4 +84,7 @@ bool Cpdb::openfile(const char *src) fread(&head, 1, sizeof(head), fin); + qDebug("Database name:%s", head.name); + qDebug("Total number of records:%u", ntohs(head.recordList.numRecords)); + return true; } |