|
rpm-build |
0f2925 |
(*
|
|
rpm-build |
0f2925 |
* Std - Additional functions
|
|
rpm-build |
0f2925 |
* Copyright (C) 2003 Nicolas Cannasse
|
|
rpm-build |
0f2925 |
*
|
|
rpm-build |
0f2925 |
* This library is free software; you can redistribute it and/or
|
|
rpm-build |
0f2925 |
* modify it under the terms of the GNU Lesser General Public
|
|
rpm-build |
0f2925 |
* License as published by the Free Software Foundation; either
|
|
rpm-build |
0f2925 |
* version 2.1 of the License, or (at your option) any later version,
|
|
rpm-build |
0f2925 |
* with the special exception on linking described in file LICENSE.
|
|
rpm-build |
0f2925 |
*
|
|
rpm-build |
0f2925 |
* This library is distributed in the hope that it will be useful,
|
|
rpm-build |
0f2925 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
rpm-build |
0f2925 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
rpm-build |
0f2925 |
* Lesser General Public License for more details.
|
|
rpm-build |
0f2925 |
*
|
|
rpm-build |
0f2925 |
* You should have received a copy of the GNU Lesser General Public
|
|
rpm-build |
0f2925 |
* License along with this library; if not, write to the Free Software
|
|
rpm-build |
0f2925 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
rpm-build |
0f2925 |
*)
|
|
rpm-build |
0f2925 |
|
|
rpm-build |
0f2925 |
(** Additional functions. *)
|
|
rpm-build |
0f2925 |
|
|
rpm-build |
0f2925 |
val input_lines : in_channel -> string Enum.t
|
|
rpm-build |
0f2925 |
(** Returns an enumeration over lines of an input channel, as read by the
|
|
rpm-build |
0f2925 |
[input_line] function. *)
|
|
rpm-build |
0f2925 |
|
|
rpm-build |
0f2925 |
val input_chars : in_channel -> char Enum.t
|
|
rpm-build |
0f2925 |
(** Returns an enumeration over characters of an input channel. *)
|
|
rpm-build |
0f2925 |
|
|
rpm-build |
0f2925 |
val input_list : in_channel -> string list
|
|
rpm-build |
0f2925 |
(** Returns the list of lines read from an input channel. *)
|
|
rpm-build |
0f2925 |
|
|
rpm-build |
0f2925 |
val input_all : in_channel -> string
|
|
rpm-build |
0f2925 |
(** Return the whole contents of an input channel as a single
|
|
rpm-build |
0f2925 |
string. *)
|
|
rpm-build |
0f2925 |
|
|
rpm-build |
0f2925 |
val print_bool : bool -> unit
|
|
rpm-build |
0f2925 |
(** Print a boolean to stdout. *)
|
|
rpm-build |
0f2925 |
|
|
rpm-build |
0f2925 |
val prerr_bool : bool -> unit
|
|
rpm-build |
0f2925 |
(** Print a boolean to stderr. *)
|
|
rpm-build |
0f2925 |
|
|
rpm-build |
0f2925 |
val input_file : ?bin:bool -> string -> string
|
|
rpm-build |
0f2925 |
(** returns the data of a given filename. *)
|
|
rpm-build |
0f2925 |
|
|
rpm-build |
0f2925 |
val output_file : filename:string -> text:string -> unit
|
|
rpm-build |
0f2925 |
(** creates a filename, write text into it and close it. *)
|
|
rpm-build |
0f2925 |
|
|
rpm-build |
0f2925 |
val string_of_char : char -> string
|
|
rpm-build |
0f2925 |
(** creates a string from a char. *)
|
|
rpm-build |
0f2925 |
|
|
rpm-build |
0f2925 |
external identity : 'a -> 'a = "%identity"
|
|
rpm-build |
0f2925 |
(** the identity function. *)
|
|
rpm-build |
0f2925 |
|
|
rpm-build |
0f2925 |
val unique : unit -> int
|
|
rpm-build |
0f2925 |
(** returns an unique identifier every time it is called. *)
|
|
rpm-build |
0f2925 |
|
|
rpm-build |
0f2925 |
val dump : 'a -> string
|
|
rpm-build |
0f2925 |
(** represent a runtime value as a string. Since types are lost at compile
|
|
rpm-build |
0f2925 |
time, the representation might not match your type. For example, None
|
|
rpm-build |
0f2925 |
will be printed 0 since they share the same runtime representation. *)
|
|
rpm-build |
0f2925 |
|
|
rpm-build |
0f2925 |
val print : 'a -> unit
|
|
rpm-build |
0f2925 |
(** print the representation of a runtime value on stdout.
|
|
rpm-build |
0f2925 |
See remarks for [dump]. *)
|
|
rpm-build |
0f2925 |
|
|
rpm-build |
0f2925 |
val finally : (unit -> unit) -> ('a -> 'b) -> 'a -> 'b
|
|
rpm-build |
0f2925 |
(** [finally fend f x] calls [f x] and then [fend()] even if [f x] raised
|
|
rpm-build |
0f2925 |
an exception. *)
|