X-Git-Url: http://git.annexia.org/?p=whenjobs.git;a=blobdiff_plain;f=lib%2Fwhenexpr.mli;h=c84f0919631dba572bf6770428b9b142c658340b;hp=7d1c2de085373806448a4bd4c2224460befa2f8f;hb=1d0b030e3a62a905dce16d05e8816cb3da8c49eb;hpb=21a3155f8296175180e348f10a6a9af88e1ac87d diff --git a/lib/whenexpr.mli b/lib/whenexpr.mli index 7d1c2de..c84f091 100644 --- a/lib/whenexpr.mli +++ b/lib/whenexpr.mli @@ -33,6 +33,7 @@ type whenexpr = | Expr_eq of whenexpr * whenexpr (** == *) | Expr_ge of whenexpr * whenexpr (** >= *) | Expr_gt of whenexpr * whenexpr (** > *) + | Expr_ne of whenexpr * whenexpr (** != *) | Expr_not of whenexpr (** boolean not *) | Expr_add of whenexpr * whenexpr (** arithmetic addition or string cat *) | Expr_sub of whenexpr * whenexpr (** arithmetic subtraction *) @@ -76,6 +77,34 @@ val rpc_of_variable : variable -> Whenproto_aux.variable type variables = variable Whenutils.StringMap.t (** A set of variables. *) +type preinfo = { + pi_job_name : string; (** Job name. *) + pi_serial : Big_int.big_int; (** Job serial number. *) + pi_variables : (string * variable) list; (** Variables set in job. *) + pi_running : preinfo_running_job list; (** List of running jobs. *) +} +and preinfo_running_job = { + pirun_job_name : string; (** Running job name. *) + pirun_serial : Big_int.big_int; (** Running job serial number. *) + pirun_start_time : float; (** Running job start time. *) + pirun_pid : int; (** Running job process ID. *) +} +(** Information available to pre function before the job runs. *) + +type result = { + res_job_name : string; (** Job name. *) + res_serial : Big_int.big_int; (** Job serial number. *) + res_code : int; (** Return code from the script. *) + res_tmpdir : string; (** Temporary directory. *) + res_output : string; (** Filename of output from job. *) + res_start_time : float; (** When the job started. *) +} +(** Result of the run of a job. *) + +type pre = preinfo -> bool +type post = result -> unit +(** Pre and post functions. *) + type job_cond = | When_job of whenexpr (** when ... : << >> *) | Every_job of periodexpr (** every ... : << >> *) @@ -83,6 +112,8 @@ type job_cond = type job = { job_loc : Camlp4.PreCast.Loc.t; job_name : string; + job_pre : pre option; + job_post : post option; job_cond : job_cond; job_script : shell_script; }