Implement cleanup functions, including 'mailto'.
[whenjobs.git] / lib / whenexpr.ml
index 4e46968..f1f2a89 100644 (file)
@@ -83,6 +83,15 @@ type shell_script = {
   sh_script : string;
 }
 
+type result = {
+  res_job_name : string;
+  res_code : int;
+  res_tmpdir : string;
+  res_output : string;
+}
+
+type cleanup = result -> unit
+
 type variable =
   | T_unit
   | T_bool of bool
@@ -113,6 +122,7 @@ type job_cond =
 type job = {
   job_loc : Loc.t;
   job_name : string;
+  job_cleanup : cleanup option;
   job_cond : job_cond;
   job_script : shell_script;
 }