Lines Matching refs:spec

881 int calendar_spec_from_string(const char *p, CalendarSpec **spec) {  in calendar_spec_from_string()  argument
1101 if (spec) in calendar_spec_from_string()
1102 *spec = TAKE_PTR(c); in calendar_spec_from_string()
1120 const CalendarSpec *spec, in find_matching_component() argument
1138 bool end_of_month = spec->end_of_month && c == spec->day; in find_matching_component()
1144 start = find_end_of_month(tm, spec->utc, c->start); in find_matching_component()
1145 stop = find_end_of_month(tm, spec->utc, c->stop); in find_matching_component()
1246 static int find_next(const CalendarSpec *spec, struct tm *tm, usec_t *usec) { in find_next() argument
1253 assert(spec); in find_next()
1261 (void) mktime_or_timegm(&c, spec->utc); in find_next()
1262 c.tm_isdst = spec->dst; in find_next()
1265 r = find_matching_component(spec, spec->year, &c, &c.tm_year); in find_next()
1275 if (tm_within_bounds(&c, spec->utc) <= 0) in find_next()
1279 r = find_matching_component(spec, spec->month, &c, &c.tm_mon); in find_next()
1286 if (r < 0 || (r = tm_within_bounds(&c, spec->utc)) < 0) { in find_next()
1296 r = find_matching_component(spec, spec->day, &c, &c.tm_mday); in find_next()
1299 if (r < 0 || (r = tm_within_bounds(&c, spec->utc)) < 0) { in find_next()
1308 if (!matches_weekday(spec->weekdays_bits, &c, spec->utc)) { in find_next()
1314 r = find_matching_component(spec, spec->hour, &c, &c.tm_hour); in find_next()
1317 if (r < 0 || (r = tm_within_bounds(&c, spec->utc)) < 0) { in find_next()
1328 r = find_matching_component(spec, spec->minute, &c, &c.tm_min); in find_next()
1331 if (r < 0 || (r = tm_within_bounds(&c, spec->utc)) < 0) { in find_next()
1340 r = find_matching_component(spec, spec->microsecond, &c, &c.tm_sec); in find_next()
1344 if (r < 0 || (r = tm_within_bounds(&c, spec->utc)) < 0) { in find_next()
1361 (void) calendar_spec_to_string(spec, &s); in find_next()
1366 static int calendar_spec_next_usec_impl(const CalendarSpec *spec, usec_t usec, usec_t *ret_next) { in calendar_spec_next_usec_impl() argument
1372 assert(spec); in calendar_spec_next_usec_impl()
1379 assert_se(localtime_or_gmtime_r(&t, &tm, spec->utc)); in calendar_spec_next_usec_impl()
1382 r = find_next(spec, &tm, &tm_usec); in calendar_spec_next_usec_impl()
1386 t = mktime_or_timegm(&tm, spec->utc); in calendar_spec_next_usec_impl()
1401 int calendar_spec_next_usec(const CalendarSpec *spec, usec_t usec, usec_t *ret_next) { in calendar_spec_next_usec() argument
1405 assert(spec); in calendar_spec_next_usec()
1407 if (isempty(spec->timezone)) in calendar_spec_next_usec()
1408 return calendar_spec_next_usec_impl(spec, usec, ret_next); in calendar_spec_next_usec()
1423 colon_tz = strjoina(":", spec->timezone); in calendar_spec_next_usec()
1432 shared->return_value = calendar_spec_next_usec_impl(spec, usec, &shared->next); in calendar_spec_next_usec()