]> git.ipfire.org Git - thirdparty/systemd.git/blame - src/shared/calendarspec.h
mkosi: update arch commit reference
[thirdparty/systemd.git] / src / shared / calendarspec.h
CommitLineData
db9ecf05 1/* SPDX-License-Identifier: LGPL-2.1-or-later */
36697dc0
LP
2#pragma once
3
36697dc0
LP
4/* A structure for specifying (possibly repetitive) points in calendar
5 * time, a la cron */
6
7#include <stdbool.h>
71d35b6b 8
11c3a366 9#include "time-util.h"
36697dc0
LP
10
11typedef struct CalendarComponent {
e78fce48
DC
12 int start;
13 int stop;
36697dc0
LP
14 int repeat;
15
16 struct CalendarComponent *next;
17} CalendarComponent;
18
19typedef struct CalendarSpec {
20 int weekdays_bits;
80b19994
LP
21 bool end_of_month:1;
22 bool utc:1;
23 signed int dst:2;
48d26c01 24 char *timezone;
36697dc0
LP
25
26 CalendarComponent *year;
27 CalendarComponent *month;
28 CalendarComponent *day;
29
30 CalendarComponent *hour;
31 CalendarComponent *minute;
436dd70f 32 CalendarComponent *microsecond;
36697dc0
LP
33} CalendarSpec;
34
7c123d49 35CalendarSpec* calendar_spec_free(CalendarSpec *c);
36697dc0 36
36697dc0
LP
37bool calendar_spec_valid(CalendarSpec *spec);
38
24b0c6c2
YW
39int calendar_spec_to_string(const CalendarSpec *spec, char **ret);
40int calendar_spec_from_string(const char *p, CalendarSpec **ret);
36697dc0
LP
41
42int calendar_spec_next_usec(const CalendarSpec *spec, usec_t usec, usec_t *next);
6d86f4bd
LP
43
44DEFINE_TRIVIAL_CLEANUP_FUNC(CalendarSpec*, calendar_spec_free);