From c22e6a6dc2bf6acbac955bd5fbdd896329dfd725 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Mon, 9 Nov 2015 14:17:00 +0100 Subject: Use fz_output instead of FILE* for most of our output needs. Use fz_output in debug printing functions. Use fz_output in pdfshow. Use fz_output in fz_trace_device instead of stdout. Use fz_output in pdf-write.c. Rename fz_new_output_to_filename to fz_new_output_with_path. Add seek and tell to fz_output. Remove unused functions like fz_fprintf. Fix typo in pdf_print_obj. --- source/fitz/stream-open.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'source/fitz/stream-open.c') diff --git a/source/fitz/stream-open.c b/source/fitz/stream-open.c index b4df2a61..e9836dd1 100644 --- a/source/fitz/stream-open.c +++ b/source/fitz/stream-open.c @@ -1,5 +1,14 @@ #include "mupdf/fitz.h" +int +fz_file_exists(fz_context *ctx, const char *path) +{ + FILE *file = fz_fopen(path, "rb"); + if (file) + fclose(file); + return !!file; +} + fz_stream * fz_new_stream(fz_context *ctx, void *state, fz_stream_next_fn *next, fz_stream_close_fn *close) { -- cgit v1.2.3