Rename 'cleanup' to 'post'.
[whenjobs.git] / lib / whenexpr.mli
index 91bb134..818c75d 100644 (file)
@@ -60,6 +60,12 @@ type shell_script = {
 }
 (** A shell script. *)
 
 }
 (** A shell script. *)
 
+type preinfo = {
+  pi_job_name : string;                 (** Job name. *)
+  pi_serial : Big_int.big_int;          (** Job serial number. *)
+}
+(** 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. *)
 type result = {
   res_job_name : string;                (** Job name. *)
   res_serial : Big_int.big_int;         (** Job serial number. *)
@@ -70,8 +76,9 @@ type result = {
 }
 (** Result of the run of a job. *)
 
 }
 (** Result of the run of a job. *)
 
-type cleanup = result -> unit
-(** A cleanup function. *)
+type pre = preinfo -> bool
+type post = result -> unit
+(** Pre and post functions. *)
 
 type variable =
   | T_unit
 
 type variable =
   | T_unit
@@ -96,7 +103,8 @@ type job_cond =
 type job = {
   job_loc : Camlp4.PreCast.Loc.t;
   job_name : string;
 type job = {
   job_loc : Camlp4.PreCast.Loc.t;
   job_name : string;
-  job_cleanup : cleanup option;
+  job_pre : pre option;
+  job_post : post option;
   job_cond : job_cond;
   job_script : shell_script;
 }
   job_cond : job_cond;
   job_script : shell_script;
 }