Module Ben_frontends.Utils

val parse_control_in_channel : 'a Ben.Package.kind -> string -> Stdlib.in_channel -> (string -> bool) -> ('a Ben.Package.Name.t -> 'a Ben.Package.t -> 'b -> 'b) -> 'b -> 'b
val parse_control_file : 'a Ben.Package.kind -> string -> (string -> bool) -> ('a Ben.Package.Name.t -> 'a Ben.Package.t -> 'b -> 'b) -> 'b -> 'b
val parse_config_from_in_channel : ?filename:string -> Stdlib.in_channel -> Ben.Types.config
val parse_config_file : string -> Ben.Types.config
val with_out_file : string -> (Stdlib.out_channel -> 'a) -> 'a

with_out_file file f calls f on a channel writing to file ^ ".new", then renames it to file. If f raises, the temporary file is removed and file is left as it was.

val with_formatter_to_file : string -> (Stdlib.Format.formatter -> 'a) -> 'a

Same as with_out_file, with a formatter, flushed before the rename.

val dump_to_file : string -> string -> unit

dump_to_file file s writes s to file with with_out_file.

val dump_xhtml_to_file : string -> Tyxml.Html.doc -> unit

Prints a page to a file with with_out_file.

val parse_release : string -> Ben.Stanza.t

Prints a page to a file with with_out_file.