summaryrefslogtreecommitdiffstats
path: root/include/sh_schedule.h
blob: 02ebb51f25f7cc193e2f9c6206db1b4237cde57a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#ifndef SH_SCHEDULE_H
#define SH_SCHEDULE_H

/************************************************
 * 
 * Scheduler class - public definitions
 *
 ************************************************/

typedef struct sh_schedule_ {
  int    max[5];
  int    min[5];
  int    step[5];
  int    min_step;
  time_t last_exec;
  int    first;
  struct sh_schedule_ * next;
} sh_schedule_t;

/* This function parses a crontab-like schedule and fills a
 * sh_schedule_t structure provided by the caller.
 */
int create_sched (const char * ssched, sh_schedule_t * isched);

/* This function returns 1 if the scheduled event should be executed,
 * else 0
 */
int test_sched   (sh_schedule_t * isched);

#endif