Lines Matching refs:rulep
148 static const char * getrule(const char * strp, struct rule * rulep);
179 const struct rule * rulep, long offset);
759 getrule(strp, rulep)
761 register struct rule * const rulep;
767 rulep->r_type = JULIAN_DAY;
769 strp = getnum(strp, &rulep->r_day, 1, DAYSPERNYEAR);
774 rulep->r_type = MONTH_NTH_DAY_OF_WEEK;
776 strp = getnum(strp, &rulep->r_mon, 1, MONSPERYEAR);
781 strp = getnum(strp, &rulep->r_week, 1, 5);
786 strp = getnum(strp, &rulep->r_day, 0, DAYSPERWEEK - 1);
791 rulep->r_type = DAY_OF_YEAR;
792 strp = getnum(strp, &rulep->r_day, 0, DAYSPERLYEAR - 1);
801 strp = getsecs(strp, &rulep->r_time);
802 } else rulep->r_time = 2 * SECSPERHOUR; /* default = 2:00:00 */
813 transtime(janfirst, year, rulep, offset)
816 register const struct rule * const rulep;
826 switch (rulep->r_type) {
836 value = janfirst + (rulep->r_day - 1) * SECSPERDAY;
837 if (leapyear && rulep->r_day >= 60)
847 value = janfirst + rulep->r_day * SECSPERDAY;
855 for (i = 0; i < rulep->r_mon - 1; ++i)
862 m1 = (rulep->r_mon + 9) % 12 + 1;
863 yy0 = (rulep->r_mon <= 2) ? (year - 1) : year;
876 d = rulep->r_day - dow;
879 for (i = 1; i < rulep->r_week; ++i) {
881 mon_lengths[leapyear][rulep->r_mon - 1])
899 return value + rulep->r_time + offset;