author | pohly <pohly> | 2005-05-05 14:39:33 (UTC) |
---|---|---|
committer | pohly <pohly> | 2005-05-05 14:39:33 (UTC) |
commit | 39fbfd5eb7e45d73d38e8a2ce9437a3d7e1b8e91 (patch) (unidiff) | |
tree | 96e66fdc18dca4d4ab8611133e072f57dea224b9 /noncore/apps/opie-reader/pdb.cpp | |
parent | 279fc4fd1986074acbadd3a8e86fcf3968a8dd5c (diff) | |
download | opie-39fbfd5eb7e45d73d38e8a2ce9437a3d7e1b8e91.zip opie-39fbfd5eb7e45d73d38e8a2ce9437a3d7e1b8e91.tar.gz opie-39fbfd5eb7e45d73d38e8a2ce9437a3d7e1b8e91.tar.bz2 |
new opie-reader sources with support for ArriereGo, Reb input and flite output plugins
Diffstat (limited to 'noncore/apps/opie-reader/pdb.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/opie-reader/pdb.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/noncore/apps/opie-reader/pdb.cpp b/noncore/apps/opie-reader/pdb.cpp index 6719af4..a13b33d 100644 --- a/noncore/apps/opie-reader/pdb.cpp +++ b/noncore/apps/opie-reader/pdb.cpp | |||
@@ -3,7 +3,6 @@ | |||
3 | #include <winsock2.h> | 3 | #include <winsock2.h> |
4 | #endif | 4 | #endif |
5 | 5 | ||
6 | |||
7 | #ifdef USEQPE | 6 | #ifdef USEQPE |
8 | void Cpdb::suspend() | 7 | void Cpdb::suspend() |
9 | { | 8 | { |
@@ -37,6 +36,7 @@ size_t Cpdb::recordpos(int n) | |||
37 | { | 36 | { |
38 | size_t dataoffset = sizeof(DatabaseHdrType) - sizeof(UInt16); | 37 | size_t dataoffset = sizeof(DatabaseHdrType) - sizeof(UInt16); |
39 | dataoffset += /*dataoffset%4 + */ sizeof(RecordListType) * n; | 38 | dataoffset += /*dataoffset%4 + */ sizeof(RecordListType) * n; |
39 | unsuspend(); | ||
40 | fseek(fin, dataoffset, SEEK_SET); | 40 | fseek(fin, dataoffset, SEEK_SET); |
41 | RecordListType hdr; | 41 | RecordListType hdr; |
42 | fread(&hdr, 1, sizeof(hdr), fin); | 42 | fread(&hdr, 1, sizeof(hdr), fin); |
@@ -52,6 +52,7 @@ size_t Cpdb::recordlength(int n) | |||
52 | 52 | ||
53 | void Cpdb::gotorecordnumber(int n) | 53 | void Cpdb::gotorecordnumber(int n) |
54 | { | 54 | { |
55 | unsuspend(); | ||
55 | fseek(fin, recordpos(n), SEEK_SET); | 56 | fseek(fin, recordpos(n), SEEK_SET); |
56 | } | 57 | } |
57 | 58 | ||
@@ -82,8 +83,8 @@ bool Cpdb::openpdbfile(const char *src) | |||
82 | 83 | ||
83 | fread(&head, 1, sizeof(head), fin); | 84 | fread(&head, 1, sizeof(head), fin); |
84 | 85 | ||
85 | qDebug("Database name:%s", head.name); | 86 | //qDebug("Database name:%s", head.name); |
86 | qDebug("Total number of records:%u", ntohs(head.recordList.numRecords)); | 87 | //qDebug("Total number of records:%u", ntohs(head.recordList.numRecords)); |
87 | 88 | ||
88 | return true; | 89 | return true; |
89 | } | 90 | } |