]>
git.ipfire.org Git - thirdparty/systemd.git/blob - src/shared/calendarspec.h
1 /* SPDX-License-Identifier: LGPL-2.1+ */
4 /* A structure for specifying (possibly repetitive) points in calendar
12 typedef struct CalendarComponent
{
17 struct CalendarComponent
*next
;
20 typedef struct CalendarSpec
{
27 CalendarComponent
*year
;
28 CalendarComponent
*month
;
29 CalendarComponent
*day
;
31 CalendarComponent
*hour
;
32 CalendarComponent
*minute
;
33 CalendarComponent
*microsecond
;
36 CalendarSpec
* calendar_spec_free(CalendarSpec
*c
);
38 int calendar_spec_normalize(CalendarSpec
*spec
);
39 bool calendar_spec_valid(CalendarSpec
*spec
);
41 int calendar_spec_to_string(const CalendarSpec
*spec
, char **p
);
42 int calendar_spec_from_string(const char *p
, CalendarSpec
**spec
);
44 int calendar_spec_next_usec(const CalendarSpec
*spec
, usec_t usec
, usec_t
*next
);
46 DEFINE_TRIVIAL_CLEANUP_FUNC(CalendarSpec
*, calendar_spec_free
);