diff options
author | katherine <ageha@airen-no-jikken.icu> | 2019-12-14 00:14:09 -0700 |
---|---|---|
committer | katherine <ageha@airen-no-jikken.icu> | 2019-12-14 00:14:09 -0700 |
commit | 9c37e2803b356fb4192d77678f414a5726ec7785 (patch) | |
tree | 7a8b2af1ac9a45d041f989bb6fb2bf44d7007ae3 /src/entry.h | |
parent | 4b8ad4934cbffe4579fe9e3bde25c3e2da4a9cfd (diff) | |
download | every-9c37e2803b356fb4192d77678f414a5726ec7785.tar.gz |
implement entry
Diffstat (limited to 'src/entry.h')
-rw-r--r-- | src/entry.h | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/entry.h b/src/entry.h new file mode 100644 index 0000000..1420d9b --- /dev/null +++ b/src/entry.h @@ -0,0 +1,27 @@ +#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; +}; + +/* test if an entry needs warning */ +bool entry_is_active(struct entry_s *e, time_t now); + +#endif |