]> granicus.if.org Git - fcron/blob - database.h
refactored suspend handling code into suspend.[ch]
[fcron] / database.h
1 /*
2  * FCRON - periodic command scheduler 
3  *
4  *  Copyright 2000-2014 Thibault Godouet <fcron@free.fr>
5  *
6  *  This program is free software; you can redistribute it and/or modify
7  *  it under the terms of the GNU General Public License as published by
8  *  the Free Software Foundation; either version 2 of the License, or
9  *  (at your option) any later version.
10  *
11  *  This program is distributed in the hope that it will be useful,
12  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  *  GNU General Public License for more details.
15  * 
16  *  You should have received a copy of the GNU General Public License
17  *  along with this program; if not, write to the Free Software
18  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19  * 
20  *  The GNU General Public License can also be found in the file
21  *  `LICENSE' that comes with the fcron source distribution.
22  */
23
24
25 #ifndef __DATABASE_H__
26 #define __DATABASE_H__
27
28 /* functions prototypes */
29 extern void test_jobs(void);
30 extern void wait_chld(void);
31 extern void wait_all(int *counter);
32 extern time_t next_wake_time(time_t lim);
33 extern time_t check_lavg(time_t lim);
34 extern void set_next_exe(struct cl_t *line, char option, int info_fd);
35 #define NO_GOTO 1               /* set_next_exe() : no goto_non_matching() */
36 #define NO_GOTO_LOG 2           /* set_next_exe() : NO_GOTO but also log nextexe time */
37 #define FROM_CUR_NEXTEXE 4      /* set_next_exe() : compute from nextexe, not now */
38 extern void set_next_exe_notrun(struct cl_t *line, char context);
39 #define LAVG 1                  /* set_next_exe_notrun() : context */
40 #define SYSDOWN 2               /* set_next_exe_notrun() : context */
41 #define QUEUE_FULL 3            /* set_next_exe_notrun() : context */
42 #define SYSDOWN_RUNATREBOOT 4   /* set_next_exe_notrun() : context */
43 extern void set_next_exe_startup(struct cl_t *cl, const int context,
44                                  const time_t sleep_duration);
45 #define CONTEXT_DEFAULT 1       /* a new file was loaded (and the machine didn't just boot) */
46 #define CONTEXT_BOOT 2          /* the machine just booted */
47 #define CONTEXT_RESUME 3        /* the machine just resumed from suspend/hibernation */
48 extern void reschedule_all_on_resume(const time_t sleep_duration);
49 extern void mail_notrun(struct cl_t *line, char context, struct tm *since);
50 extern void mail_notrun_time_t(cl_t * line, char context, time_t since_time_t);
51 extern job_t *job_queue_remove(cl_t * line);
52 extern void insert_nextexe(struct cl_t *line);
53 extern void run_normal_job(cl_t * line, int fd);
54 extern void add_serial_job(struct cl_t *line, int fd);
55 extern void add_lavg_job(struct cl_t *line, int fd);
56 extern void run_serial_job(void);
57 extern int switch_timezone(const char *orig_tz, const char *dest_tz);
58 extern void switch_back_timezone(const char *orig_tz);
59
60 #endif                          /* __DATABASE_H__ */