]> git.ipfire.org Git - thirdparty/fcron.git/commitdiff
added options strict and noticenotrun
authorThibault Godouet <yo8192@users.noreply.github.com>
Mon, 15 Jan 2001 18:46:13 +0000 (18:46 +0000)
committerThibault Godouet <yo8192@users.noreply.github.com>
Mon, 15 Jan 2001 18:46:13 +0000 (18:46 +0000)
fileconf.c
option.h

index a31bb9d70d9b58475128be6ce27c8afa1e403075..15e8a83efca3073180f606664e9097db35aca40d 100644 (file)
@@ -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;
index ffc8482c494db5425c32642b6caee9cecd33bc41..2d15275ec76d2693f687264ae5929795882edb7f 100644 (file)
--- 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 ?
 
 */
 
        (_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__ */