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