aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/pp_control.ml30
-rw-r--r--lib/pp_control.mli9
2 files changed, 4 insertions, 35 deletions
diff --git a/lib/pp_control.ml b/lib/pp_control.ml
index 289a15926..cefd08c55 100644
--- a/lib/pp_control.ml
+++ b/lib/pp_control.ml
@@ -47,40 +47,18 @@ let get_gp ft =
max_depth = Format.pp_get_max_boxes ft ();
ellipsis = Format.pp_get_ellipsis_text ft () }
-
-(* Output functions of pretty-printing *)
-
-type 'a pp_formatter_params = {
- fp_output : out_channel ;
- fp_output_function : string -> 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
diff --git a/lib/pp_control.mli b/lib/pp_control.mli
index d8970d8db..c66255f96 100644
--- a/lib/pp_control.mli
+++ b/lib/pp_control.mli
@@ -23,15 +23,6 @@ val get_gp : Format.formatter -> pp_global_params
(** {6 Output functions of pretty-printing. } *)
-type 'a pp_formatter_params = {
- fp_output : out_channel;
- fp_output_function : string -> int -> int -> unit;
- fp_flush_function : unit -> unit }
-
-val std_fp : (int*string) pp_formatter_params
-val err_fp : (int*string) pp_formatter_params
-
-val with_fp : 'a pp_formatter_params -> Format.formatter
val with_output_to : out_channel -> Format.formatter
val std_ft : Format.formatter ref