aboutsummaryrefslogtreecommitdiffstats
path: root/src/entry.h
blob: 41b78089562c150be75af93f6ce706e7328b5753 (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 EVERY_ENTRY_H
#define EVERY_ENTRY_H

#include <time.h>
#include <stdbool.h>

enum entry_type_e {
	ENTRY_TYPE_ON,
	ENTRY_TYPE_EVERY,
};

struct entry_interval_s {
	int year, month, day, hour, minute, second;
};

/* type ON uses only start and warn */
struct entry_s {
	enum entry_type_e type;
	bool has_end;
	time_t start, end;
	struct entry_interval_s every, warn;
	bool urgent;
	bool local;
	char *msg;
};

/* test if an entry needs warning */
bool entry_is_active(struct entry_s *e, time_t now);

#endif