1 (***********************************************************************)
5 (* Jerome Vouillon, projet Cristal, INRIA Rocquencourt *)
6 (* Objective Caml port by John Malecki and Xavier Leroy *)
8 (* Copyright 1996 Institut National de Recherche en Informatique et *)
9 (* en Automatique. All rights reserved. This file is distributed *)
10 (* under the terms of the Q Public License version 1.0. *)
12 (***********************************************************************)
14 (* $Id: primitives.mli 9226 2009-04-02 09:44:21Z xclerc $ *)
16 (********************* Basic functions and types ***********************)
18 (*** Miscellaneous ***)
19 val nothing : 'a -> unit
21 (*** Types and exceptions. ***)
22 exception Out_of_range
24 (*** Operations on lists. ***)
26 (* Remove an element from a list *)
27 val except : 'a -> 'a list -> 'a list
29 (* Position of an element in a list. Head of list has position 0. *)
30 val index : 'a -> 'a list -> int
32 (* Return the `n' first elements of `l'. *)
34 val list_truncate : int -> 'a list -> 'a list
36 (* Separe the `n' first elements of `l' and the others. *)
37 (* ### n list -> (first, last) *)
38 val list_truncate2 : int -> 'a list -> 'a list * 'a list
40 (* Replace x by y in list l *)
42 val list_replace : 'a -> 'a -> 'a list -> 'a list
44 (*** Operations on strings. ***)
46 (* Remove blanks (spaces and tabs) at beginning and end of a string. *)
47 val string_trim : string -> string
49 (* isprefix s1 s2 returns true if s1 is a prefix of s2. *)
50 val isprefix : string -> string -> bool
52 (* Split a string at the given delimiter char *)
53 val split_string : char -> string -> string list
55 (*** I/O channels ***)
60 io_fd : Unix.file_descr
63 val io_channel_of_descr : Unix.file_descr -> io_channel
64 val close_io : io_channel -> unit
65 val std_io : io_channel