pp.mli 5.54 KB
Newer Older
Jean-Christophe Filliâtre's avatar
Jean-Christophe Filliâtre committed
1 2
(**************************************************************************)
(*                                                                        *)
MARCHE Claude's avatar
MARCHE Claude committed
3
(*  Copyright (C) 2010-2012                                               *)
4 5 6
(*    François Bobot                                                      *)
(*    Jean-Christophe Filliâtre                                           *)
(*    Claude Marché                                                       *)
MARCHE Claude's avatar
MARCHE Claude committed
7
(*    Guillaume Melquiond                                                 *)
8
(*    Andrei Paskevich                                                    *)
Jean-Christophe Filliâtre's avatar
Jean-Christophe Filliâtre committed
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
(*                                                                        *)
(*  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
28 29
val print_list :
  (formatter -> unit -> unit) ->
Jean-Christophe Filliâtre's avatar
Jean-Christophe Filliâtre committed
30 31
  (formatter -> 'a -> unit) -> formatter -> 'a list -> unit
val print_list_or_default :
32
  string -> (formatter -> unit -> unit) ->
Jean-Christophe Filliâtre's avatar
Jean-Christophe Filliâtre committed
33 34 35 36 37
  (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 :
38 39 40
  start:(Format.formatter -> unit -> unit) ->
  stop:(Format.formatter -> unit -> unit) ->
  sep:(Format.formatter -> unit -> unit) ->
Jean-Christophe Filliâtre's avatar
Jean-Christophe Filliâtre committed
41
  (Format.formatter -> 'b -> unit) -> Format.formatter -> 'b list -> unit
Francois Bobot's avatar
Francois Bobot committed
42

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

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

59
val print_iter2:
60 61 62
  (('a -> 'b -> unit) -> 'c -> unit) ->
  (Format.formatter -> unit -> unit) ->
  (Format.formatter -> unit -> unit) ->
63 64 65 66 67 68 69 70 71 72 73 74
  (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) ->
75
  Format.formatter -> 'c -> unit
76 77 78 79 80
(**  [print_iter22 iter sep print fmt t]
     iter iterator on [t : 'c]
     print k v sep () print k v sep () ...
*)

81

Jean-Christophe Filliâtre's avatar
Jean-Christophe Filliâtre committed
82 83
val space : formatter -> unit -> unit
val alt : formatter -> unit -> unit
84
val alt2 : formatter -> unit -> unit
Jean-Christophe Filliâtre's avatar
Jean-Christophe Filliâtre committed
85
val newline : formatter -> unit -> unit
86
val newline2 : formatter -> unit -> unit
87
val dot : formatter -> unit -> unit
Jean-Christophe Filliâtre's avatar
Jean-Christophe Filliâtre committed
88
val comma : formatter -> unit -> unit
MARCHE Claude's avatar
MARCHE Claude committed
89
val star : formatter -> unit -> unit
Jean-Christophe Filliâtre's avatar
Jean-Christophe Filliâtre committed
90 91 92
val simple_comma : formatter -> unit -> unit
val semi : formatter -> unit -> unit
val underscore : formatter -> unit -> unit
Francois Bobot's avatar
Francois Bobot committed
93
val equal : formatter -> unit -> unit
Jean-Christophe Filliâtre's avatar
Jean-Christophe Filliâtre committed
94 95 96 97 98 99 100 101 102 103 104 105
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
106
val print0 : formatter -> unit -> unit
Jean-Christophe Filliâtre's avatar
Jean-Christophe Filliâtre committed
107
val hov : int -> formatter -> ('a -> unit) -> 'a -> unit
108 109
val add_flush : (formatter -> 'a -> unit) -> formatter -> 'a -> unit

Jean-Christophe Filliâtre's avatar
Jean-Christophe Filliâtre committed
110 111 112 113 114

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
115
val print_in_file_no_close :
116
  ?margin:int -> (Format.formatter -> unit) -> string -> out_channel
Jean-Christophe Filliâtre's avatar
Jean-Christophe Filliâtre committed
117
val print_in_file : ?margin:int -> (Format.formatter -> unit) -> string -> unit
118 119


120 121
val print_list_opt :
  (formatter -> unit -> unit) ->
122
  (formatter -> 'a -> bool) -> formatter -> 'a list -> bool
MARCHE Claude's avatar
MARCHE Claude committed
123 124 125


val string_of : (Format.formatter -> 'a -> unit) -> 'a -> string
126 127
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
128 129

val wnl : Format.formatter -> unit
130

131 132 133
val sprintf :
  ('b,  formatter, unit, string) Pervasives.format4 -> 'b

134 135 136
val sprintf_wnl :
  ('b,  formatter, unit, string) Pervasives.format4 -> 'b

137 138 139 140
module Ansi :
sig
  val set_column : Format.formatter -> int -> unit
end