From f85a015d592ecdb20187aa49e9934934258f1172 Mon Sep 17 00:00:00 2001 From: thib Date: Mon, 15 Jan 2001 18:46:13 +0000 Subject: [PATCH] added options strict and noticenotrun --- fileconf.c | 24 +++++++++++++++++++++++- option.h | 28 +++++++++++++++++++++++++++- 2 files changed, 50 insertions(+), 2 deletions(-) diff --git a/fileconf.c b/fileconf.c index a31bb9d..15e8a83 100644 --- a/fileconf.c +++ b/fileconf.c @@ -22,7 +22,7 @@ * `LICENSE' that comes with the fcron source distribution. */ - /* $Id: fileconf.c,v 1.33 2001-01-12 21:42:18 thib Exp $ */ + /* $Id: fileconf.c,v 1.34 2001-01-15 18:46:13 thib Exp $ */ #include "fcrontab.h" @@ -662,6 +662,28 @@ read_opt(char *ptr, CL *cl) fprintf(stderr, " Opt : \"%s\"\n", opt_name); } + if ( strcmp(opt_name, "strict") == 0 ) { + if ( in_brackets && (ptr = get_bool(ptr, &i)) == NULL ) + Handle_err; + if (i == 0 ) + clear_strict(cl->cl_option); + else + set_strict(cl->cl_option); + if (debug_opt) + fprintf(stderr, " Opt : \"%s\" %d\n", opt_name, i); + } + + if ( strcmp(opt_name, "noticenotrun") == 0 ) { + if ( in_brackets && (ptr = get_bool(ptr, &i)) == NULL ) + Handle_err; + if (i == 0 ) + clear_notice_notrun(cl->cl_option); + else + set_notice_notrun(cl->cl_option); + if (debug_opt) + fprintf(stderr, " Opt : \"%s\" %d\n", opt_name, i); + } + else if ( strcmp(opt_name, "lavg") == 0 ) { if (!in_brackets || (ptr=get_num(ptr,&i,UCHAR_MAX,1,NULL)) == NULL) Handle_err; diff --git a/option.h b/option.h index ffc8482..2d15275 100644 --- a/option.h +++ b/option.h @@ -21,7 +21,7 @@ * `LICENSE' that comes with the fcron source distribution. */ - /* $Id: option.h,v 1.13 2001-01-12 21:44:50 thib Exp $ */ + /* $Id: option.h,v 1.14 2001-01-15 18:46:39 thib Exp $ */ /* This has been inspired from bitstring(3) : here is the original copyright : */ @@ -75,6 +75,8 @@ 17 should dow field be ignored in goto_non_matching() ? 18 First freq is the freq (*ly) or the first field to take into account ? 19 Freq (ie daily) is from middle to middle of interval (ie nightly) ? + 20 Should we remove a %-job from lavg queue if the interval is exceeded ? + 21 Should user be mailed if a %-job has not run during a period ? */ @@ -368,5 +370,29 @@ (_bit_clear(opt, 19)) +/* + bit 20 : set to 1 : remove %-job from lavg queue if interval is exceeded + set to 0 : let the job in the %-queue if interval is exceeded +*/ +#define is_strict(opt) \ + (_bit_test(opt, 20)) +#define set_strict(opt) \ + (_bit_set(opt, 20)) +#define clear_strict(opt) \ + (_bit_clear(opt, 20)) + + +/* + bit 21 : set to 1 : mail user if a job has not run during a period + set to 0 : do not mail user if a job has not run during a period +*/ +#define is_notice_notrun(opt) \ + (_bit_test(opt, 21)) +#define set_notice_notrun(opt) \ + (_bit_set(opt, 21)) +#define clear_notice_notrun(opt) \ + (_bit_clear(opt, 21)) + + #endif /* __OPTIONH__ */ -- 2.40.0