aboutsummaryrefslogtreecommitdiffstats
path: root/libqpdf
diff options
context:
space:
mode:
authorJay Berkenbilt <ejb@ql.org>2012-06-24 00:23:06 +0200
committerJay Berkenbilt <ejb@ql.org>2012-06-24 00:23:06 +0200
commit4f305488d85f9237c561f04a88570f9b0584cb0d (patch)
tree68198ee2942078b45ee9b6cef9b457ec87b5b848 /libqpdf
parent7f95ad5b92922167629919e2f3ef1f8b4b13a15f (diff)
downloadqpdf-4f305488d85f9237c561f04a88570f9b0584cb0d.tar.zst
Improve the FILE* version of QPDF::processFile
Diffstat (limited to 'libqpdf')
-rw-r--r--libqpdf/QPDF.cc14
1 files changed, 8 insertions, 6 deletions
diff --git a/libqpdf/QPDF.cc b/libqpdf/QPDF.cc
index 5f1ab48c..3ea2f1ff 100644
--- a/libqpdf/QPDF.cc
+++ b/libqpdf/QPDF.cc
@@ -114,12 +114,13 @@ QPDF::FileInputSource::setFilename(char const* filename)
}
void
-QPDF::FileInputSource::setFile(FILE* f)
+QPDF::FileInputSource::setFile(
+ char const* description, FILE* filep, bool close_file)
{
destroy();
- this->filename = "stdio FILE";
- this->close_file = false;
- this->file = f;
+ this->filename = description;
+ this->close_file = close_file;
+ this->file = filep;
this->seek(0, SEEK_SET);
}
@@ -347,11 +348,12 @@ QPDF::processFile(char const* filename, char const* password)
}
void
-QPDF::processFile(FILE* filep, char const* password)
+QPDF::processFile(char const* description, FILE* filep,
+ bool close_file, char const* password)
{
FileInputSource* fi = new FileInputSource();
this->file = fi;
- fi->setFile(filep);
+ fi->setFile(description, filep, close_file);
parse(password);
}