2 * Copyright (C) 2012 Red Hat Inc.
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License along
15 * with this program; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 (** This module is used when compiling whenjobs input files. *)
21 val init : unit -> unit
22 (** "Initialize" the module. Clear the list of jobs and other
23 internal variables so we are ready to parse a new file. *)
25 val get_jobs : unit -> Whenutils.job list
26 (** Get the jobs added since {!init} was called. *)
28 val add_when_job : Camlp4.PreCast.Loc.t -> string -> Camlp4.PreCast.Ast.expr -> Whenutils.shell_script -> unit
29 (** When a 'when' macro appears as a toplevel statement in an
30 input file, it causes this function to be called.
32 [loc] is the location in the input file.
34 [name] is the name of the job.
36 [expr] is the expression, as an OCaml abstract syntax tree.
38 [sh] is the shell script fragment (basically location + a big string). *)
40 val add_every_job : Camlp4.PreCast.Loc.t -> string -> Whenutils.periodexpr -> Whenutils.shell_script -> unit
41 (** When an 'every' macro appears as a toplevel statement in an
42 input file, it causes this function to be called.
44 [loc] is the location in the input file.
46 [name] is the name of the job.
48 [periodexpr] is the period, eg. 30 seconds.
50 [sh] is the shell script fragment. *)