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 | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/noncore/apps/opie-reader/ppm_expander.cpp b/noncore/apps/opie-reader/ppm_expander.cpp index 2a4318b..61ef90e 100644 --- a/noncore/apps/opie-reader/ppm_expander.cpp +++ b/noncore/apps/opie-reader/ppm_expander.cpp | |||
@@ -35,13 +35,13 @@ ppm_expander::~ppm_expander() { | |||
35 | if (my_file_in != NULL) fclose(my_file_in); | 35 | if (my_file_in != NULL) fclose(my_file_in); |
36 | } | 36 | } |
37 | 37 | ||
38 | int ppm_expander::OpenFile(const char* infile) | 38 | int ppm_expander::OpenFile(const char* infile) |
39 | { | 39 | { |
40 | my_file_in=fopen(infile,"rb"); | 40 | my_file_in=fopen(infile,"rb"); |
41 | my_read_buf = new PPM_ReadBuf(my_file_in); | 41 | my_read_buf = new PPM_ReadBuf(my_file_in, this); |
42 | return home(); | 42 | return home(); |
43 | } | 43 | } |
44 | 44 | ||
45 | void ppm_expander::sizes(unsigned long& file, unsigned long& text) | 45 | void ppm_expander::sizes(unsigned long& file, unsigned long& text) |
46 | { | 46 | { |
47 | struct stat _stat; | 47 | struct stat _stat; |
@@ -104,12 +104,21 @@ int ppm_expander::getch() { | |||
104 | c = ppm.PPM_Decode(); | 104 | c = ppm.PPM_Decode(); |
105 | } | 105 | } |
106 | outbytes++; | 106 | outbytes++; |
107 | return (c==SYM_EOF) ? EOF : c; | 107 | return (c==SYM_EOF) ? EOF : c; |
108 | } | 108 | } |
109 | 109 | ||
110 | UINT PPM_ReadBuf::readbuf(UCHAR *buf,UINT len) | ||
111 | { | ||
112 | UINT len1; | ||
113 | parent->unsuspend(); | ||
114 | len1=fread(buf,1,len,my_file_in); | ||
115 | return len1; | ||
116 | } | ||
117 | |||
118 | |||
110 | #ifndef __STATIC | 119 | #ifndef __STATIC |
111 | extern "C" | 120 | extern "C" |
112 | { | 121 | { |
113 | CExpander* newcodec() { return new ppm_expander; } | 122 | CExpander* newcodec() { return new ppm_expander; } |
114 | } | 123 | } |
115 | #endif | 124 | #endif |