summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-reader/Aportis.cpp
Unidiff
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, 4 insertions, 4 deletions
diff --git a/noncore/apps/opie-reader/Aportis.cpp b/noncore/apps/opie-reader/Aportis.cpp
index b4988da..2f8cdc3 100644
--- a/noncore/apps/opie-reader/Aportis.cpp
+++ b/noncore/apps/opie-reader/Aportis.cpp
@@ -19,32 +19,32 @@ void Aportis::dePeanut(int& ch)
19CList<Bkmk>* Aportis::getbkmklist() 19CList<Bkmk>* Aportis::getbkmklist()
20{ 20{
21/* 21/*
22 if (peanutfile) 22 if (peanutfile)
23 { 23 {
24 if (nRecs2 > nRecs) 24 if (nRecs2 > nRecs)
25 { 25 {
26 CList<Bkmk>* t = new CList<Bkmk>; 26 CList<Bkmk>* t = new CList<Bkmk>;
27 for (int i = nRecs; i < nRecs2; i++) 27 for (int i = nRecs; i < nRecs2; i++)
28 { 28 {
29 char name[17]; 29 char name[17];
30 name[16] = '\0'; 30 name[16] = '\0';
31 qDebug("Record:%d, Length:%u",i,recordlength(i)); 31 // qDebug("Record:%d, Length:%u",i,recordlength(i));
32 gotorecordnumber(i); 32 gotorecordnumber(i);
33 fread(name,1,16,fin); 33 fread(name,1,16,fin);
34 unsigned long lcn; 34 unsigned long lcn;
35 fread(&lcn,sizeof(lcn),1,fin); 35 fread(&lcn,sizeof(lcn),1,fin);
36 lcn ^= 0xa5a5a5a5; 36 lcn ^= 0xa5a5a5a5;
37 lcn = SwapLong(lcn); 37 lcn = SwapLong(lcn);
38 qDebug("Bookmark:%s:%u", name,lcn); 38 // qDebug("Bookmark:%s:%u", name,lcn);
39 tchar tname[17]; 39 tchar tname[17];
40 memset(tname, 0, sizeof(tname)); 40 memset(tname, 0, sizeof(tname));
41 for (int i = 0; name[i] != 0; i++) 41 for (int i = 0; name[i] != 0; i++)
42 { 42 {
43 tname[i] = name[i] ^ 0xa5; 43 tname[i] = name[i] ^ 0xa5;
44 } 44 }
45 t->push_back(Bkmk(tname, NULL, lcn)); 45 t->push_back(Bkmk(tname, NULL, lcn));
46 } 46 }
47 return t; 47 return t;
48 } 48 }
49 else 49 else
50 { 50 {
@@ -112,25 +112,25 @@ int Aportis::OpenFile(const char *src)
112 } 112 }
113 113
114 nRecs2 = nRecs = SwapWord(head.recordList.numRecords) - 1; 114 nRecs2 = nRecs = SwapWord(head.recordList.numRecords) - 1;
115 fseek(fin,0,SEEK_END); 115 fseek(fin,0,SEEK_END);
116 dwLen = ftell(fin); 116 dwLen = ftell(fin);
117 117
118 if (peanutfile) 118 if (peanutfile)
119 { 119 {
120 120
121 PeanutHeader hdr0; 121 PeanutHeader hdr0;
122 gotorecordnumber(0); 122 gotorecordnumber(0);
123 fread(&hdr0, sizeof(hdr0), 1, fin); 123 fread(&hdr0, sizeof(hdr0), 1, fin);
124 qDebug("Version:%x", ntohs(hdr0.Version)); 124// qDebug("Version:%x", ntohs(hdr0.Version));
125 if (hdr0.Version && 0x0200) 125 if (hdr0.Version && 0x0200)
126 { 126 {
127 bCompressed = 2; 127 bCompressed = 2;
128 } 128 }
129 else 129 else
130 { 130 {
131 bCompressed = 1; 131 bCompressed = 1;
132 } 132 }
133 BlockSize = 4096; 133 BlockSize = 4096;
134 nRecs = SwapWord(hdr0.Records)-1; 134 nRecs = SwapWord(hdr0.Records)-1;
135 dwTLen = nRecs*BlockSize; 135 dwTLen = nRecs*BlockSize;
136 } 136 }
@@ -173,25 +173,25 @@ int Aportis::OpenFile(const char *src)
173 } 173 }
174 } 174 }
175 } 175 }
176 176
177 177
178 178
179 // this is the main record buffer 179 // this is the main record buffer
180 // it knows how to stretch to accomodate the decompress 180 // it knows how to stretch to accomodate the decompress
181 currentrec = 0; 181 currentrec = 0;
182 cbptr = 0; 182 cbptr = 0;
183 outptr = 0; 183 outptr = 0;
184 refreshbuffer(); 184 refreshbuffer();
185 qDebug("Number of records:[%u,%u]", nRecs, nRecs2); 185// qDebug("Number of records:[%u,%u]", nRecs, nRecs2);
186 return ret; 186 return ret;
187} 187}
188 188
189int Aportis::getch() 189int Aportis::getch()
190{ 190{
191 if (bCompressed == 1) 191 if (bCompressed == 1)
192 { 192 {
193 if ((dwRecLen == 0) && !refreshbuffer()) return EOF; 193 if ((dwRecLen == 0) && !refreshbuffer()) return EOF;
194 else 194 else
195 { 195 {
196 int c = getc(fin); 196 int c = getc(fin);
197 dePeanut(c); 197 dePeanut(c);