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 : Whenstate.t -> unit
22 (** "Initialize" the module. Pass in the initial state, ready for
23 parsing a new file. *)
25 val get_state : unit -> Whenstate.t
26 (** Return the updated state. Call this after parsing the file. *)
28 val add_when_job : Camlp4.PreCast.Loc.t -> string -> Whenexpr.pre option -> Whenexpr.post option -> Camlp4.PreCast.Ast.expr -> Whenexpr.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 [pre] and [post] are the optional pre and post functions.
38 [expr] is the expression, as an OCaml abstract syntax tree.
40 [sh] is the shell script fragment (basically location + a big string). *)
42 val add_every_job : Camlp4.PreCast.Loc.t -> string -> Whenexpr.pre option -> Whenexpr.post option -> Whenexpr.periodexpr -> Whenexpr.shell_script -> unit
43 (** When an 'every' macro appears as a toplevel statement in an
44 input file, it causes this function to be called.
46 [loc] is the location in the input file.
48 [name] is the name of the job.
50 [pre] and [post] are the optional pre and post functions.
52 [periodexpr] is the period, eg. 30 seconds.
54 [sh] is the shell script fragment. *)
56 val set_variable : string -> Whenexpr.variable -> unit
57 (** Set a variable during file load. *)