summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-reader/Aportis.cpp
Side-by-side diff
Diffstat (limited to 'noncore/apps/opie-reader/Aportis.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/apps/opie-reader/Aportis.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/noncore/apps/opie-reader/Aportis.cpp b/noncore/apps/opie-reader/Aportis.cpp
index 353996c..37dcc99 100644
--- a/noncore/apps/opie-reader/Aportis.cpp
+++ b/noncore/apps/opie-reader/Aportis.cpp
@@ -53,8 +53,9 @@ CList<Bkmk>* Aportis::getbkmklist()
}
*/
if (bCompressed != 4) return NULL;
CList<Bkmk>* t = new CList<Bkmk>;
+ unsuspend();
size_t cur = ftell(fin);
for (int i = 0; i < nRecs2; i++)
{
DWORD dwPos;
@@ -245,8 +246,9 @@ int Aportis::getch()
{
if ((dwRecLen == 0) && !refreshbuffer()) return EOF;
else
{
+unsuspend();
int c = getc(fin);
dePeanut(c);
dwRecLen--;
currentpos++;
@@ -262,8 +264,9 @@ int Aportis::getch()
currentpos++;
int c;
// take a char from the input buffer
+unsuspend();
c = getc(fin);
dePeanut(c);
dwRecLen--;
// separate the char into zones: 0, 1...8, 9...0x7F, 0x80...0xBF, 0xC0...0xFF
@@ -319,9 +322,9 @@ int Aportis::getch()
unsigned int Aportis::GetBS(unsigned int bn)
{
DWORD dwPos;
WORD fs;
-
+unsuspend();
fseek(fin, 0x56 + 8*bn, SEEK_SET);
fread(&dwPos, 4, 1, fin);
dwPos = SwapLong(dwPos);
fseek(fin,dwPos,SEEK_SET);
@@ -342,8 +345,9 @@ unsigned int Aportis::GetBS(unsigned int bn)
unsigned int Aportis::locate()
{
if (bCompressed == 4)
{
+unsuspend();
size_t cur = ftell(fin);
unsigned int clen = 0;
for (unsigned int i = 0; i < currentrec-1; i++)
{
@@ -400,8 +404,9 @@ bool Aportis::refreshbuffer()
gotorecordnumber(currentrec+1);
if (bCompressed == 4)
{
unsigned char t[3];
+ unsuspend();
fread(t,1,3,fin);
if (t[0] != 241)
{
printf("You shouldn't be here!\n");
@@ -429,8 +434,9 @@ bool Aportis::refreshbuffer()
#include <qimage.h>
QImage* Aportis::getPicture(unsigned long tgt)
{
+unsuspend();
unsigned short tgtrec = tgt+mobiimagerec;
if (tgtrec > nRecs2) return NULL;
size_t cur = ftell(fin);
unsigned short reclen = recordlength(tgtrec);