-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgcrond.h
62 lines (48 loc) · 1.15 KB
/
gcrond.h
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
/* SPDX-License-Identifier: ISC */
#ifndef GCROND_H
#define GCROND_H
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/wait.h>
#include <stdbool.h>
#include <stddef.h>
#include <string.h>
#include <stdlib.h>
#include <stdint.h>
#include <unistd.h>
#include <limits.h>
#include <signal.h>
#include <dirent.h>
#include <stdarg.h>
#include <ctype.h>
#include <stdio.h>
#include <errno.h>
#include <fcntl.h>
#include <time.h>
#ifdef HAVE_LIBBSD
#include <bsd/bsd.h>
#endif
#include "config.h"
#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
typedef struct crontab_t {
struct crontab_t *next;
char *exec;
uint64_t minute;
uint32_t hour;
uint32_t dayofmonth;
uint16_t month;
uint8_t dayofweek;
} crontab_t;
typedef struct {
const char *filename; /* input file name */
size_t lineno; /* current line number */
FILE *fp;
char *line;
} rdline_t;
crontab_t *rdcron(int dirfd, const char *filename);
void delcron(crontab_t *cron);
int cronscan(const char *directory, crontab_t **list);
void cron_tm_to_mask(crontab_t *out, struct tm *t);
bool cron_should_run(const crontab_t *t, const crontab_t *mask);
int runjob(crontab_t *tab);
#endif /* GCROND_H */