Systemd/src/basic/calendarspec.h
Zbigniew Jędrzejewski-Szmek 11a1589223 tree-wide: drop license boilerplate
Files which are installed as-is (any .service and other unit files, .conf
files, .policy files, etc), are left as is. My assumption is that SPDX
identifiers are not yet that well known, so it's better to retain the
extended header to avoid any doubt.

I also kept any copyright lines. We can probably remove them, but it'd nice to
obtain explicit acks from all involved authors before doing that.
2018-04-06 18:58:55 +02:00

53 lines
1.2 KiB
C

/* SPDX-License-Identifier: LGPL-2.1+ */
#pragma once
/***
This file is part of systemd.
Copyright 2012 Lennart Poettering
***/
/* 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);