pp.mli 5.23 KB
Newer Older
Jean-Christophe Filliâtre's avatar
Jean-Christophe Filliâtre committed
1 2
(**************************************************************************)
(*                                                                        *)
3
(*  Copyright (C) 2010-                                                   *)
MARCHE Claude's avatar
MARCHE Claude committed
4 5 6
(*    François Bobot                                                     *)
(*    Jean-Christophe Filliâtre                                          *)
(*    Claude Marché                                                      *)
7
(*    Andrei Paskevich                                                    *)
Jean-Christophe Filliâtre's avatar
Jean-Christophe Filliâtre committed
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
(*                                                                        *)
(*  This software is free software; you can redistribute it and/or        *)
(*  modify it under the terms of the GNU Library General Public           *)
(*  License version 2.1, with the special exception on linking            *)
(*  described in file LICENSE.                                            *)
(*                                                                        *)
(*  This software is distributed in the hope that it will be useful,      *)
(*  but WITHOUT ANY WARRANTY; without even the implied warranty of        *)
(*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.                  *)
(*                                                                        *)
(**************************************************************************)

(*i $Id: pp.mli,v 1.22 2009-10-19 11:55:33 bobot Exp $ i*)

open Format

val print_option : (formatter -> 'a -> unit) -> formatter -> 'a option -> unit
val print_option_or_default :
  string -> (formatter -> 'a -> unit) -> formatter -> 'a option -> unit
27 28
val print_list :
  (formatter -> unit -> unit) ->
Jean-Christophe Filliâtre's avatar
Jean-Christophe Filliâtre committed
29 30
  (formatter -> 'a -> unit) -> formatter -> 'a list -> unit
val print_list_or_default :
31
  string -> (formatter -> unit -> unit) ->
Jean-Christophe Filliâtre's avatar
Jean-Christophe Filliâtre committed
32 33 34 35 36 37 38 39 40
  (formatter -> 'a -> unit) -> formatter -> 'a list -> unit
val print_list_par :
  (Format.formatter -> unit -> 'a) ->
  (Format.formatter -> 'b -> unit) -> Format.formatter -> 'b list -> unit
val print_list_delim :
  (Format.formatter -> unit -> unit) ->
  (Format.formatter -> unit -> unit) ->
  (Format.formatter -> unit -> unit) ->
  (Format.formatter -> 'b -> unit) -> Format.formatter -> 'b list -> unit
Francois Bobot's avatar
Francois Bobot committed
41

Jean-Christophe Filliâtre's avatar
Jean-Christophe Filliâtre committed
42 43 44 45
val print_pair_delim :
  (Format.formatter -> unit -> unit) ->
  (Format.formatter -> unit -> unit) ->
  (Format.formatter -> unit -> unit) ->
46
  (Format.formatter -> 'a -> unit) ->
Jean-Christophe Filliâtre's avatar
Jean-Christophe Filliâtre committed
47
  (Format.formatter -> 'b -> unit) -> Format.formatter -> 'a * 'b -> unit
Francois Bobot's avatar
Francois Bobot committed
48
val print_pair :
49
  (Format.formatter -> 'a -> unit) ->
Francois Bobot's avatar
Francois Bobot committed
50
  (Format.formatter -> 'b -> unit) -> Format.formatter -> 'a * 'b -> unit
51

52
val print_iter1 :
53
  (('a -> unit) -> 'b -> unit) ->
54 55
  (Format.formatter -> unit -> unit) ->
  (Format.formatter -> 'a -> unit) ->
56 57
  Format.formatter -> 'b -> unit

58
val print_iter2:
59 60 61
  (('a -> 'b -> unit) -> 'c -> unit) ->
  (Format.formatter -> unit -> unit) ->
  (Format.formatter -> unit -> unit) ->
62 63 64 65 66 67 68 69 70 71 72 73
  (Format.formatter -> 'a -> unit) ->
  (Format.formatter -> 'b -> unit) ->
  Format.formatter -> 'c -> unit
(**  [print_iter2 iter sep1 sep2 print1 print2 fmt t]
     iter iterator on [t : 'c]
     print1 k sep2 () print2 v sep1 () print1  sep2 () ...
*)

val print_iter22:
  (('a -> 'b -> unit) -> 'c -> unit) ->
  (Format.formatter -> unit -> unit) ->
  (Format.formatter -> 'a -> 'b -> unit) ->
74
  Format.formatter -> 'c -> unit
75 76 77 78 79
(**  [print_iter22 iter sep print fmt t]
     iter iterator on [t : 'c]
     print k v sep () print k v sep () ...
*)

80

Jean-Christophe Filliâtre's avatar
Jean-Christophe Filliâtre committed
81 82 83
val space : formatter -> unit -> unit
val alt : formatter -> unit -> unit
val newline : formatter -> unit -> unit
84
val newline2 : formatter -> unit -> unit
85
val dot : formatter -> unit -> unit
Jean-Christophe Filliâtre's avatar
Jean-Christophe Filliâtre committed
86
val comma : formatter -> unit -> unit
MARCHE Claude's avatar
MARCHE Claude committed
87
val star : formatter -> unit -> unit
Jean-Christophe Filliâtre's avatar
Jean-Christophe Filliâtre committed
88 89 90
val simple_comma : formatter -> unit -> unit
val semi : formatter -> unit -> unit
val underscore : formatter -> unit -> unit
Francois Bobot's avatar
Francois Bobot committed
91
val equal : formatter -> unit -> unit
Jean-Christophe Filliâtre's avatar
Jean-Christophe Filliâtre committed
92 93 94 95 96 97 98 99 100 101 102 103 104
val arrow : formatter -> unit -> unit
val lbrace : formatter -> unit -> unit
val rbrace : formatter -> unit -> unit
val lsquare : formatter -> unit -> unit
val rsquare : formatter -> unit -> unit
val lparen : formatter -> unit -> unit
val rparen : formatter -> unit -> unit
val lchevron : formatter -> unit -> unit
val rchevron : formatter -> unit -> unit
val nothing : formatter -> 'a -> unit
val string : formatter -> string -> unit
val constant_string : string -> formatter -> unit -> unit
val hov : int -> formatter -> ('a -> unit) -> 'a -> unit
105 106
val add_flush : (formatter -> 'a -> unit) -> formatter -> 'a -> unit

Jean-Christophe Filliâtre's avatar
Jean-Christophe Filliâtre committed
107 108 109 110 111

val open_formatter : ?margin:int -> out_channel -> formatter
val close_formatter : formatter -> unit
val open_file_and_formatter : ?margin:int -> string -> out_channel * formatter
val close_file_and_formatter : out_channel * formatter -> unit
112
val print_in_file_no_close :
113
  ?margin:int -> (Format.formatter -> unit) -> string -> out_channel
Jean-Christophe Filliâtre's avatar
Jean-Christophe Filliâtre committed
114
val print_in_file : ?margin:int -> (Format.formatter -> unit) -> string -> unit
115 116


117 118
val print_list_opt :
  (formatter -> unit -> unit) ->
119
  (formatter -> 'a -> bool) -> formatter -> 'a list -> bool
MARCHE Claude's avatar
MARCHE Claude committed
120 121 122


val string_of : (Format.formatter -> 'a -> unit) -> 'a -> string
123 124
val string_of_wnl : (Format.formatter -> 'a -> unit) -> 'a -> string
  (** same as {!string_of} but without newline *)
François Bobot's avatar
François Bobot committed
125 126

val wnl : Format.formatter -> unit
127 128 129 130 131

module Ansi :
sig
  val set_column : Format.formatter -> int -> unit
end