author | llornkcor <llornkcor> | 2002-09-14 02:19:09 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2002-09-14 02:19:09 (UTC) |
commit | 2d0c1ffcb39f9fac8193ed2e9e93794de0bd7975 (patch) (unidiff) | |
tree | eeed16b5f80dd5883991a7a06133f5f7a6936256 /noncore/apps/opie-reader/ztxt.cpp | |
parent | 5a95ed6a000a56849b8f093deea500214856c626 (diff) | |
download | opie-2d0c1ffcb39f9fac8193ed2e9e93794de0bd7975.zip opie-2d0c1ffcb39f9fac8193ed2e9e93794de0bd7975.tar.gz opie-2d0c1ffcb39f9fac8193ed2e9e93794de0bd7975.tar.bz2 |
update by Tim
Diffstat (limited to 'noncore/apps/opie-reader/ztxt.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/opie-reader/ztxt.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/noncore/apps/opie-reader/ztxt.cpp b/noncore/apps/opie-reader/ztxt.cpp index c30e4fd..289b13a 100644 --- a/noncore/apps/opie-reader/ztxt.cpp +++ b/noncore/apps/opie-reader/ztxt.cpp | |||
@@ -1,15 +1,17 @@ | |||
1 | #include <stdio.h> | 1 | #include <stdio.h> |
2 | #include <string.h> | 2 | #include <string.h> |
3 | #include "ztxt.h" | 3 | #include "ztxt.h" |
4 | #include "my_list.h" | ||
5 | #include "Bkmks.h" | ||
4 | 6 | ||
5 | ztxt::ztxt() : bInit(false), expandedtextbuffer(NULL), compressedtextbuffer(NULL) { /*printf("constructing:%x\n",fin);*/ } | 7 | ztxt::ztxt() : bInit(false), expandedtextbuffer(NULL), compressedtextbuffer(NULL) { /*printf("constructing:%x\n",fin);*/ } |
6 | 8 | ||
7 | 9 | ||
8 | int ztxt::openfile(const char *src) | 10 | int ztxt::openfile(const char *src) |
9 | { | 11 | { |
10 | if (!Cpdb::openfile(src)) | 12 | if (!Cpdb::openfile(src)) |
11 | { | 13 | { |
12 | return -1; | 14 | return -1; |
13 | } | 15 | } |
14 | 16 | ||
15 | //printf("Okay %u\n", 4); | 17 | //printf("Okay %u\n", 4); |
@@ -143,17 +145,17 @@ CList<Bkmk>* ztxt::getbkmklist() | |||
143 | // printf("Bookmarks - record %d contains %d\n", recno, ntohs(hdr0.numBookmarks)); | 145 | // printf("Bookmarks - record %d contains %d\n", recno, ntohs(hdr0.numBookmarks)); |
144 | 146 | ||
145 | if (recno == 0) return NULL; | 147 | if (recno == 0) return NULL; |
146 | 148 | ||
147 | CList<Bkmk>* t = new CList<Bkmk>; | 149 | CList<Bkmk>* t = new CList<Bkmk>; |
148 | size_t cur = ftell(fin); | 150 | size_t cur = ftell(fin); |
149 | gotorecordnumber(recno); | 151 | gotorecordnumber(recno); |
150 | for (int i = 0; i < ntohs(hdr0.numBookmarks); i++) | 152 | for (int i = 0; i < ntohs(hdr0.numBookmarks); i++) |
151 | { | 153 | { |
152 | zTXTbkmk bkmk; | 154 | zTXTbkmk bkmk; |
153 | if (fread(&bkmk, sizeof(bkmk), 1, fin) != 1) break; | 155 | if (fread(&bkmk, sizeof(bkmk), 1, fin) != 1) break; |
154 | // printf("Bookmark number:%d:%.20s\n", i, bkmk.title); | 156 | // printf("Bookmark number:%d:%.20s\n", i, bkmk.title); |
155 | t->push_back(Bkmk(bkmk.title, ntohl(bkmk.offset))); | 157 | t->push_back(Bkmk(bkmk.title, NULL, ntohl(bkmk.offset))); |
156 | } | 158 | } |
157 | fseek(fin, cur, SEEK_SET); | 159 | fseek(fin, cur, SEEK_SET); |
158 | return t; | 160 | return t; |
159 | } | 161 | } |