Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/pdf/xpdf/Stream.h
diff options
context:
space:
mode:
authorMartin Kretzschmar <mkretzschmar@src.gnome.org>2002-09-18 20:32:18 (GMT)
committer Martin Kretzschmar <mkretzschmar@src.gnome.org>2002-09-18 20:32:18 (GMT)
commit7aac8dc8533347e21311b15186e0af82f1b22fd6 (patch)
tree02650bb02c8a1d8468c22f50ff151885d233016b /pdf/xpdf/Stream.h
parentd99fb4f4acd14fcdbda968abd907547dcc7af40c (diff)
Synched with Xpdf 0.92
this adds "decryption" support testing this code after six weeks immediately gives me segfaults (image drawing) :-O must have fixed that later without knowing :-O
Diffstat (limited to 'pdf/xpdf/Stream.h')
-rw-r--r--pdf/xpdf/Stream.h29
1 files changed, 26 insertions, 3 deletions
diff --git a/pdf/xpdf/Stream.h b/pdf/xpdf/Stream.h
index e4c70c9..50345bb 100644
--- a/pdf/xpdf/Stream.h
+++ b/pdf/xpdf/Stream.h
@@ -17,6 +17,9 @@
#include "gtypes.h"
#include "Object.h"
+#ifndef NO_DECRYPTION
+class Decrypt;
+#endif
class BaseStream;
//------------------------------------------------------------------------
@@ -56,6 +59,9 @@ public:
// Reset stream to beginning.
virtual void reset() = 0;
+ // Close down the stream.
+ virtual void close();
+
// Get next char from stream.
virtual int getChar() = 0;
@@ -121,6 +127,17 @@ public:
virtual int getStart() = 0;
virtual void moveStart(int delta) = 0;
+#ifndef NO_DECRYPTION
+ // Set decryption for this stream.
+ void doDecryption(Guchar *fileKey, int objNum, int objGen);
+#endif
+
+#ifndef NO_DECRYPTION
+protected:
+
+ Decrypt *decrypt;
+#endif
+
private:
Object dict;
@@ -137,6 +154,7 @@ public:
FilterStream(Stream *str);
virtual ~FilterStream();
+ virtual void close();
virtual int getPos() { return str->getPos(); }
virtual void setPos(int pos);
virtual BaseStream *getBaseStream() { return str->getBaseStream(); }
@@ -219,6 +237,8 @@ private:
// FileStream
//------------------------------------------------------------------------
+#define fileStreamBufSize 256
+
class FileStream: public BaseStream {
public:
@@ -227,6 +247,7 @@ public:
virtual Stream *makeSubStream(int start, int length, Object *dict);
virtual StreamKind getKind() { return strFile; }
virtual void reset();
+ virtual void close();
virtual int getChar()
{ return (bufPtr >= bufEnd && !fillBuf()) ? EOF : (*bufPtr++ & 0xff); }
virtual int lookChar()
@@ -244,7 +265,7 @@ private:
FILE *f;
int start;
int length;
- char buf[256];
+ char buf[fileStreamBufSize];
char *bufPtr;
char *bufEnd;
int bufPos;
@@ -352,9 +373,8 @@ private:
StreamPredictor *pred; // predictor
int early; // early parameter
- char zCmd[256]; // uncompress command
FILE *zPipe; // uncompress pipe
- char *zName; // .Z file name (in zCmd)
+ GString *zName; // .Z file name
int inputBuf; // input buffer
int inputBits; // number of bits in input buffer
int inCodeBits; // size of input code
@@ -625,6 +645,7 @@ public:
~FixedLengthEncoder();
virtual StreamKind getKind() { return strWeird; }
virtual void reset();
+ virtual void close();
virtual int getChar();
virtual int lookChar();
virtual GString *getPSFilter(char *indent) { return NULL; }
@@ -648,6 +669,7 @@ public:
virtual ~ASCII85Encoder();
virtual StreamKind getKind() { return strWeird; }
virtual void reset();
+ virtual void close();
virtual int getChar()
{ return (bufPtr >= bufEnd && !fillBuf()) ? EOF : (*bufPtr++ & 0xff); }
virtual int lookChar()
@@ -678,6 +700,7 @@ public:
virtual ~RunLengthEncoder();
virtual StreamKind getKind() { return strWeird; }
virtual void reset();
+ virtual void close();
virtual int getChar()
{ return (bufPtr >= bufEnd && !fillBuf()) ? EOF : (*bufPtr++ & 0xff); }
virtual int lookChar()