]>
git.ipfire.org Git - thirdparty/systemd.git/blob - src/shared/calendarspec.h
1 /* SPDX-License-Identifier: LGPL-2.1-or-later */
4 /* A structure for specifying (possibly repetitive) points in calendar
11 typedef struct CalendarComponent
{
16 struct CalendarComponent
*next
;
19 typedef struct CalendarSpec
{
26 CalendarComponent
*year
;
27 CalendarComponent
*month
;
28 CalendarComponent
*day
;
30 CalendarComponent
*hour
;
31 CalendarComponent
*minute
;
32 CalendarComponent
*microsecond
;
35 CalendarSpec
* calendar_spec_free(CalendarSpec
*c
);
37 bool calendar_spec_valid(CalendarSpec
*spec
);
39 int calendar_spec_to_string(const CalendarSpec
*spec
, char **ret
);
40 int calendar_spec_from_string(const char *p
, CalendarSpec
**ret
);
42 int calendar_spec_next_usec(const CalendarSpec
*spec
, usec_t usec
, usec_t
*next
);
44 DEFINE_TRIVIAL_CLEANUP_FUNC(CalendarSpec
*, calendar_spec_free
);