X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=lib%2Fwhenexpr.mli;h=437192fd0c5cc0f06d56f5170e13df1d307e196e;hb=95e69a360c9b017b308ba199eddc0238a7b71905;hp=c0c6fb2a9440fab77ef3e36f66d2aee8062b1b32;hpb=108dd86b36e82df2a2029dbd12700f9c83e501c1;p=whenjobs.git diff --git a/lib/whenexpr.mli b/lib/whenexpr.mli index c0c6fb2..437192f 100644 --- a/lib/whenexpr.mli +++ b/lib/whenexpr.mli @@ -39,6 +39,7 @@ type whenexpr = | Expr_mul of whenexpr * whenexpr (** arithmetic multiplication *) | Expr_div of whenexpr * whenexpr (** arithmetic division *) | Expr_mod of whenexpr * whenexpr (** arithmetic modulo *) + | Expr_len of whenexpr (** length *) | Expr_changes of string (** changes var *) | Expr_increases of string (** increases var *) | Expr_decreases of string (** decreases var *) @@ -59,6 +60,17 @@ type shell_script = { } (** A shell script. *) +type result = { + res_job_name : string; (** Job name. *) + res_code : int; (** Return code from the script. *) + res_tmpdir : string; (** Temporary directory. *) + res_output : string; (** Filename of output from job. *) +} +(** Result of the run of a job. *) + +type cleanup = result -> unit +(** A cleanup function. *) + type variable = | T_unit | T_bool of bool @@ -82,6 +94,7 @@ type job_cond = type job = { job_loc : Camlp4.PreCast.Loc.t; job_name : string; + job_cleanup : cleanup option; job_cond : job_cond; job_script : shell_script; } @@ -160,3 +173,7 @@ val next_periodexpr : float -> periodexpr -> float midnight UTC on the 1st day of the year when [(y - 1970) mod i == 0]. This returns midnight on the 1st day of the next year > t. *) + +val check_valid_variable_name : string -> unit +(** Check that [name] is a valid variable name that users are permitted + to set, and raise [Failure] if it is not. *)