2 * FCRON - periodic command scheduler
4 * Copyright 2000 Thibault Godouet <fcron@free.fr>
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.
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.
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
20 * The GNU General Public License can also be found in the file
21 * `LICENSE' that comes with the fcron source distribution.
24 /* $Id: global.h,v 1.13 2000-06-25 20:07:00 thib Exp $ */
28 WARNING : this file should not be modified.
29 Compilation's options are in config.h
48 #include <sys/types.h>
56 #include "bitstring.h"
60 #define FILEVERSION "007" /* syntax's version of fcrontabs :
61 * must have a length of 3 characters */
68 #define Alloc(ptr, type) \
69 if( (ptr = calloc(1, sizeof(type))) == NULL ) \
70 die_e("Could not calloc.");
72 #define debug if(debug_opt) Debug
74 typedef struct env_t {
75 char *e_name; /* env name */
76 char *e_val; /* env value */
82 struct CL *cf_line_base;
83 char *cf_user; /* user-name */
84 char *cf_mailto; /* mail output's to mail_user */
85 struct env_t *cf_env_base; /* list of all env variables to set */
86 int cf_running; /* number of jobs running */
89 /* warning : do not change the order of the members of this structure
90 * because some tests made are dependent to that order */
93 struct CF *cl_file; /* the file in which the line is */
94 unsigned short cl_option; /* options for that line (see option.h) */
95 char *cl_shell; /* shell command */
96 char cl_nice; /* nice value to control priority */
97 uid_t cl_runas; /* determine permissions of the job */
98 pid_t cl_pid; /* running pid, 0, or armed (-1) */
99 time_t cl_nextexe; /* time and date of the next execution */
100 short int cl_remain; /* remaining until next execution */
101 time_t cl_timefreq; /* Run every n seconds */
102 short int cl_runfreq; /* Run once every n matches */
103 /* see bitstring(3) man page for more details */
104 bitstr_t bit_decl(cl_mins, 60); /* 0-59 */
105 bitstr_t bit_decl(cl_hrs, 24); /* 0-23 */
106 bitstr_t bit_decl(cl_days, 32); /* 1-31 */
107 bitstr_t bit_decl(cl_mons, 12); /* 0-11 */
108 bitstr_t bit_decl(cl_dow, 8); /* 0-7, 0 and 7 are both Sunday */
117 #endif /* __GLOBALH__ */