Merge commit 'ocaml3102'
[ocaml.git] / ocamlbuild / resource.mli
blobbd22cae8bb05cbbaf2df468a5d2bbe2cbb39e3ec
1 (***********************************************************************)
2 (* ocamlbuild *)
3 (* *)
4 (* Nicolas Pouillard, Berke Durak, projet Gallium, INRIA Rocquencourt *)
5 (* *)
6 (* Copyright 2007 Institut National de Recherche en Informatique et *)
7 (* en Automatique. All rights reserved. This file is distributed *)
8 (* under the terms of the Q Public License version 1.0. *)
9 (* *)
10 (***********************************************************************)
12 (* $Id$ *)
13 (* Original author: Nicolas Pouillard *)
14 open My_std
16 open Pathname
17 type resource_pattern
18 type env
20 module Resources : Set.S with type elt = t
22 module Cache :
23 sig
24 type cache_entry
25 type suspension
27 type build_status =
28 | Bbuilt
29 | Bcannot_be_built
30 | Bnot_built_yet
31 | Bsuspension of suspension
33 val clean : unit -> unit
34 val resource_state : t -> build_status
35 val resource_changed : t -> unit
36 val resource_has_changed : t -> bool
37 val resource_built : t -> unit
38 val resource_failed : t -> unit
39 val import_in_build_dir : t -> unit
40 val suspend_resource : t -> Command.t -> (unit -> unit) -> t list -> unit
41 val resume_resource : t -> unit
42 val resume_suspension : suspension -> unit
43 val get_optional_resource_suspension : t -> (Command.t * (unit -> unit)) option
44 val clear_resource_failed : t -> unit
45 val add_dependency : t -> t -> unit
46 val fold_dependencies : (string -> string -> 'a -> 'a) -> 'a -> 'a
47 val external_is_up_to_date : t -> bool
49 (* These are not currently used by others modules. *)
50 val dependencies : t -> Resources.t
51 val print_cache : Format.formatter -> unit -> unit
52 val print_dependencies : Format.formatter -> unit -> unit
53 end
55 val digest : t -> string
56 val exists_in_source_dir : t -> bool
57 val exists_in_build_dir : t -> bool
58 val in_build_dir : t -> t
59 val in_source_dir : t -> t
61 val clean_up_links : bool Slurp.entry -> bool Slurp.entry
63 val compare : t -> t -> int
64 val print : Format.formatter -> t -> unit
65 val print_pattern : Format.formatter -> resource_pattern -> unit
66 val clean : t -> unit
67 val import : string -> t
68 val import_pattern : string -> resource_pattern
70 val matchit : resource_pattern -> t -> env option
71 val subst : env -> t -> t
72 val subst_any : env -> t -> t
73 val subst_pattern : env -> resource_pattern -> t
74 (* val is_up_to_date : t -> bool *)
75 val print_env : Format.formatter -> env -> unit