summaryrefslogtreecommitdiff
path: root/source/fitz/stream-open.c
diff options
context:
space:
mode:
authorPaul Gardiner <paul.gardiner@artifex.com>2018-01-04 15:11:24 +0000
committerPaul Gardiner <paul.gardiner@artifex.com>2018-01-19 13:52:25 +0000
commit457873fbf7fd6d40242722f3a51b41428302d0ca (patch)
tree2539ea3bc1490012f5f5bd95d0f9064d999eca04 /source/fitz/stream-open.c
parent371890461adeff0bcc8d4986f666c59055bebc70 (diff)
downloadmupdf-457873fbf7fd6d40242722f3a51b41428302d0ca.tar.xz
Add fz_output_as_stream
This provides a way for some output streams to also be read, a feature needed for the sake of document signing. Currently this is supported only for file output.
Diffstat (limited to 'source/fitz/stream-open.c')
-rw-r--r--source/fitz/stream-open.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/source/fitz/stream-open.c b/source/fitz/stream-open.c
index ffd61b66..1a99ad52 100644
--- a/source/fitz/stream-open.c
+++ b/source/fitz/stream-open.c
@@ -144,6 +144,14 @@ fz_open_file_ptr(fz_context *ctx, FILE *file)
return stm;
}
+fz_stream *fz_open_file_ptr_no_close(fz_context *ctx, FILE *file)
+{
+ fz_stream *stm = fz_open_file_ptr(ctx, file);
+ /* We don't own the file ptr. Ensure we don't close it */
+ stm->close = NULL;
+ return stm;
+}
+
fz_stream *
fz_open_file(fz_context *ctx, const char *name)
{