Lines Matching refs:rp

170 static zic_t	rpytime(const struct rule * rp, zic_t wantedy);
171 static void rulesub(struct rule * rp,
901 register struct rule * rp; in associate() local
939 rp = &rules[base]; in associate()
941 if (strcmp(rp->r_name, rules[out].r_name) != 0) in associate()
945 if (strcmp(zp->z_rule, rp->r_name) != 0) in associate()
947 zp->z_rules = rp; in associate()
1393 rulesub(register struct rule *const rp, in rulesub() argument
1410 rp->r_month = lp->l_value; in rulesub()
1411 rp->r_todisstd = FALSE; in rulesub()
1412 rp->r_todisgmt = FALSE; in rulesub()
1418 rp->r_todisstd = TRUE; in rulesub()
1419 rp->r_todisgmt = FALSE; in rulesub()
1423 rp->r_todisstd = FALSE; in rulesub()
1424 rp->r_todisgmt = FALSE; in rulesub()
1430 rp->r_todisstd = TRUE; in rulesub()
1431 rp->r_todisgmt = TRUE; in rulesub()
1436 rp->r_tod = gethms(dp, _("invalid time of day"), FALSE); in rulesub()
1443 rp->r_lowasnum = lp == NULL; in rulesub()
1444 if (!rp->r_lowasnum) switch ((int) lp->l_value) { in rulesub()
1446 rp->r_loyear = ZIC_MIN; in rulesub()
1449 rp->r_loyear = ZIC_MAX; in rulesub()
1456 } else if (sscanf(cp, scheck(cp, "%"SCNdZIC), &rp->r_loyear) != 1) { in rulesub()
1462 rp->r_hiwasnum = lp == NULL; in rulesub()
1463 if (!rp->r_hiwasnum) switch ((int) lp->l_value) { in rulesub()
1465 rp->r_hiyear = ZIC_MIN; in rulesub()
1468 rp->r_hiyear = ZIC_MAX; in rulesub()
1471 rp->r_hiyear = rp->r_loyear; in rulesub()
1478 } else if (sscanf(cp, scheck(cp, "%"SCNdZIC), &rp->r_hiyear) != 1) { in rulesub()
1482 if (rp->r_loyear > rp->r_hiyear) { in rulesub()
1487 rp->r_yrtype = NULL; in rulesub()
1489 if (rp->r_loyear == rp->r_hiyear) { in rulesub()
1493 rp->r_yrtype = ecpyalloc(typep); in rulesub()
1505 rp->r_dycode = DC_DOWLEQ; in rulesub()
1506 rp->r_wday = lp->l_value; in rulesub()
1507 rp->r_dayofmonth = len_months[1][rp->r_month]; in rulesub()
1510 rp->r_dycode = DC_DOWLEQ; in rulesub()
1512 rp->r_dycode = DC_DOWGEQ; in rulesub()
1515 rp->r_dycode = DC_DOM; in rulesub()
1517 if (rp->r_dycode != DC_DOM) { in rulesub()
1529 rp->r_wday = lp->l_value; in rulesub()
1531 if (sscanf(ep, scheck(ep, "%d"), &rp->r_dayofmonth) != 1 || in rulesub()
1532 rp->r_dayofmonth <= 0 || in rulesub()
1533 (rp->r_dayofmonth > len_months[1][rp->r_month])) { in rulesub()
2021 stringrule(char *result, const struct rule *const rp, const zic_t dstoff, in stringrule() argument
2024 register zic_t tod = rp->r_tod; in stringrule()
2028 if (rp->r_dycode == DC_DOM) { in stringrule()
2031 if (rp->r_dayofmonth == 29 && rp->r_month == TM_FEBRUARY) in stringrule()
2034 for (month = 0; month < rp->r_month; ++month) in stringrule()
2037 if (rp->r_month <= 1) in stringrule()
2038 (void) sprintf(result, "%d", total + rp->r_dayofmonth - 1); in stringrule()
2040 (void) sprintf(result, "J%d", total + rp->r_dayofmonth); in stringrule()
2043 register int wday = rp->r_wday; in stringrule()
2046 if (rp->r_dycode == DC_DOWGEQ) { in stringrule()
2047 wdayoff = (rp->r_dayofmonth - 1) % DAYSPERWEEK; in stringrule()
2052 week = 1 + (rp->r_dayofmonth - 1) / DAYSPERWEEK; in stringrule()
2053 } else if (rp->r_dycode == DC_DOWLEQ) { in stringrule()
2054 if (rp->r_dayofmonth == len_months[1][rp->r_month]) in stringrule()
2057 wdayoff = rp->r_dayofmonth % DAYSPERWEEK; in stringrule()
2062 week = rp->r_dayofmonth / DAYSPERWEEK; in stringrule()
2068 rp->r_month + 1, week, wday); in stringrule()
2070 if (rp->r_todisgmt) in stringrule()
2072 if (rp->r_todisstd && rp->r_stdoff == 0) in stringrule()
2109 register struct rule * rp; in stringzone() local
2122 rp = &zp->z_rules[i]; in stringzone()
2123 if (rp->r_hiwasnum || rp->r_hiyear != ZIC_MAX) in stringzone()
2125 if (rp->r_yrtype != NULL) in stringzone()
2127 if (rp->r_stdoff == 0) { in stringzone()
2129 stdrp = rp; in stringzone()
2133 dstrp = rp; in stringzone()
2145 rp = &zp->z_rules[i]; in stringzone()
2146 if (rp->r_stdoff == 0 && rule_cmp(stdabbrrp, rp) < 0) in stringzone()
2147 stdabbrrp = rp; in stringzone()
2148 if (rule_cmp(stdrp, rp) < 0) in stringzone()
2149 stdrp = rp; in stringzone()
2220 register struct rule * rp; in outzone() local
2281 rp = &zp->z_rules[j]; in outzone()
2282 if (rp->r_lowasnum) in outzone()
2283 updateminmax(rp->r_loyear); in outzone()
2284 if (rp->r_hiwasnum) in outzone()
2285 updateminmax(rp->r_hiyear); in outzone()
2286 if (rp->r_lowasnum || rp->r_hiwasnum) in outzone()
2376 rp = &zp->z_rules[j]; in outzone()
2377 if (rp->r_hiyear == ZIC_MAX) { in outzone()
2378 if (rp->r_loyear > finalRuleYear) { in outzone()
2379 finalRuleYear = rp->r_loyear; in outzone()
2382 finalRule1 = rp; in outzone()
2384 finalRule2 = rp; in outzone()
2389 } else if (rp->r_hiyear >= finalRuleYear) { in outzone()
2399 finalRuleYear = rp->r_hiyear + 1; in outzone()
2477 rp = &zp->z_rules[j]; in outzone()
2479 rp->r_filename, rp->r_linenum); in outzone()
2480 rp->r_todo = year >= rp->r_loyear && in outzone()
2481 year <= rp->r_hiyear && in outzone()
2482 yearistype(year, rp->r_yrtype); in outzone()
2483 if (rp->r_todo) in outzone()
2484 rp->r_temp = rpytime(rp, year); in outzone()
2512 rp = &zp->z_rules[j]; in outzone()
2513 if (!rp->r_todo) in outzone()
2516 rp->r_filename, rp->r_linenum); in outzone()
2517 offset = rp->r_todisgmt ? 0 : gmtoff; in outzone()
2518 if (!rp->r_todisstd) in outzone()
2520 jtime = rp->r_temp; in outzone()
2532 rp = &zp->z_rules[k]; in outzone()
2533 rp->r_todo = FALSE; in outzone()
2536 stdoff = rp->r_stdoff; in outzone()
2544 rp->r_abbrvar, in outzone()
2545 rp->r_stdoff != 0, in outzone()
2554 rp->r_abbrvar, in outzone()
2555 rp->r_stdoff != in outzone()
2561 if (year >= finalRuleYear && rp == finalRule1) { in outzone()
2576 rp, finalRuleIndex, year + 1); in outzone()
2582 rp->r_filename, rp->r_linenum); in outzone()
2583 doabbr(ab, zp->z_format, rp->r_abbrvar, in outzone()
2584 rp->r_stdoff != 0, FALSE); in outzone()
2585 offset = oadd(zp->z_gmtoff, rp->r_stdoff); in outzone()
2587 type = addtype(offset, zp->z_gmtoff, rp->r_stdoff, in outzone()
2588 ab, rp->r_stdoff != 0, in outzone()
2589 rp->r_todisstd, rp->r_todisgmt); in outzone()
2591 type = addtype(offset, ab, rp->r_stdoff != 0, in outzone()
2592 rp->r_todisstd, rp->r_todisgmt); in outzone()
2981 rpytime(register const struct rule *const rp, register const zic_t wantedy) in rpytime() argument
3004 while (m != rp->r_month) { in rpytime()
3009 i = rp->r_dayofmonth; in rpytime()
3011 if (rp->r_dycode == DC_DOWLEQ) in rpytime()
3020 if (rp->r_dycode == DC_DOWGEQ || rp->r_dycode == DC_DOWLEQ) { in rpytime()
3035 while (wday != rp->r_wday) in rpytime()
3036 if (rp->r_dycode == DC_DOWGEQ) { in rpytime()
3058 return tadd(t, rp->r_tod); in rpytime()