summaryrefslogtreecommitdiff
path: root/source/fitz/stream-open.c
diff options
context:
space:
mode:
Diffstat (limited to 'source/fitz/stream-open.c')
-rw-r--r--source/fitz/stream-open.c9
1 files changed, 9 insertions, 0 deletions
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)
{