Remove Whenutils.no_job_private and refactor prev-related code.
[whenjobs.git] / lib / whenutils.mli
index 13bc68c..4d5ccc7 100644 (file)
@@ -183,9 +183,6 @@ type variables = variable StringMap.t
 type job_private
 (** Private state associated with a job, used for evaluation. *)
 
-val no_job_private : job_private
-(* XXX any use of no_job_private is wrong XXX *)
-
 type job_cond =
   | When_job of whenexpr                (** when ... : << >> *)
   | Every_job of periodexpr             (** every ... : << >> *)
@@ -197,7 +194,15 @@ type job = {
   job_script : shell_script;
   job_private : job_private;
 }
-(** A job. *)
+(** A job.  Note that because of the [job_private] field, these cannot
+    be constructed directly.  Use {!make_when_job} or {!make_every_job}
+    to construct one. *)
+
+val make_when_job : Camlp4.PreCast.Loc.t -> string -> whenexpr -> shell_script -> job
+(** Make a when-statement job. *)
+
+val make_every_job : Camlp4.PreCast.Loc.t -> string -> periodexpr -> shell_script -> job
+(** Make an every-statement job. *)
 
 val expr_of_ast : Camlp4.PreCast.Ast.Loc.t -> Camlp4.PreCast.Ast.expr -> whenexpr
 (** Convert OCaml AST to an expression.  Since OCaml ASTs are much