return 0;
}
-static bool chain_valid(CalendarComponent *c, int from, int to) {
+_pure_ static bool chain_valid(CalendarComponent *c, int from, int to) {
if (!c)
return true;
return true;
}
-bool calendar_spec_valid(CalendarSpec *c) {
+_pure_ bool calendar_spec_valid(CalendarSpec *c) {
assert(c);
if (c->weekdays_bits > 127)
errno = 0;
value = strtoul(*p, &e, 10);
- if (errno != 0)
+ if (errno > 0)
return -errno;
if (e == *p)
return -EINVAL;
if (*e == '/') {
repeat = strtoul(e+1, &ee, 10);
- if (errno != 0)
+ if (errno > 0)
return -errno;
if (ee == e+1)
return -EINVAL;
if (r < 0)
goto fail;
+ } else if (strcaseeq(p, "anually") || strcaseeq(p, "yearly")) {
+ r = const_chain(1, &c->month);
+ if (r < 0)
+ goto fail;
+ r = const_chain(1, &c->day);
+ if (r < 0)
+ goto fail;
+ r = const_chain(0, &c->hour);
+ if (r < 0)
+ goto fail;
+ r = const_chain(0, &c->minute);
+ if (r < 0)
+ goto fail;
+ r = const_chain(0, &c->second);
+ if (r < 0)
+ goto fail;
+
} else if (strcaseeq(p, "weekly")) {
c->weekdays_bits = 1;
if (t == (time_t) -1)
return -EINVAL;
-
*next = (usec_t) t * USEC_PER_SEC;
return 0;
}