From 1f913dcbca84e327977d633a985ad6bdb92f7804 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Wed, 8 Apr 2015 15:54:05 +0200 Subject: 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. --- source/pdf/pdf-clean-file.c | 2 +- source/pdf/pdf-xref-aux.c | 34 ---------------------------------- source/pdf/pdf-xref.c | 11 ++++++----- 3 files changed, 7 insertions(+), 40 deletions(-) delete mode 100644 source/pdf/pdf-xref-aux.c (limited to 'source/pdf') 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) -- cgit v1.2.3