Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/pdf/xpdf/PDFDoc.cc
diff options
context:
space:
mode:
authorMichael Meeks <mmeeks@src.gnome.org>1999-08-15 21:06:36 (GMT)
committer Michael Meeks <mmeeks@src.gnome.org>1999-08-15 21:06:36 (GMT)
commit2610a3462d1ac3f20cba8f16dd07cba8a8c2fbef (patch)
tree525fe32ba24e40e515aba0e4f7fb66b38941853d /pdf/xpdf/PDFDoc.cc
parentc43ab012d25e32fe019d4654e1994ad3edd618dd (diff)
Break everything except bonobo-image-x-pdf :-)
New cleaner xpdf IO code. use make bonobo-image-x-pdf in xpdf to compile.
Diffstat (limited to 'pdf/xpdf/PDFDoc.cc')
-rw-r--r--pdf/xpdf/PDFDoc.cc34
1 files changed, 7 insertions, 27 deletions
diff --git a/pdf/xpdf/PDFDoc.cc b/pdf/xpdf/PDFDoc.cc
index 1537c6a..599ceb1 100644
--- a/pdf/xpdf/PDFDoc.cc
+++ b/pdf/xpdf/PDFDoc.cc
@@ -29,11 +29,10 @@
// PDFDoc
//------------------------------------------------------------------------
-PDFDoc::PDFDoc(GString *fileName1) {
+PDFDoc::PDFDoc(BaseFile file1, GString *fileName1) {
FileStream *str;
Object catObj;
Object obj;
- GString *fileName2;
// setup
ok = gFalse;
@@ -42,33 +41,14 @@ PDFDoc::PDFDoc(GString *fileName1) {
file = NULL;
links = NULL;
- // try to open file
fileName = fileName1;
- fileName2 = NULL;
-#ifdef VMS
- if (!(file = fopen(fileName->getCString(), "rb", "ctx=stm"))) {
- error(-1, "Couldn't open file '%s'", fileName->getCString());
+ file = file1;
+ if (!file)
return;
- }
-#else
- if (!(file = fopen(fileName->getCString(), "rb"))) {
- fileName2 = fileName->copy();
- fileName2->lowerCase();
- if (!(file = fopen(fileName2->getCString(), "rb"))) {
- fileName2->upperCase();
- if (!(file = fopen(fileName2->getCString(), "rb"))) {
- error(-1, "Couldn't open file '%s'", fileName->getCString());
- delete fileName2;
- return;
- }
- }
- delete fileName2;
- }
-#endif
// create stream
obj.initNull();
- str = new FileStream(file, 0, -1, &obj);
+ str = new FileStream(file, 0, -1, &obj);
// check header
str->checkHeader();
@@ -100,7 +80,7 @@ PDFDoc::~PDFDoc() {
if (xref)
delete xref;
if (file)
- fclose(file);
+ bfclose(file);
if (fileName)
delete fileName;
if (links)
@@ -153,8 +133,8 @@ GBool PDFDoc::saveAs(GString *name) {
error(-1, "Couldn't open file '%s'", name->getCString());
return gFalse;
}
- rewind(file);
- while ((n = fread(buf, 1, sizeof(buf), file)) > 0)
+ brewind(file);
+ while ((n = bfread(buf, 1, sizeof(buf), file)) > 0)
fwrite(buf, 1, n, f);
fclose(f);
return gTrue;