Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/pdf/xpdf/XRef.cc
diff options
context:
space:
mode:
authorMichael Meeks <mmeeks@src.gnome.org>1999-08-19 17:57:59 (GMT)
committer Michael Meeks <mmeeks@src.gnome.org>1999-08-19 17:57:59 (GMT)
commitbf3b381529f5388bd1bda8ed8fafb247a7b8a9fc (patch)
tree23e95c805c1d878ba0bf90c68765aba383848139 /pdf/xpdf/XRef.cc
parent1a49446c08faaab930d3a36bc002b566eadb1ebc (diff)
Totaly re-hash stream architecture ... again :-)
Now we can compile but not run auxiliary utils.
Diffstat (limited to 'pdf/xpdf/XRef.cc')
-rw-r--r--pdf/xpdf/XRef.cc21
1 files changed, 9 insertions, 12 deletions
diff --git a/pdf/xpdf/XRef.cc b/pdf/xpdf/XRef.cc
index cc9bee8..c725a4a 100644
--- a/pdf/xpdf/XRef.cc
+++ b/pdf/xpdf/XRef.cc
@@ -38,7 +38,7 @@ XRef *xref = NULL;
// XRef
//------------------------------------------------------------------------
-XRef::XRef(FileStream *str) {
+XRef::XRef(Stream *str1) {
XRef *oldXref;
int pos;
int i;
@@ -53,7 +53,7 @@ XRef::XRef(FileStream *str) {
xref = NULL;
// read the trailer
- file = str->getFile();
+ str = str1;
start = str->getStart();
pos = readTrailer(str);
@@ -105,7 +105,7 @@ XRef::~XRef() {
// Read startxref position, xref table size, and root. Returns
// first xref position.
-int XRef::readTrailer(FileStream *str) {
+int XRef::readTrailer(Stream *str) {
Parser *parser;
Object obj;
char buf[xrefSearchSize+1];
@@ -166,7 +166,7 @@ int XRef::readTrailer(FileStream *str) {
// read trailer dict
obj.initNull();
- parser = new Parser(new Lexer(new FileStream(file, start + pos1, -1, &obj)));
+ parser = new Parser(new Lexer(str->subStream (start + pos1, -1, &obj)));
parser->getObj(&trailerDict);
if (trailerDict.isDict()) {
trailerDict.dictLookupNF("Size", &obj);
@@ -193,7 +193,7 @@ int XRef::readTrailer(FileStream *str) {
}
// Read an xref table and the prev pointer from the trailer.
-GBool XRef::readXRef(FileStream *str, int *pos) {
+GBool XRef::readXRef(Stream *str, int *pos) {
Parser *parser;
Object obj, obj2;
char s[20];
@@ -258,8 +258,7 @@ GBool XRef::readXRef(FileStream *str, int *pos) {
// read prev pointer from trailer dictionary
obj.initNull();
- parser = new Parser(new Lexer(
- new FileStream(file, str->getPos(), -1, &obj)));
+ parser = new Parser(new Lexer(str->subStream (str->getPos(), -1, &obj)));
parser->getObj(&obj);
if (!obj.isCmd("trailer"))
goto err1;
@@ -288,7 +287,7 @@ GBool XRef::readXRef(FileStream *str, int *pos) {
}
// Attempt to construct an xref table for a damaged file.
-GBool XRef::constructXRef(FileStream *str) {
+GBool XRef::constructXRef(Stream *str) {
Parser *parser;
Object obj;
char buf[256];
@@ -312,8 +311,7 @@ GBool XRef::constructXRef(FileStream *str) {
// got trailer dictionary
if (!strncmp(p, "trailer", 7)) {
obj.initNull();
- parser = new Parser(new Lexer(
- new FileStream(file, start + pos + 8, -1, &obj)));
+ parser = new Parser(new Lexer(str->subStream(start + pos + 8, -1, &obj)));
if (!trailerDict.isNone())
trailerDict.free();
parser->getObj(&trailerDict);
@@ -416,8 +414,7 @@ Object *XRef::fetch(int num, int gen, Object *obj) {
e = &entries[num];
if (e->gen == gen && e->offset >= 0) {
obj1.initNull();
- parser = new Parser(new Lexer(
- new FileStream(file, start + e->offset, -1, &obj1)));
+ parser = new Parser(new Lexer(str->subStream(start + e->offset, -1, &obj1)));
parser->getObj(&obj1);
parser->getObj(&obj2);
parser->getObj(&obj3);