summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2015-04-08 15:54:05 +0200
committerTor Andersson <tor.andersson@artifex.com>2015-04-09 12:09:15 +0200
commit1f913dcbca84e327977d633a985ad6bdb92f7804 (patch)
tree72d88a82361e71f0fab8b37e813a8bc3f8c8524a /source
parentaae4d9682f33187adc9dfe480fb83c05955afebe (diff)
downloadmupdf-1f913dcbca84e327977d633a985ad6bdb92f7804.tar.xz
Remove the _no_run functions.
The new pdfclean sanitize functionality mean that mutool now needs the data files, so maintaining the split that was designed to keep data files out of mutool is no longer viable.
Diffstat (limited to 'source')
-rw-r--r--source/fitz/document-no-run.c10
-rw-r--r--source/pdf/pdf-clean-file.c2
-rw-r--r--source/pdf/pdf-xref-aux.c34
-rw-r--r--source/pdf/pdf-xref.c11
-rw-r--r--source/tools/pdfextract.c2
-rw-r--r--source/tools/pdfinfo.c2
-rw-r--r--source/tools/pdfpages.c2
-rw-r--r--source/tools/pdfposter.c2
-rw-r--r--source/tools/pdfshow.c2
9 files changed, 12 insertions, 55 deletions
diff --git a/source/fitz/document-no-run.c b/source/fitz/document-no-run.c
deleted file mode 100644
index 2fd608ee..00000000
--- a/source/fitz/document-no-run.c
+++ /dev/null
@@ -1,10 +0,0 @@
-#include "mupdf/fitz.h"
-
-void fz_register_no_run_document_handlers(fz_context *ctx)
-{
- fz_register_document_handler(ctx, &pdf_no_run_document_handler);
- fz_register_document_handler(ctx, &xps_document_handler);
- fz_register_document_handler(ctx, &cbz_document_handler);
- fz_register_document_handler(ctx, &img_document_handler);
- fz_register_document_handler(ctx, &tiff_document_handler);
-}
diff --git a/source/pdf/pdf-clean-file.c b/source/pdf/pdf-clean-file.c
index d224dd9a..f1302efb 100644
--- a/source/pdf/pdf-clean-file.c
+++ b/source/pdf/pdf-clean-file.c
@@ -198,7 +198,7 @@ void pdf_clean_file(fz_context *ctx, char *infile, char *outfile, char *password
fz_try(ctx)
{
- glo.doc = pdf_open_document_no_run(ctx, infile);
+ glo.doc = pdf_open_document(ctx, infile);
if (pdf_needs_password(ctx, glo.doc))
if (!pdf_authenticate_password(ctx, glo.doc, password))
fz_throw(glo.ctx, FZ_ERROR_GENERIC, "cannot authenticate password: %s", infile);
diff --git a/source/pdf/pdf-xref-aux.c b/source/pdf/pdf-xref-aux.c
deleted file mode 100644
index d257fa60..00000000
--- a/source/pdf/pdf-xref-aux.c
+++ /dev/null
@@ -1,34 +0,0 @@
-#include "mupdf/pdf.h"
-
-/*
- These functions have been split out of pdf_xref.c to allow tools
- to be linked without pulling in the interpreter. The interpreter
- references the built-in font and cmap resources which are quite
- big. Not linking those into the tools saves roughly 6MB in the
- resulting executables.
-*/
-
-pdf_document *
-pdf_open_document_with_stream(fz_context *ctx, fz_stream *file)
-{
- pdf_document *doc = pdf_open_document_no_run_with_stream(ctx, file);
- doc->super.load_page = (fz_document_load_page_fn*)pdf_load_page;
- doc->update_appearance = pdf_update_appearance;
- return doc;
-}
-
-pdf_document *
-pdf_open_document(fz_context *ctx, const char *filename)
-{
- pdf_document *doc = pdf_open_document_no_run(ctx, filename);
- doc->super.load_page = (fz_document_load_page_fn*)pdf_load_page;
- doc->update_appearance = pdf_update_appearance;
- return doc;
-}
-
-fz_document_handler pdf_document_handler =
-{
- (fz_document_recognize_fn *)&pdf_recognize,
- (fz_document_open_fn *)&pdf_open_document,
- (fz_document_open_with_stream_fn *)&pdf_open_document_with_stream
-};
diff --git a/source/pdf/pdf-xref.c b/source/pdf/pdf-xref.c
index 323a0de5..91faac35 100644
--- a/source/pdf/pdf-xref.c
+++ b/source/pdf/pdf-xref.c
@@ -2261,6 +2261,7 @@ pdf_new_document(fz_context *ctx, fz_stream *file)
doc->super.load_page = (fz_document_load_page_fn *)pdf_load_page;
doc->super.meta = (fz_document_meta_fn *)pdf_meta;
doc->super.write = (fz_document_write_fn *)pdf_write_document;
+ doc->update_appearance = pdf_update_appearance;
pdf_lexbuf_init(ctx, &doc->lexbuf.base, PDF_LEXBUF_LARGE);
doc->file = fz_keep_stream(ctx, file);
@@ -2269,7 +2270,7 @@ pdf_new_document(fz_context *ctx, fz_stream *file)
}
pdf_document *
-pdf_open_document_no_run_with_stream(fz_context *ctx, fz_stream *file)
+pdf_open_document_with_stream(fz_context *ctx, fz_stream *file)
{
pdf_document *doc = pdf_new_document(ctx, file);
fz_try(ctx)
@@ -2285,7 +2286,7 @@ pdf_open_document_no_run_with_stream(fz_context *ctx, fz_stream *file)
}
pdf_document *
-pdf_open_document_no_run(fz_context *ctx, const char *filename)
+pdf_open_document(fz_context *ctx, const char *filename)
{
fz_stream *file = NULL;
pdf_document *doc = NULL;
@@ -2708,11 +2709,11 @@ pdf_recognize(fz_context *doc, const char *magic)
return 1;
}
-fz_document_handler pdf_no_run_document_handler =
+fz_document_handler pdf_document_handler =
{
(fz_document_recognize_fn *)&pdf_recognize,
- (fz_document_open_fn *)&pdf_open_document_no_run,
- (fz_document_open_with_stream_fn *)&pdf_open_document_no_run_with_stream
+ (fz_document_open_fn *)&pdf_open_document,
+ (fz_document_open_with_stream_fn *)&pdf_open_document_with_stream
};
void pdf_mark_xref(fz_context *ctx, pdf_document *doc)
diff --git a/source/tools/pdfextract.c b/source/tools/pdfextract.c
index b2491f0b..7e454fc7 100644
--- a/source/tools/pdfextract.c
+++ b/source/tools/pdfextract.c
@@ -209,7 +209,7 @@ int pdfextract_main(int argc, char **argv)
exit(1);
}
- doc = pdf_open_document_no_run(ctx, infile);
+ doc = pdf_open_document(ctx, infile);
if (pdf_needs_password(ctx, doc))
if (!pdf_authenticate_password(ctx, doc, password))
fz_throw(ctx, FZ_ERROR_GENERIC, "cannot authenticate password: %s", infile);
diff --git a/source/tools/pdfinfo.c b/source/tools/pdfinfo.c
index af0f9340..4f370f16 100644
--- a/source/tools/pdfinfo.c
+++ b/source/tools/pdfinfo.c
@@ -1007,7 +1007,7 @@ pdfinfo_info(fz_context *ctx, fz_output *out, char *filename, char *password, in
filename = argv[argidx];
fz_printf(ctx, out, "%s:\n", filename);
- glo.doc = pdf_open_document_no_run(glo.ctx, filename);
+ glo.doc = pdf_open_document(glo.ctx, filename);
if (pdf_needs_password(ctx, glo.doc))
if (!pdf_authenticate_password(ctx, glo.doc, password))
fz_throw(glo.ctx, FZ_ERROR_GENERIC, "cannot authenticate password: %s", filename);
diff --git a/source/tools/pdfpages.c b/source/tools/pdfpages.c
index e1185bfc..a0f04e7d 100644
--- a/source/tools/pdfpages.c
+++ b/source/tools/pdfpages.c
@@ -182,7 +182,7 @@ pdfpages_pages(fz_context *ctx, fz_output *out, char *filename, char *password,
filename = argv[argidx];
fz_printf(ctx, out, "%s:\n", filename);
- doc = pdf_open_document_no_run(ctx, filename);
+ doc = pdf_open_document(ctx, filename);
if (pdf_needs_password(ctx, doc))
if (!pdf_authenticate_password(ctx, doc, password))
fz_throw(ctx, FZ_ERROR_GENERIC, "cannot authenticate password: %s", filename);
diff --git a/source/tools/pdfposter.c b/source/tools/pdfposter.c
index 8aec6d2d..1fa077c2 100644
--- a/source/tools/pdfposter.c
+++ b/source/tools/pdfposter.c
@@ -159,7 +159,7 @@ int pdfposter_main(int argc, char **argv)
exit(1);
}
- doc = pdf_open_document_no_run(ctx, infile);
+ doc = pdf_open_document(ctx, infile);
if (pdf_needs_password(ctx, doc))
if (!pdf_authenticate_password(ctx, doc, password))
fz_throw(ctx, FZ_ERROR_GENERIC, "cannot authenticate password: %s", infile);
diff --git a/source/tools/pdfshow.c b/source/tools/pdfshow.c
index 9e656e2d..f2b01daa 100644
--- a/source/tools/pdfshow.c
+++ b/source/tools/pdfshow.c
@@ -257,7 +257,7 @@ int pdfshow_main(int argc, char **argv)
fz_var(doc);
fz_try(ctx)
{
- doc = pdf_open_document_no_run(ctx, filename);
+ doc = pdf_open_document(ctx, filename);
if (pdf_needs_password(ctx, doc))
if (!pdf_authenticate_password(ctx, doc, password))
fz_warn(ctx, "cannot authenticate password: %s", filename);