Coccinelle release 1.0.0-rc15
[bpt/coccinelle.git] / commons / common.mli
index 0701066..9d697ed 100644 (file)
@@ -142,14 +142,15 @@ val dump: 'a -> string
 (* see flag: val disable_pr2_once : bool ref *)
 val _already_printed : (string, bool) Hashtbl.t
 val pr2_once : string -> unit
+val clear_pr2_once : unit -> unit
 
 val mk_pr2_wrappers: bool ref -> (string -> unit) * (string -> unit)
 
 
 val redirect_stdout_opt : filename option -> (unit -> 'a) -> 'a
 val redirect_stdout_stderr : filename -> (unit -> unit) -> unit
-val redirect_stdin : filename -> (unit -> unit) -> unit
-val redirect_stdin_opt : filename option -> (unit -> unit) -> unit
+val redirect_stdin : filename -> (unit -> 'a) -> 'a
+val redirect_stdin_opt : filename option -> (unit -> 'a) -> 'a
 
 val with_pr2_to_string: (unit -> unit) -> string list
 
@@ -257,6 +258,8 @@ type score_result = Ok | Pb of string
 type score =      (string (* usually a filename *), score_result) Hashtbl.t
 type score_list = (string (* usually a filename *) * score_result) list
 val empty_score : unit -> score
+val load_score : string -> unit -> score
+val save_score : score -> string -> unit
 val regression_testing :
   score -> filename (* old score file on disk (usually in /tmp) *) -> unit
 val regression_testing_vs: score -> score -> score
@@ -438,6 +441,14 @@ val cache_computation_robust :
   (unit -> 'a) ->
   'a
 
+val cache_computation_robust_in_dir :
+  string option (* destination directory *) -> filename ->
+  string (* extension for marshalled object *) ->
+  (filename list * 'x) ->
+  string (* extension for marshalled dependencies *) ->
+  (unit -> 'a) ->
+  'a
+
 
 
 val once : ('a -> unit) -> ('a -> unit)
@@ -792,6 +803,7 @@ val partition_either3 :
 
 val filter_some : 'a option list -> 'a list
 val map_filter : ('a -> 'b option) -> 'a list -> 'b list
+val tail_map_filter : ('a -> 'b option) -> 'a list -> 'b list
 val find_some : ('a -> 'b option) -> 'a list -> 'b
 
 val list_to_single_or_exn: 'a list -> 'a
@@ -1135,6 +1147,7 @@ val timeout_function : int -> (unit -> 'a) -> 'a
 
 val timeout_function_opt : int option -> (unit -> 'a) -> 'a
 
+val remove_file : string -> unit
 
 (* creation of /tmp files, a la gcc
  * ex: new_temp_file "cocci" ".c" will give "/tmp/cocci-3252-434465.c"
@@ -1757,6 +1770,7 @@ val empty_graph : 'a list * 'b list
 (* mostly alias to functions in List *)
 
 val map : ('a -> 'b) -> 'a list -> 'b list
+val tail_map : ('a -> 'b) -> 'a list -> 'b list
 val filter : ('a -> bool) -> 'a list -> 'a list
 val fold : ('a -> 'b -> 'a) -> 'a -> 'b list -> 'a
 
@@ -1956,6 +1970,7 @@ val member_h_env_key : 'a -> ('a, 'b) scoped_h_env -> bool
 
 val new_scope_h : ('a, 'b) scoped_h_env ref -> unit
 val del_scope_h : ('a, 'b) scoped_h_env ref -> unit
+val clean_scope_h : ('a, 'b) scoped_h_env ref -> unit
 
 val do_in_new_scope_h : ('a, 'b) scoped_h_env ref -> (unit -> unit) -> unit