Systemd/src/basic/calendarspec.h
Lennart Poettering 0c69794138 tree-wide: remove Lennart's copyright lines
These lines are generally out-of-date, incomplete and unnecessary. With
SPDX and git repository much more accurate and fine grained information
about licensing and authorship is available, hence let's drop the
per-file copyright notice. Of course, removing copyright lines of others
is problematic, hence this commit only removes my own lines and leaves
all others untouched. It might be nicer if sooner or later those could
go away too, making git the only and accurate source of authorship
information.
2018-06-14 10:20:20 +02:00

47 lines
1.1 KiB
C

/* SPDX-License-Identifier: LGPL-2.1+ */
#pragma once
/* A structure for specifying (possibly repetitive) points in calendar
* time, a la cron */
#include <stdbool.h>
#include "time-util.h"
#include "util.h"
typedef struct CalendarComponent {
int start;
int stop;
int repeat;
struct CalendarComponent *next;
} CalendarComponent;
typedef struct CalendarSpec {
int weekdays_bits;
bool end_of_month;
bool utc;
int dst;
char *timezone;
CalendarComponent *year;
CalendarComponent *month;
CalendarComponent *day;
CalendarComponent *hour;
CalendarComponent *minute;
CalendarComponent *microsecond;
} CalendarSpec;
CalendarSpec* calendar_spec_free(CalendarSpec *c);
int calendar_spec_normalize(CalendarSpec *spec);
bool calendar_spec_valid(CalendarSpec *spec);
int calendar_spec_to_string(const CalendarSpec *spec, char **p);
int calendar_spec_from_string(const char *p, CalendarSpec **spec);
int calendar_spec_next_usec(const CalendarSpec *spec, usec_t usec, usec_t *next);
DEFINE_TRIVIAL_CLEANUP_FUNC(CalendarSpec*, calendar_spec_free);