From 7d5ff30c37c9e5b271fdb2b8cb3219068048322e Mon Sep 17 00:00:00 2001 From: Robin Watts Date: Thu, 14 May 2015 17:12:42 +0100 Subject: Support pdf files larger than 2Gig. If FZ_LARGEFILE is defined when building, MuPDF uses 64bit offsets for files; this allows us to open streams larger than 2Gig. The downsides to this are that: * The xref entries are larger. * All PDF ints are held as 64bit things rather than 32bit things (to cope with /Prev entries, hint stream offsets etc). * All file positions are stored as 64bits rather than 32. The implementation works by detecting FZ_LARGEFILE. Some #ifdeffery in fitz/system.h sets fz_off_t to either int or int64_t as appropriate, and sets defines for fz_fopen, fz_fseek, fz_ftell etc as required. These call the fseeko64 etc functions on linux (and so define _LARGEFILE64_SOURCE) and the explicit 64bit functions on windows. --- source/fitz/filter-basic.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source/fitz/filter-basic.c') diff --git a/source/fitz/filter-basic.c b/source/fitz/filter-basic.c index eb9e838e..20bb6619 100644 --- a/source/fitz/filter-basic.c +++ b/source/fitz/filter-basic.c @@ -14,7 +14,7 @@ struct null_filter { fz_stream *chain; int remain; - int offset; + fz_off_t offset; unsigned char buffer[4096]; }; @@ -54,7 +54,7 @@ close_null(fz_context *ctx, void *state_) } fz_stream * -fz_open_null(fz_context *ctx, fz_stream *chain, int len, int offset) +fz_open_null(fz_context *ctx, fz_stream *chain, int len, fz_off_t offset) { struct null_filter *state; -- cgit v1.2.3