summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2017-08-17 15:01:09 +0200
committerTor Andersson <tor.andersson@artifex.com>2017-11-01 13:08:56 +0100
commitf595e889b91a674eb94db7ca4d832da54f5194cd (patch)
tree273b4a7cc465477e428d0c628a19a61301baaae0 /include
parent2910531c99e80bede06d2f1460459e8f6ce79961 (diff)
downloadmupdf-f595e889b91a674eb94db7ca4d832da54f5194cd.tar.xz
Use int64_t for public file API offsets.
Don't mess with conditional compilation with LARGEFILE -- always expose 64-bit file offsets in our public API.
Diffstat (limited to 'include')
-rw-r--r--include/mupdf/fitz/filter.h2
-rw-r--r--include/mupdf/fitz/geometry.h5
-rw-r--r--include/mupdf/fitz/output.h22
-rw-r--r--include/mupdf/fitz/stream.h20
-rw-r--r--include/mupdf/fitz/system.h170
-rw-r--r--include/mupdf/pdf/document.h18
-rw-r--r--include/mupdf/pdf/object.h8
-rw-r--r--include/mupdf/pdf/parse.h2
-rw-r--r--include/mupdf/pdf/xref.h12
9 files changed, 64 insertions, 195 deletions
diff --git a/include/mupdf/fitz/filter.h b/include/mupdf/fitz/filter.h
index 2f73f02f..dd3c295b 100644
--- a/include/mupdf/fitz/filter.h
+++ b/include/mupdf/fitz/filter.h
@@ -10,7 +10,7 @@
typedef struct fz_jbig2_globals_s fz_jbig2_globals;
fz_stream *fz_open_copy(fz_context *ctx, fz_stream *chain);
-fz_stream *fz_open_null(fz_context *ctx, fz_stream *chain, int len, fz_off_t offset);
+fz_stream *fz_open_null(fz_context *ctx, fz_stream *chain, int len, int64_t offset);
fz_stream *fz_open_concat(fz_context *ctx, int max, int pad);
void fz_concat_push_drop(fz_context *ctx, fz_stream *concat, fz_stream *chain); /* Ownership of chain is passed in */
fz_stream *fz_open_arc4(fz_context *ctx, fz_stream *chain, unsigned char *key, unsigned keylen);
diff --git a/include/mupdf/fitz/geometry.h b/include/mupdf/fitz/geometry.h
index d832248a..0667c3ee 100644
--- a/include/mupdf/fitz/geometry.h
+++ b/include/mupdf/fitz/geometry.h
@@ -47,8 +47,7 @@ float fz_atof(const char *s);
atoi that copes with NULL
*/
int fz_atoi(const char *s);
-
-fz_off_t fz_atoo(const char *s);
+int64_t fz_atoi64(const char *s);
/*
Some standard math functions, done as static inlines for speed.
@@ -90,7 +89,7 @@ static inline int fz_maxi(int a, int b)
return (a > b ? a : b);
}
-static inline fz_off_t fz_maxo(fz_off_t a, fz_off_t b)
+static inline int64_t fz_maxi64(int64_t a, int64_t b)
{
return (a > b ? a : b);
}
diff --git a/include/mupdf/fitz/output.h b/include/mupdf/fitz/output.h
index 2c7a53a8..c3c21c96 100644
--- a/include/mupdf/fitz/output.h
+++ b/include/mupdf/fitz/output.h
@@ -34,7 +34,7 @@ typedef void (fz_output_write_fn)(fz_context *ctx, void *state, const void *data
offset, whence: as defined for fs_seek_output.
*/
-typedef void (fz_output_seek_fn)(fz_context *ctx, void *state, fz_off_t offset, int whence);
+typedef void (fz_output_seek_fn)(fz_context *ctx, void *state, int64_t offset, int whence);
/*
fz_output_tell_fn: A function type for use when implementing
@@ -45,7 +45,7 @@ typedef void (fz_output_seek_fn)(fz_context *ctx, void *state, fz_off_t offset,
Returns the offset within the output stream.
*/
-typedef fz_off_t (fz_output_tell_fn)(fz_context *ctx, void *state);
+typedef int64_t (fz_output_tell_fn)(fz_context *ctx, void *state);
/*
fz_output_close_fn: A function type for use when implementing
@@ -80,17 +80,6 @@ struct fz_output_s
fz_output *fz_new_output(fz_context *ctx, void *state, fz_output_write_fn *write, fz_output_close_fn *close);
/*
- fz_new_output_with_file: Open an output stream that writes to a
- FILE *.
-
- file: The file to write to.
-
- close: non-zero if we should close the file when the fz_output
- is closed.
-*/
-fz_output *fz_new_output_with_file_ptr(fz_context *ctx, FILE *file, int close);
-
-/*
fz_new_output_with_path: Open an output stream that writes to a
given path.
@@ -156,14 +145,14 @@ void fz_write_vprintf(fz_context *ctx, fz_output *out, const char *fmt, va_list
Throw an error on unseekable outputs.
*/
-void fz_seek_output(fz_context *ctx, fz_output *out, fz_off_t off, int whence);
+void fz_seek_output(fz_context *ctx, fz_output *out, int64_t off, int whence);
/*
fz_tell_output: Return the current file position.
Throw an error on untellable outputs.
*/
-fz_off_t fz_tell_output(fz_context *ctx, fz_output *out);
+int64_t fz_tell_output(fz_context *ctx, fz_output *out);
/*
fz_drop_output: Close and free an output stream.
@@ -229,9 +218,8 @@ void fz_write_base64_buffer(fz_context *ctx, fz_output *out, fz_buffer *data, in
%C outputs a utf8 encoded int.
%M outputs a fz_matrix*. %R outputs a fz_rect*. %P outputs a fz_point*.
%q and %( output escaped strings in C/PDF syntax.
- %ll{d,u,x} indicates that the values are 64bit.
+ %l{d,u,x} indicates that the values are int64_t.
%z{d,u,x} indicates that the value is a size_t.
- %Z{d,u,x} indicates that the value is a fz_off_t.
user: An opaque pointer that is passed to the emit function.
emit: A function pointer called to emit output bytes as the string is being formatted.
diff --git a/include/mupdf/fitz/stream.h b/include/mupdf/fitz/stream.h
index be59a7a0..e336fd5d 100644
--- a/include/mupdf/fitz/stream.h
+++ b/include/mupdf/fitz/stream.h
@@ -33,7 +33,6 @@ typedef struct fz_stream_s fz_stream;
*/
fz_stream *fz_open_file(fz_context *ctx, const char *filename);
-fz_stream *fz_open_file_ptr_progressive(fz_context *ctx, FILE *file, int bps);
fz_stream *fz_open_file_progressive(fz_context *ctx, const char *filename, int bps);
/*
@@ -47,17 +46,6 @@ fz_stream *fz_open_file_progressive(fz_context *ctx, const char *filename, int b
fz_stream *fz_open_file_w(fz_context *ctx, const wchar_t *filename);
/*
- fz_open_file: Wrap an open file descriptor in a stream.
-
- file: An open file descriptor supporting bidirectional
- seeking. The stream will take ownership of the file
- descriptor, so it may not be modified or closed after the call
- to fz_open_file_ptr. When the stream is closed it will also close
- the file descriptor.
-*/
-fz_stream *fz_open_file_ptr(fz_context *ctx, FILE *file);
-
-/*
fz_open_memory: Open a block of memory as a stream.
data: Pointer to start of data block. Ownership of the data block is
@@ -107,7 +95,7 @@ void fz_drop_stream(fz_context *ctx, fz_stream *stm);
/*
fz_tell: return the current reading position within a stream
*/
-fz_off_t fz_tell(fz_context *ctx, fz_stream *stm);
+int64_t fz_tell(fz_context *ctx, fz_stream *stm);
/*
fz_seek: Seek within a stream.
@@ -118,7 +106,7 @@ fz_off_t fz_tell(fz_context *ctx, fz_stream *stm);
whence: From where the offset is measured (see fseek).
*/
-void fz_seek(fz_context *ctx, fz_stream *stm, fz_off_t offset, int whence);
+void fz_seek(fz_context *ctx, fz_stream *stm, int64_t offset, int whence);
/*
fz_read: Read from a stream into a given data block.
@@ -256,7 +244,7 @@ typedef void (fz_stream_close_fn)(fz_context *ctx, void *state);
The stream can find it's private state in stm->state.
*/
-typedef void (fz_stream_seek_fn)(fz_context *ctx, fz_stream *stm, fz_off_t offset, int whence);
+typedef void (fz_stream_seek_fn)(fz_context *ctx, fz_stream *stm, int64_t offset, int whence);
/*
fz_stream_meta_fn: A function type for use when implementing
@@ -273,7 +261,7 @@ struct fz_stream_s
int refs;
int error;
int eof;
- fz_off_t pos;
+ int64_t pos;
int avail;
int bits;
unsigned char *rp, *wp;
diff --git a/include/mupdf/fitz/system.h b/include/mupdf/fitz/system.h
index 255c61bb..7b426264 100644
--- a/include/mupdf/fitz/system.h
+++ b/include/mupdf/fitz/system.h
@@ -1,21 +1,6 @@
#ifndef MUPDF_FITZ_SYSTEM_H
#define MUPDF_FITZ_SYSTEM_H
-#if _MSC_VER >= 1400 /* MSVC 8 (Visual Studio 2005) or newer */
-#define FZ_LARGEFILE
-#endif
-
-/* The very first decision we need to make is, are we using the 64bit
- * file pointers code. This must happen before the stdio.h include. */
-#ifdef FZ_LARGEFILE
-/* Set _LARGEFILE64_SOURCE so that we know fopen64 et al will be declared. */
-#ifndef _WIN32
-#ifndef _LARGEFILE64_SOURCE
-#define _LARGEFILE64_SOURCE
-#endif
-#endif
-#endif
-
/* Turn on valgrind pacification in debug builds. */
#ifndef NDEBUG
#ifndef PACIFY_VALGRIND
@@ -27,21 +12,22 @@
Include the standard libc headers.
*/
-#include <stdio.h>
-#include <stdlib.h>
-#include <stddef.h>
-#include <stdarg.h>
-#include <string.h>
-#include <math.h>
-
-#include <assert.h>
-#include <errno.h>
-#include <limits.h> /* INT_MAX & co */
-#include <float.h> /* FLT_EPSILON, FLT_MAX & co */
-#include <fcntl.h> /* O_RDONLY & co */
-#include <time.h>
+#include <stddef.h> /* needed for size_t */
+#include <stdarg.h> /* needed for va_list vararg functions */
+#include <setjmp.h> /* needed for the try/catch macros */
-#include <setjmp.h>
+#if defined(_MSC_VER) && (_MSC_VER < 1700) /* MSVC older than VS2012 */
+typedef signed char int8_t;
+typedef short int int16_t;
+typedef int int32_t;
+typedef __int64 int64_t;
+typedef unsigned char uint8_t;
+typedef unsigned short int uint16_t;
+typedef unsigned int uint32_t;
+typedef unsigned __int64 uint64_t;
+#else
+#include <stdint.h> /* needed for int64_t */
+#endif
#include "mupdf/memento.h"
#include "mupdf/fitz/track-usage.h"
@@ -93,21 +79,23 @@
#endif
/* these constants mirror the corresponding macros in stdio.h */
-#define FZ_SEEK_SET 0
-#define FZ_SEEK_CUR 1
-#define FZ_SEEK_END 2
-#ifndef _MSC_VER
-/* For gettimeofday */
-#include <sys/time.h>
+#ifndef EOF
+#define EOF (-1)
+#endif
+#ifndef SEEK_SET
+#define SEEK_SET 0
+#endif
+#ifndef SEEK_CUR
+#define SEEK_CUR 1
+#endif
+#ifndef SEEK_END
+#define SEEK_END 2
#endif
#ifdef _MSC_VER /* Microsoft Visual C */
/* MSVC up to VS2012 */
#if _MSC_VER < 1800
-#define va_copy(a, oa) do { a=oa; } while (0)
-#define va_copy_end(a) do {} while(0)
-
static __inline int signbit(double x)
{
union
@@ -118,115 +106,31 @@ static __inline int signbit(double x)
u.d = x;
return (int)(u.i>>63);
}
-
-#else
-#define va_copy_end(a) va_end(a)
#endif
-typedef signed char int8_t;
-typedef short int int16_t;
-typedef int int32_t;
-typedef __int64 int64_t;
-
-typedef unsigned char uint8_t;
-typedef unsigned short int uint16_t;
-typedef unsigned int uint32_t;
-typedef unsigned __int64 uint64_t;
-
#pragma warning( disable: 4244 ) /* conversion from X to Y, possible loss of data */
#pragma warning( disable: 4701 ) /* Potentially uninitialized local variable 'name' used */
#pragma warning( disable: 4996 ) /* 'function': was declared deprecated */
-#include <io.h>
-
-struct timeval;
-struct timezone;
-int gettimeofday(struct timeval *tv, struct timezone *tz);
-
-#if _MSC_VER < 1900 /* MSVC 2015 */
-#define snprintf msvc_snprintf
-#define vsnprintf msvc_vsnprintf
-static int msvc_vsnprintf(char *str, size_t size, const char *fmt, va_list ap)
-{
- int n;
- n = _vsnprintf(str, size, fmt, ap);
- str[size-1] = 0;
- return n;
-}
-static int msvc_snprintf(char *str, size_t size, const char *fmt, ...)
-{
- int n;
- va_list ap;
- va_start(ap, fmt);
- n = msvc_vsnprintf(str, size, fmt, ap);
- va_end(ap);
- return n;
-}
-#endif
-
#if _MSC_VER <= 1700 /* MSVC 2012 */
#define isnan(x) _isnan(x)
#define isinf(x) (!_finite(x))
#endif
#define hypotf _hypotf
-
-#define fz_fopen fz_fopen_utf8
-#define fz_remove fz_remove_utf8
+#define atoll _atoi64
+#define stat _stat
char *fz_utf8_from_wchar(const wchar_t *s);
wchar_t *fz_wchar_from_utf8(const char *s);
-FILE *fz_fopen_utf8(const char *name, const char *mode);
+/* really a FILE* but we don't want to include stdio.h here */
+void *fz_fopen_utf8(const char *name, const char *mode);
int fz_remove_utf8(const char *name);
char **fz_argv_from_wargv(int argc, wchar_t **wargv);
void fz_free_argv(int argc, char **argv);
-#define fseeko64 _fseeki64
-#define ftello64 _ftelli64
-#define atoll _atoi64
-
-#include <sys/stat.h>
-
-#define stat _stat
-
-#else /* Unix or close enough */
-
-#include <stdint.h>
-#include <unistd.h>
-#include <sys/stat.h>
-
-#ifndef O_BINARY
-#define O_BINARY 0
-#endif
-
-#define va_copy_end(a) va_end(a)
-
-#endif
-
-#ifndef fz_remove
-#define fz_remove remove
-#endif
-
-#ifdef FZ_LARGEFILE
-typedef int64_t fz_off_t;
-#define FZ_OFF_MAX 0x7fffffffffffffffLL
-#ifndef fz_fopen
-#define fz_fopen fopen64
-#endif
-#define fz_fseek fseeko64
-#define fz_ftell ftello64
-#define fz_atoo_imp atoll
-#else
-typedef int fz_off_t;
-#define FZ_OFF_MAX INT_MAX
-#ifndef fz_fopen
-#define fz_fopen fopen
-#endif
-#define fz_fseek fseek
-#define fz_ftell ftell
-#define fz_atoo_imp atoi
#endif
/* Cope with systems (such as Windows) with no S_ISDIR */
@@ -234,18 +138,8 @@ typedef int fz_off_t;
#define S_ISDIR(mode) ((mode) & S_IFDIR)
#endif
-/* Portable way to format a size_t */
-#if defined(_WIN64)
-#define FZ_FMT_zu "%llu"
-#elif defined(_WIN32)
-#define FZ_FMT_zu "%u"
-#else
-#define FZ_FMT_zu "%zu"
-#endif
-
#ifdef __ANDROID__
-#include <android/log.h>
-int fz_android_fprintf(FILE *file, const char *fmt, ...);
+int fz_android_fprintf(void *file, const char *fmt, ...);
#ifndef NDEBUG
/* Capture fprintf for stdout/stderr to the android logging
* stream. Only do this in debug builds as this implies a
@@ -333,6 +227,8 @@ extern void __gnu_mcount_nc(void);
#endif
#ifdef CLUSTER
+/* Include this first so our defines don't clash with the system definitions */
+#include <math.h>
/*
* Trig functions
*/
diff --git a/include/mupdf/pdf/document.h b/include/mupdf/pdf/document.h
index 0f4467e8..30cfba48 100644
--- a/include/mupdf/pdf/document.h
+++ b/include/mupdf/pdf/document.h
@@ -25,7 +25,7 @@ struct pdf_lexbuf_s
int size;
int base_size;
int len;
- fz_off_t i;
+ int64_t i;
float f;
char *scratch;
char buffer[PDF_LEXBUF_SMALL];
@@ -566,8 +566,8 @@ struct pdf_document_s
fz_stream *file;
int version;
- fz_off_t startxref;
- fz_off_t file_size;
+ int64_t startxref;
+ int64_t file_size;
pdf_crypt *crypt;
pdf_ocg_descriptor *ocg;
pdf_portfolio *portfolio;
@@ -593,7 +593,7 @@ struct pdf_document_s
/* State indicating which file parsing method we are using */
int file_reading_linearly;
- fz_off_t file_length;
+ int64_t file_length;
int linear_page_count;
pdf_obj *linear_obj; /* Linearized object (if used) */
@@ -601,7 +601,7 @@ struct pdf_document_s
int linear_page1_obj_num;
/* The state for the pdf_progressive_advance parser */
- fz_off_t linear_pos;
+ int64_t linear_pos;
int linear_page_num;
int hint_object_offset;
@@ -625,17 +625,17 @@ struct pdf_document_s
struct
{
int number; /* Page object number */
- fz_off_t offset; /* Offset of page object */
- fz_off_t index; /* Index into shared hint_shared_ref */
+ int64_t offset; /* Offset of page object */
+ int64_t index; /* Index into shared hint_shared_ref */
} *hint_page;
int *hint_shared_ref;
struct
{
int number; /* Object number of first object */
- fz_off_t offset; /* Offset of first object */
+ int64_t offset; /* Offset of first object */
} *hint_shared;
int hint_obj_offsets_max;
- fz_off_t *hint_obj_offsets;
+ int64_t *hint_obj_offsets;
int resources_localised;
diff --git a/include/mupdf/pdf/object.h b/include/mupdf/pdf/object.h
index 285acf4d..a1825eb2 100644
--- a/include/mupdf/pdf/object.h
+++ b/include/mupdf/pdf/object.h
@@ -13,8 +13,7 @@ typedef struct pdf_obj_s pdf_obj;
pdf_obj *pdf_new_null(fz_context *ctx, pdf_document *doc);
pdf_obj *pdf_new_bool(fz_context *ctx, pdf_document *doc, int b);
-pdf_obj *pdf_new_int(fz_context *ctx, pdf_document *doc, int i);
-pdf_obj *pdf_new_int_offset(fz_context *ctx, pdf_document *doc, fz_off_t off);
+pdf_obj *pdf_new_int(fz_context *ctx, pdf_document *doc, int64_t i);
pdf_obj *pdf_new_real(fz_context *ctx, pdf_document *doc, float f);
pdf_obj *pdf_new_name(fz_context *ctx, pdf_document *doc, const char *str);
pdf_obj *pdf_new_string(fz_context *ctx, pdf_document *doc, const char *str, size_t len);
@@ -84,7 +83,7 @@ void pdf_clean_obj(fz_context *ctx, pdf_obj *obj);
/* safe, silent failure, no error reporting on type mismatches */
int pdf_to_bool(fz_context *ctx, pdf_obj *obj);
int pdf_to_int(fz_context *ctx, pdf_obj *obj);
-fz_off_t pdf_to_offset(fz_context *ctx, pdf_obj *obj);
+int64_t pdf_to_int64(fz_context *ctx, pdf_obj *obj);
float pdf_to_real(fz_context *ctx, pdf_obj *obj);
const char *pdf_to_name(fz_context *ctx, pdf_obj *obj);
char *pdf_to_str_buf(fz_context *ctx, pdf_obj *obj);
@@ -155,7 +154,6 @@ fz_matrix *pdf_to_matrix(fz_context *ctx, pdf_obj *array, fz_matrix *mat);
pdf_document *pdf_get_indirect_document(fz_context *ctx, pdf_obj *obj);
pdf_document *pdf_get_bound_document(fz_context *ctx, pdf_obj *obj);
void pdf_set_str_len(fz_context *ctx, pdf_obj *obj, int newlen);
-void pdf_set_int(fz_context *ctx, pdf_obj *obj, int i);
-void pdf_set_int_offset(fz_context *ctx, pdf_obj *obj, fz_off_t i);
+void pdf_set_int(fz_context *ctx, pdf_obj *obj, int64_t i);
#endif
diff --git a/include/mupdf/pdf/parse.h b/include/mupdf/pdf/parse.h
index dc706f40..ed649234 100644
--- a/include/mupdf/pdf/parse.h
+++ b/include/mupdf/pdf/parse.h
@@ -29,7 +29,7 @@ pdf_token pdf_lex_no_string(fz_context *ctx, fz_stream *f, pdf_lexbuf *lexbuf);
pdf_obj *pdf_parse_array(fz_context *ctx, pdf_document *doc, fz_stream *f, pdf_lexbuf *buf);
pdf_obj *pdf_parse_dict(fz_context *ctx, pdf_document *doc, fz_stream *f, pdf_lexbuf *buf);
pdf_obj *pdf_parse_stm_obj(fz_context *ctx, pdf_document *doc, fz_stream *f, pdf_lexbuf *buf);
-pdf_obj *pdf_parse_ind_obj(fz_context *ctx, pdf_document *doc, fz_stream *f, pdf_lexbuf *buf, int *num, int *gen, fz_off_t *stm_ofs, int *try_repair);
+pdf_obj *pdf_parse_ind_obj(fz_context *ctx, pdf_document *doc, fz_stream *f, pdf_lexbuf *buf, int *num, int *gen, int64_t *stm_ofs, int *try_repair);
/*
pdf_append_token: print a lexed token to a buffer, growing if necessary
diff --git a/include/mupdf/pdf/xref.h b/include/mupdf/pdf/xref.h
index 971e5b8f..06633337 100644
--- a/include/mupdf/pdf/xref.h
+++ b/include/mupdf/pdf/xref.h
@@ -41,8 +41,8 @@ struct pdf_xref_entry_s
unsigned char flags; /* bit 0 = marked */
unsigned short gen; /* generation / objstm index */
int num; /* original object number (for decryption after renumbering) */
- fz_off_t ofs; /* file offset / objstm object number */
- fz_off_t stm_ofs; /* on-disk stream */
+ int64_t ofs; /* file offset / objstm object number */
+ int64_t stm_ofs; /* on-disk stream */
fz_buffer *stm_buf; /* in-memory stream (for updated objects) */
pdf_obj *obj; /* stored/cached object */
};
@@ -58,7 +58,7 @@ struct pdf_xref_subsec_s
{
pdf_xref_subsec *next;
int len;
- fz_off_t start;
+ int64_t start;
pdf_xref_entry *table;
};
@@ -70,7 +70,7 @@ struct pdf_xref_s
pdf_obj *pre_repair_trailer;
pdf_unsaved_sig *unsaved_sigs;
pdf_unsaved_sig **unsaved_sigs_end;
- fz_off_t end_ofs; /* file offset to end of xref */
+ int64_t end_ofs; /* file offset to end of xref */
};
pdf_xref_entry *pdf_cache_object(fz_context *ctx, pdf_document *doc, int num);
@@ -92,7 +92,7 @@ fz_stream *pdf_open_stream(fz_context *ctx, pdf_obj *ref);
fz_stream *pdf_open_inline_stream(fz_context *ctx, pdf_document *doc, pdf_obj *stmobj, int length, fz_stream *chain, fz_compression_params *params);
fz_compressed_buffer *pdf_load_compressed_stream(fz_context *ctx, pdf_document *doc, int num);
void pdf_load_compressed_inline_image(fz_context *ctx, pdf_document *doc, pdf_obj *dict, int length, fz_stream *cstm, int indexed, fz_compressed_image *image);
-fz_stream *pdf_open_stream_with_offset(fz_context *ctx, pdf_document *doc, int num, pdf_obj *dict, fz_off_t stm_ofs);
+fz_stream *pdf_open_stream_with_offset(fz_context *ctx, pdf_document *doc, int num, pdf_obj *dict, int64_t stm_ofs);
fz_stream *pdf_open_compressed_stream(fz_context *ctx, fz_compressed_buffer *);
fz_stream *pdf_open_contents_stream(fz_context *ctx, pdf_document *doc, pdf_obj *obj);
fz_buffer *pdf_load_stream_truncated(fz_context *ctx, pdf_document *doc, int num, int *truncated);
@@ -115,7 +115,7 @@ void pdf_mark_xref(fz_context *ctx, pdf_document *doc);
void pdf_clear_xref(fz_context *ctx, pdf_document *doc);
void pdf_clear_xref_to_mark(fz_context *ctx, pdf_document *doc);
-int pdf_repair_obj(fz_context *ctx, pdf_document *doc, pdf_lexbuf *buf, fz_off_t *stmofsp, int *stmlenp, pdf_obj **encrypt, pdf_obj **id, pdf_obj **page, fz_off_t *tmpofs, pdf_obj **root);
+int pdf_repair_obj(fz_context *ctx, pdf_document *doc, pdf_lexbuf *buf, int64_t *stmofsp, int *stmlenp, pdf_obj **encrypt, pdf_obj **id, pdf_obj **page, int64_t *tmpofs, pdf_obj **root);
pdf_obj *pdf_progressive_advance(fz_context *ctx, pdf_document *doc, int pagenum);