diff options
author | Robin Watts <Robin.Watts@artifex.com> | 2017-03-23 18:55:45 -0400 |
---|---|---|
committer | Robin Watts <Robin.Watts@artifex.com> | 2017-03-23 18:56:52 -0400 |
commit | 6979982ba2900f451c801d35bb7e52413a89d26e (patch) | |
tree | 2b74146bc04e4bd66d00734570947a6d3818344c /source/fitz/writer.c | |
parent | 031c7035652d3c967321c9c308dea7cfb1c0e6fa (diff) | |
download | mupdf-6979982ba2900f451c801d35bb7e52413a89d26e.tar.xz |
Add fz_new_writer function.
Moves document_writers into the same style as
fz_new_{image,document,page} etc.
Diffstat (limited to 'source/fitz/writer.c')
-rw-r--r-- | source/fitz/writer.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/source/fitz/writer.c b/source/fitz/writer.c index 3c53f633..c89ee4e0 100644 --- a/source/fitz/writer.c +++ b/source/fitz/writer.c @@ -48,6 +48,19 @@ fz_option_eq(const char *a, const char *b) return !strncmp(a, b, n) && (a[n] == ',' || a[n] == 0); } +fz_document_writer *fz_new_writer_of_size(fz_context *ctx, size_t size, fz_document_writer_begin_page_fn *begin_page, + fz_document_writer_end_page_fn *end_page, fz_document_writer_close_writer_fn *close, fz_document_writer_drop_writer_fn *drop) +{ + fz_document_writer *wri = Memento_label(fz_calloc(ctx, 1, size), "fz_document_writer"); + + wri->begin_page = begin_page; + wri->end_page = end_page; + wri->close_writer = close; + wri->drop_writer = drop; + + return wri; +} + fz_document_writer * fz_new_document_writer(fz_context *ctx, const char *path, const char *format, const char *options) { |