diff options
author | Sebastian Rasmussen <sebras@gmail.com> | 2016-04-19 16:54:52 +0200 |
---|---|---|
committer | Tor Andersson <tor.andersson@artifex.com> | 2016-05-13 11:42:00 +0200 |
commit | b994d72069d761c8645cc6a0638bde21109c0b40 (patch) | |
tree | 2d95cbdb501d81b49210d6c115b51bb5fa9c62a7 /source/tools/mudraw.c | |
parent | e67981e781fd087d7cd19e2373b3e054375e82ad (diff) | |
download | mupdf-b994d72069d761c8645cc6a0638bde21109c0b40.tar.xz |
Introduce a general output context.
This makes it possible to redirect standard out and standard error output
streams to output streams of your liking.
This means that now you can, in gdb, type:
(gdb) call pdf_print_obj(ctx, fz_stdout(ctx), obj, 0)
(gdb) call fflush(0)
or when dealing with an unresolved indirect reference:
(gdb) call pdf_print_obj(ctx, fz_stdout(ctx), pdf_resolve_indirect(ctx, ref), 0)
(gdb) call fflush(0)
Diffstat (limited to 'source/tools/mudraw.c')
-rw-r--r-- | source/tools/mudraw.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/source/tools/mudraw.c b/source/tools/mudraw.c index 2717b5f0..6523380b 100644 --- a/source/tools/mudraw.c +++ b/source/tools/mudraw.c @@ -698,7 +698,7 @@ static void dodrawpage(fz_context *ctx, fz_page *page, fz_display_list *list, in fz_output *out; if (!strcmp(output, "-")) - out = fz_new_output_with_file_ptr(ctx, stdout, 0); + out = fz_stdout(ctx); else { sprintf(buf, output, pagenum); @@ -1606,7 +1606,7 @@ int mudraw_main(int argc, char **argv) out = fz_new_output_with_path(ctx, output, 0); } else - out = fz_new_output_with_file_ptr(ctx, stdout, 0); + out = fz_stdout(ctx); timing.count = 0; timing.total = 0; |