1(***********************************************************************)
2(*                                                                     *)
3(*                          HEVEA                                      *)
4(*                                                                     *)
5(*  Luc Maranget, projet MOSCOVA, INRIA Rocquencourt                   *)
6(*                                                                     *)
7(*  Copyright 2006 Institut National de Recherche en Informatique et   *)
8(*  Automatique.  Distributed only by permission.                      *)
9(*                                                                     *)
10(***********************************************************************)
11
12
13module type Config = sig
14  val small_length : int
15end
16
17module Make(C:Config) = struct
18
19module Out = DoOut.Make(C)
20
21type t = { out : Out.t ; name : string }
22
23let get_name { name = name } = name
24
25let create name do_it = { out = do_it () ; name = name }
26
27let create_buff name = create name Out.create_buff
28and create_null () = create "NULL" Out.create_null
29and create_chan name =
30  create name (fun () -> Out.create_chan (open_out name))
31and close { out = out } = Out.close out
32
33let put { out = out } s = Out.put out s
34and put_char { out = out } c = Out.put_char out c
35and is_empty { out = out } = Out.is_empty out
36and to_string { out = out } = Out.to_string out
37and to_chan chan { out = out } = Out.to_chan chan out
38and copy { out = out1 } { out = out2 } = Out.copy out1 out2
39and flush { out = out } = Out.flush out
40let debug chan { out; name; } =
41  Printf.fprintf chan "Out=%s\n" name ;
42  Out.debug chan out ;
43  ()
44end
45