X-Git-Url: http://git.annexia.org/?p=whenjobs.git;a=blobdiff_plain;f=lib%2Fwhenfile.mli;h=7883fa7979cdfe5601d2634ef4c0506e99cf62a7;hp=54ee52d954bcc81d21660112a3355eddbcfdacb7;hb=dcb2495b5a97360cfa074acbd10b1e8bde40da3e;hpb=108dd86b36e82df2a2029dbd12700f9c83e501c1 diff --git a/lib/whenfile.mli b/lib/whenfile.mli index 54ee52d..7883fa7 100644 --- a/lib/whenfile.mli +++ b/lib/whenfile.mli @@ -25,7 +25,7 @@ val init : Whenstate.t -> unit val get_state : unit -> Whenstate.t (** Return the updated state. Call this after parsing the file. *) -val add_when_job : Camlp4.PreCast.Loc.t -> string -> Camlp4.PreCast.Ast.expr -> Whenexpr.shell_script -> unit +val add_when_job : Camlp4.PreCast.Loc.t -> string -> Whenexpr.cleanup option -> Camlp4.PreCast.Ast.expr -> Whenexpr.shell_script -> unit (** When a 'when' macro appears as a toplevel statement in an input file, it causes this function to be called. @@ -33,11 +33,13 @@ val add_when_job : Camlp4.PreCast.Loc.t -> string -> Camlp4.PreCast.Ast.expr -> [name] is the name of the job. + [cleanup] is the optional cleanup function. + [expr] is the expression, as an OCaml abstract syntax tree. [sh] is the shell script fragment (basically location + a big string). *) -val add_every_job : Camlp4.PreCast.Loc.t -> string -> Whenexpr.periodexpr -> Whenexpr.shell_script -> unit +val add_every_job : Camlp4.PreCast.Loc.t -> string -> Whenexpr.cleanup option -> Whenexpr.periodexpr -> Whenexpr.shell_script -> unit (** When an 'every' macro appears as a toplevel statement in an input file, it causes this function to be called. @@ -45,6 +47,11 @@ val add_every_job : Camlp4.PreCast.Loc.t -> string -> Whenexpr.periodexpr -> Whe [name] is the name of the job. + [cleanup] is the optional cleanup function. + [periodexpr] is the period, eg. 30 seconds. [sh] is the shell script fragment. *) + +val set_variable : string -> Whenexpr.variable -> unit +(** Set a variable during file load. *)