From 97fefe1fcca363a1317e066e7f4b99b9c1e9987b Mon Sep 17 00:00:00 2001 From: Stephane Glondu Date: Thu, 12 Jan 2012 16:02:20 +0100 Subject: Imported Upstream version 8.4~beta --- lib/pp_control.ml | 34 +++++----------------------------- 1 file changed, 5 insertions(+), 29 deletions(-) (limited to 'lib/pp_control.ml') diff --git a/lib/pp_control.ml b/lib/pp_control.ml index a7ad553b..cefd08c5 100644 --- a/lib/pp_control.ml +++ b/lib/pp_control.ml @@ -1,13 +1,11 @@ (************************************************************************) (* v * The Coq Proof Assistant / The Coq Development Team *) -(* int -> int -> unit ; - fp_flush_function : unit -> unit } - -(* Output functions for stdout and stderr *) - -let std_fp = { - fp_output = stdout ; - fp_output_function = output stdout; - fp_flush_function = (fun () -> flush stdout) } - -let err_fp = { - fp_output = stderr ; - fp_output_function = output stderr; - fp_flush_function = (fun () -> flush stderr) } - (* with_fp : 'a pp_formatter_params -> Format.formatter * returns of formatter for given formatter functions *) -let with_fp fp = - let ft = Format.make_formatter fp.fp_output_function fp.fp_flush_function in - Format.pp_set_formatter_out_channel ft fp.fp_output; +let with_fp chan out_function flush_function = + let ft = Format.make_formatter out_function flush_function in + Format.pp_set_formatter_out_channel ft chan; ft (* Output on a channel ch *) let with_output_to ch = - let ft = with_fp { fp_output = ch ; - fp_output_function = (output ch) ; - fp_flush_function = (fun () -> flush ch) } in + let ft = with_fp ch (output ch) (fun () -> flush ch) in set_gp ft deep_gp; ft -- cgit v1.2.3