summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-reader/ppm_expander.h
authorllornkcor <llornkcor>2002-07-01 23:24:08 (UTC)
committer llornkcor <llornkcor>2002-07-01 23:24:08 (UTC)
commit59222a752fa4c8a1e8c2a00ee2f9e22855f12bb2 (patch) (side-by-side diff)
treef148d4858859dac3b413e675c760acfdab24b8e6 /noncore/apps/opie-reader/ppm_expander.h
parentc08be8ae22dcc1bfb83cfdec807149b161d770f5 (diff)
downloadopie-59222a752fa4c8a1e8c2a00ee2f9e22855f12bb2.zip
opie-59222a752fa4c8a1e8c2a00ee2f9e22855f12bb2.tar.gz
opie-59222a752fa4c8a1e8c2a00ee2f9e22855f12bb2.tar.bz2
initial
Diffstat (limited to 'noncore/apps/opie-reader/ppm_expander.h') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-reader/ppm_expander.h46
1 files changed, 46 insertions, 0 deletions
diff --git a/noncore/apps/opie-reader/ppm_expander.h b/noncore/apps/opie-reader/ppm_expander.h
new file mode 100644
index 0000000..ce95db7
--- a/dev/null
+++ b/noncore/apps/opie-reader/ppm_expander.h
@@ -0,0 +1,46 @@
+#ifndef __ppm_expander_h
+#define __ppm_expander_h
+
+#include "CExpander.h"
+#include <sys/stat.h>
+
+
+#include "utypes.h"
+#include "ppm.h"
+#include "arith.h"
+
+
+#define SYM_EOF 256
+
+class ppm_expander : public CExpander {
+ UCHAR *buf_in,*buf_out;
+ unsigned int bufsize;
+ unsigned int outbytes;
+ unsigned long blocksize;
+ unsigned short numblocks;
+ unsigned short curblock;
+ unsigned short maxnode;
+ bool needppmend;
+ int home();
+ FILE* my_file_in;
+ PPM_ReadBuf* my_read_buf;
+ ppm_worker ppm;
+ public:
+ ppm_expander() : needppmend(false), my_file_in(NULL), my_read_buf(NULL)
+ {
+ bufsize = 1024;
+ buf_in = new UCHAR[bufsize];
+ buf_out = new UCHAR[bufsize];
+ outbytes = 0;
+ }
+ virtual int openfile(const char* infile);
+ virtual int getch();
+ int locate(unsigned short block, unsigned int n);
+ virtual ~ppm_expander();
+ virtual unsigned int locate() { return outbytes; }
+ virtual void locate(unsigned int n);
+ virtual bool hasrandomaccess() { return (numblocks > 1); }
+ virtual void sizes(unsigned long& file, unsigned long& text);
+};
+
+#endif