X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=goaljobs.mli;h=7374f546e021637d8ce8b0302f8da2dcd3825cd9;hb=3acfed6261fc1ec02e370183ac2f76c095ad0cdf;hp=c1dff52749a93337cfd3c823c63ab0c604e23d5c;hpb=3a572e209c501018d6a19f1533146be1c8b41ced;p=goaljobs.git diff --git a/goaljobs.mli b/goaljobs.mli index c1dff52..7374f54 100644 --- a/goaljobs.mli +++ b/goaljobs.mli @@ -70,7 +70,7 @@ val target_exists : bool list -> unit (** [target_exists [t1; t2; ...]] is the same as writing [target (t1 || t2 || ...)] *) -val require : (unit -> unit) -> unit +val require : string -> (unit -> unit) -> unit (** [require] {i goal} defines the requirements of this goal, that is, other goals that have to be met before the rest of the goal is able to run. @@ -265,6 +265,9 @@ val memory_get : string -> string option val memory_delete : string -> unit (** Delete the [key]. If the key doesn't exist, has no effect. *) +val memory_list : unit -> (string * string) list + (** Return all [(key, value)] pairs in the memory. *) + (** {2 Publishing goals} *) val publish : string -> (string list -> unit) -> unit @@ -296,6 +299,28 @@ val publish : string -> (string list -> unit) -> unit the place to perform string to int conversion, checks, and so on (remember that OCaml is strongly typed). *) +(** {2 Logging script output} *) + +val log_program_output : unit -> string + (** [log_program_output] should be called at most once, usually at + the top-level of the script. It creates a temporary file + and redirects stdout and stderr into this file (they are still + sent to the ordinary output, so it acts like [tee]). The + filename of the temporary file is returned. *) + +(** {2 Sending email} *) + +val mailto : ?from:string -> subject:string -> ?attach:string list-> string -> unit + (** Send email. + + Optional [?from] is the sender email address. + + Required [~subject] is the subject line. + + Optional [?attach] is a list of attachments (filenames). + + The bare argument is the destination email address. *) + (**/**) (* Goal versions of some common functions. You are using these @@ -321,3 +346,7 @@ val init : unit -> unit (* Export this so the macros can catch these exceptions. *) type goal_result_t = Goal_OK | Goal_failed of string exception Goal_result of goal_result_t + +(* Called to print debug message when we enter or leave a goal. *) +val _enter_goal : string -> unit +val _leave_goal : string -> unit