From e1e83141b57624c2ff3089ff09fe8d99a70473e9 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Wed, 19 Nov 2014 14:52:26 +0100 Subject: Add convenience fz_read_file function. Read the contents of a file into a fz_buffer in one go. --- include/mupdf/fitz/stream.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'include') diff --git a/include/mupdf/fitz/stream.h b/include/mupdf/fitz/stream.h index f7eb6f16..fb3ef932 100644 --- a/include/mupdf/fitz/stream.h +++ b/include/mupdf/fitz/stream.h @@ -142,6 +142,11 @@ int fz_read(fz_stream *stm, unsigned char *data, int len); */ fz_buffer *fz_read_all(fz_stream *stm, int initial); +/* + fz_read_file: Read all the contents of a file into a buffer. +*/ +fz_buffer *fz_read_file(fz_context *ctx, const char *filename); + enum { FZ_STREAM_META_PROGRESSIVE = 1, -- cgit v1.2.3