summaryrefslogtreecommitdiff
path: root/debugger/input_handling.mli
blob: e333c785d769a1a695b44f794865fe09627a4865 (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
(**************************************************************************)
(*                                                                        *)
(*                                 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.          *)
(*                                                                        *)
(**************************************************************************)

(***************************** Input control ***************************)

open Primitives

(*** Actives files. ***)

(* Add a file to the list of active files. *)
val add_file : io_channel -> (io_channel -> unit) -> unit

(* Remove a file from the list of actives files. *)
val remove_file : io_channel -> unit

(* Return the controller currently attached to the given file. *)
val current_controller : io_channel -> (io_channel -> unit)

(* Execute a function with `controller' attached to `file'. *)
(* ### controller file funct *)
val execute_with_other_controller :
  (io_channel -> unit) -> io_channel -> (unit -> 'a) -> 'a

(*** The "Main Loop" ***)

(* Call this function for exiting the main loop. *)
val exit_main_loop : 'a -> unit

(* Handle active files until `continue_main_loop' is false. *)
val main_loop : unit -> unit

(*** Managing user inputs ***)

(* Are we in interactive mode ? *)
val interactif : bool ref

val current_prompt : string ref

(* Where the user input come from. *)
val user_channel : io_channel ref

val read_user_input : bytes -> int -> int

(* Stop reading user input. *)
val stop_user_input : unit -> unit

(* Resume reading user input. *)
val resume_user_input : unit -> unit