diff options
author | Tor Andersson <tor.andersson@artifex.com> | 2015-11-09 14:17:00 +0100 |
---|---|---|
committer | Tor Andersson <tor.andersson@artifex.com> | 2015-12-11 12:11:31 +0100 |
commit | c22e6a6dc2bf6acbac955bd5fbdd896329dfd725 (patch) | |
tree | d9d84d3a6a74ed74c9d470b532097769545e8dc6 /source/fitz/output-pcl.c | |
parent | 95b928431f233052e4bbbd1b2bf9fc705657b5a7 (diff) | |
download | mupdf-c22e6a6dc2bf6acbac955bd5fbdd896329dfd725.tar.xz |
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.
Diffstat (limited to 'source/fitz/output-pcl.c')
-rw-r--r-- | source/fitz/output-pcl.c | 38 |
1 files changed, 2 insertions, 36 deletions
diff --git a/source/fitz/output-pcl.c b/source/fitz/output-pcl.c index 1299e73d..9d21a6d3 100644 --- a/source/fitz/output-pcl.c +++ b/source/fitz/output-pcl.c @@ -792,57 +792,23 @@ fz_output_pcl_bitmap(fz_context *ctx, fz_output *out, const fz_bitmap *bitmap, f void fz_write_pcl(fz_context *ctx, fz_pixmap *pixmap, char *filename, int append, fz_pcl_options *pcl) { - FILE *fp; - fz_output *out = NULL; - - fp = fz_fopen(filename, append ? "ab" : "wb"); - if (!fp) - { - fz_throw(ctx, FZ_ERROR_GENERIC, "cannot open file '%s': %s", filename, strerror(errno)); - } - - fz_var(out); - + fz_output *out = fz_new_output_with_path(ctx, filename, append); fz_try(ctx) - { - out = fz_new_output_with_file(ctx, fp, 1); fz_output_pcl(ctx, out, pixmap, pcl); - } fz_always(ctx) - { fz_drop_output(ctx, out); - } fz_catch(ctx) - { fz_rethrow(ctx); - } } void fz_write_pcl_bitmap(fz_context *ctx, fz_bitmap *bitmap, char *filename, int append, fz_pcl_options *pcl) { - FILE *fp; - fz_output *out = NULL; - - fp = fz_fopen(filename, append ? "ab" : "wb"); - if (!fp) - { - fz_throw(ctx, FZ_ERROR_GENERIC, "cannot open file '%s': %s", filename, strerror(errno)); - } - - fz_var(out); - + fz_output *out = fz_new_output_with_path(ctx, filename, append); fz_try(ctx) - { - out = fz_new_output_with_file(ctx, fp, 1); fz_output_pcl_bitmap(ctx, out, bitmap, pcl); - } fz_always(ctx) - { fz_drop_output(ctx, out); - } fz_catch(ctx) - { fz_rethrow(ctx); - } } |