Lines Matching refs:rulep
160 static const char * getrule(const char * strp, struct rule * rulep);
191 const struct rule * rulep, int_fast32_t offset)
787 getrule(const char * strp, register struct rule * const rulep)
793 rulep->r_type = JULIAN_DAY;
795 strp = getnum(strp, &rulep->r_day, 1, DAYSPERNYEAR);
800 rulep->r_type = MONTH_NTH_DAY_OF_WEEK;
802 strp = getnum(strp, &rulep->r_mon, 1, MONSPERYEAR);
807 strp = getnum(strp, &rulep->r_week, 1, 5);
812 strp = getnum(strp, &rulep->r_day, 0, DAYSPERWEEK - 1);
817 rulep->r_type = DAY_OF_YEAR;
818 strp = getnum(strp, &rulep->r_day, 0, DAYSPERLYEAR - 1);
827 strp = getsecs(strp, &rulep->r_time);
828 } else rulep->r_time = 2 * SECSPERHOUR; /* default = 2:00:00 */
840 register const struct rule *const rulep, const int_fast32_t offset)
849 switch (rulep->r_type) {
859 value = janfirst + (rulep->r_day - 1) * SECSPERDAY;
860 if (leapyear && rulep->r_day >= 60)
870 value = janfirst + rulep->r_day * SECSPERDAY;
878 for (i = 0; i < rulep->r_mon - 1; ++i)
885 m1 = (rulep->r_mon + 9) % 12 + 1;
886 yy0 = (rulep->r_mon <= 2) ? (year - 1) : year;
899 d = rulep->r_day - dow;
902 for (i = 1; i < rulep->r_week; ++i) {
904 mon_lengths[leapyear][rulep->r_mon - 1])
922 return value + rulep->r_time + offset;