Diffstat (limited to 'noncore/apps/opie-reader/ppm_expander.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/apps/opie-reader/ppm_expander.cpp | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/noncore/apps/opie-reader/ppm_expander.cpp b/noncore/apps/opie-reader/ppm_expander.cpp index fe2745c..ea5b955 100644 --- a/noncore/apps/opie-reader/ppm_expander.cpp +++ b/noncore/apps/opie-reader/ppm_expander.cpp | |||
@@ -9,4 +9,5 @@ | |||
9 | #include <string.h> | 9 | #include <string.h> |
10 | #include <time.h> | 10 | #include <time.h> |
11 | #include "static.h" | ||
11 | 12 | ||
12 | /*************************************************************************** | 13 | /*************************************************************************** |
@@ -66,7 +67,7 @@ int ppm_expander::home() | |||
66 | if (fread(&numblocks,sizeof(numblocks),1,my_file_in) != 1) return 1; | 67 | if (fread(&numblocks,sizeof(numblocks),1,my_file_in) != 1) return 1; |
67 | //fprintf(stderr,"<%u,%u,%u>\n",maxnode,blocksize,numblocks); | 68 | //fprintf(stderr,"<%u,%u,%u>\n",maxnode,blocksize,numblocks); |
68 | int err = locate(0,0); | 69 | locate(0,0); |
69 | outbytes = 0; | 70 | outbytes = 0; |
70 | return err; | 71 | return 0; |
71 | } | 72 | } |
72 | 73 | ||
@@ -76,5 +77,5 @@ void ppm_expander::locate(unsigned int n) { | |||
76 | } | 77 | } |
77 | 78 | ||
78 | int ppm_expander::locate(unsigned short block, unsigned int n) | 79 | void ppm_expander::locate(unsigned short block, unsigned int n) |
79 | { | 80 | { |
80 | if (needppmend) | 81 | if (needppmend) |
@@ -85,5 +86,5 @@ int ppm_expander::locate(unsigned short block, unsigned int n) | |||
85 | size_t fpos; | 86 | size_t fpos; |
86 | fseek(my_file_in,STAT_MAGIC_SIZE+sizeof(maxnode)+sizeof(blocksize)+sizeof(numblocks)+block*sizeof(fpos),SEEK_SET); | 87 | fseek(my_file_in,STAT_MAGIC_SIZE+sizeof(maxnode)+sizeof(blocksize)+sizeof(numblocks)+block*sizeof(fpos),SEEK_SET); |
87 | if (fread(&fpos,sizeof(fpos),1,my_file_in) != 1) return 1; | 88 | fread(&fpos,sizeof(fpos),1,my_file_in); |
88 | fseek(my_file_in,fpos,SEEK_SET); | 89 | fseek(my_file_in,fpos,SEEK_SET); |
89 | 90 | ||
@@ -107,2 +108,9 @@ int ppm_expander::getch() { | |||
107 | return (c==SYM_EOF) ? EOF : c; | 108 | return (c==SYM_EOF) ? EOF : c; |
108 | } | 109 | } |
110 | |||
111 | #ifndef __STATIC | ||
112 | extern "C" | ||
113 | { | ||
114 | CExpander* newcodec() { return new ppm_expander; } | ||
115 | } | ||
116 | #endif | ||