summaryrefslogtreecommitdiff
path: root/debugger/primitives.mli
blob: f977b49803c4e8f1a767acc1c2ba24d8d535d1c1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
(**************************************************************************)
(*                                                                        *)
(*                                 OCaml                                  *)
(*                                                                        *)
(*           Jerome Vouillon, projet Cristal, INRIA Rocquencourt          *)
(*           OCaml port by John Malecki and Xavier Leroy                  *)
(*                                                                        *)
(*   Copyright 1996 Institut National de Recherche en Informatique et     *)
(*     en Automatique.                                                    *)
(*                                                                        *)
(*   All rights reserved.  This file is distributed under the terms of    *)
(*   the GNU Lesser General Public License version 2.1, with the          *)
(*   special exception on linking described in the file LICENSE.          *)
(*                                                                        *)
(**************************************************************************)

(********************* Basic functions and types ***********************)

(*** Miscellaneous ***)
val nothing : 'a -> unit

(*** Types and exceptions. ***)
exception Out_of_range

(*** Operations on lists. ***)

(* Remove an element from a list *)
val except : 'a -> 'a list -> 'a list

(* Position of an element in a list. Head of list has position 0. *)
val index : 'a -> 'a list -> int

(* Return the `n' first elements of `l'. *)
(* ### n l -> l' *)
val list_truncate : int -> 'a list -> 'a list

(* Separe the `n' first elements of `l' and the others. *)
(* ### n list -> (first, last) *)
val list_truncate2 : int -> 'a list -> 'a list * 'a list

(* Replace x by y in list l *)
(* ### x y l -> l' *)
val list_replace : 'a -> 'a -> 'a list -> 'a list

(*** Operations on strings. ***)

(* Remove blanks (spaces and tabs) at beginning and end of a string. *)
val string_trim : string -> string

(* isprefix s1 s2 returns true if s1 is a prefix of s2. *)
val isprefix : string -> string -> bool

(* Split a string at the given delimiter char *)
val split_string : char -> string -> string list

(*** I/O channels ***)

type io_channel = {
  io_in : in_channel;
  io_out : out_channel;
  io_fd : Unix.file_descr
  }

val io_channel_of_descr : Unix.file_descr -> io_channel
val close_io : io_channel -> unit
val std_io : io_channel