MCPcopy Create free account
hub / github.com/ClusterLabs/pacemaker / cron_range_satisfied

Function cron_range_satisfied

lib/pengine/rules.c:443–482  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

441 }
442
443gboolean
444cron_range_satisfied(crm_time_t * now, xmlNode * cron_spec)
445{
446 const char *value = NULL;
447 char *value_low = NULL;
448 char *value_high = NULL;
449
450 int value_low_i = 0;
451 int value_high_i = 0;
452
453 uint32_t h, m, s, y, d, w;
454
455 CRM_CHECK(now != NULL, return FALSE);
456
457 crm_time_get_timeofday(now, &h, &m, &s);
458
459 cron_check("seconds", s);
460 cron_check("minutes", m);
461 cron_check("hours", h);
462
463 crm_time_get_gregorian(now, &y, &m, &d);
464
465 cron_check("monthdays", d);
466 cron_check("months", m);
467 cron_check("years", y);
468
469 crm_time_get_ordinal(now, &y, &d);
470
471 cron_check("yeardays", d);
472
473 crm_time_get_isoweek(now, &y, &w, &d);
474
475 cron_check("weekyears", y);
476 cron_check("weeks", w);
477 cron_check("weekdays", d);
478
479 cron_check("moon", phase_of_the_moon(now));
480
481 return TRUE;
482}
483
484#define update_field(xml_field, time_fn) \
485 value = crm_element_value(duration_spec, xml_field); \

Callers 1

test_date_expressionFunction · 0.85

Calls 5

crm_time_get_timeofdayFunction · 0.85
crm_time_get_gregorianFunction · 0.85
crm_time_get_ordinalFunction · 0.85
crm_time_get_isoweekFunction · 0.85
phase_of_the_moonFunction · 0.85

Tested by 1

test_date_expressionFunction · 0.68