if ((lp = byword(cp, begin_years)) != NULL) switch ((int) lp->l_value) {
lp = byword(cp, begin_years); if (lp != NULL) switch ((int) lp->l_value) {
rulesub(rp, loyearp, hiyearp, typep, monthp, dayp, timep)register struct rule * const	rp;const char * const		loyearp;const char * const		hiyearp;const char * const		typep;const char * const		monthp;const char * const		dayp;const char * const		timep;{	register const struct lookup *	lp;	register const char *		cp;	register char *			dp;	register char *			ep;	if ((lp = byword(monthp, mon_names)) == NULL) {		error("invalid month name");		return;	}	rp->r_month = lp->l_value;	rp->r_todisstd = FALSE;	rp->r_todisuniv = FALSE;	dp = ecpyalloc(timep);	if (*dp != '\0') {		ep = dp + strlen(dp) - 1;		switch (lowerit(*ep)) {			case 's':	/* Standard */				rp->r_todisstd = TRUE;				rp->r_todisuniv = FALSE;				*ep = '\0';				break;			case 'w':	/* Wall */				rp->r_todisstd = FALSE;				rp->r_todisuniv = FALSE;				*ep = '\0';			case 'g':	/* Greenwich */			case 'u':	/* Universal */			case 'z':	/* Zulu */				rp->r_todisstd = TRUE;				rp->r_todisuniv = TRUE;				*ep = '\0';				break;		}	}	rp->r_tod = gethms(dp, "invalid time of day", FALSE);	ifree(dp);	/*	** Year work.	*/	cp = loyearp;	if ((lp = byword(cp, begin_years)) != NULL) switch ((int) lp->l_value) {		case YR_MINIMUM:			rp->r_loyear = min_int;			break;		case YR_MAXIMUM:			rp->r_loyear = max_int;			break;		default:	/* "cannot happen" */			(void) fprintf(stderr,				"%s: panic: Invalid l_value %d\n",				progname, lp->l_value);			(void) exit(EXIT_FAILURE);	} else if (sscanf(cp, scheck(cp, "%d"), &rp->r_loyear) != 1) {		error("invalid starting year");		return;	}	cp = hiyearp;	if ((lp = byword(cp, end_years)) != NULL) switch ((int) lp->l_value) {		case YR_MINIMUM:			rp->r_hiyear = min_int;			break;		case YR_MAXIMUM:			rp->r_hiyear = max_int;			break;		case YR_ONLY:			rp->r_hiyear = rp->r_loyear;			break;		default:	/* "cannot happen" */			(void) fprintf(stderr,				"%s: panic: Invalid l_value %d\n",				progname, lp->l_value);			(void) exit(EXIT_FAILURE);	} else if (sscanf(cp, scheck(cp, "%d"), &rp->r_hiyear) != 1) {		error("invalid ending year");		return;	}	if (rp->r_loyear > rp->r_hiyear) {		error("starting year greater than ending year");		return;	}	if (*typep == '\0')		rp->r_yrtype = NULL;	else {		if (rp->r_loyear == rp->r_hiyear) {			error("typed single year");			return;		}		rp->r_yrtype = ecpyalloc(typep);	}	/*	** Day work.	** Accept things such as:	**	1	**	last-Sunday	**	Sun<=20	**	Sun>=7	*/	dp = ecpyalloc(dayp);	if ((lp = byword(dp, lasts)) != NULL) {		rp->r_dycode = DC_DOWLEQ;		rp->r_wday = lp->l_value;		rp->r_dayofmonth = len_months[1][rp->r_month];	} else {		if ((ep = strchr(dp, '<')) != 0)			rp->r_dycode = DC_DOWLEQ;		else if ((ep = strchr(dp, '>')) != 0)			rp->r_dycode = DC_DOWGEQ;		else {			ep = dp;			rp->r_dycode = DC_DOM;		}		if (rp->r_dycode != DC_DOM) {			*ep++ = 0;			if (*ep++ != '=') {				error("invalid day of month");				ifree(dp);				return;			}			if ((lp = byword(dp, wday_names)) == NULL) {				error("invalid weekday name");				ifree(dp);				return;			}			rp->r_wday = lp->l_value;		}		if (sscanf(ep, scheck(ep, "%d"), &rp->r_dayofmonth) != 1 ||			rp->r_dayofmonth <= 0 ||			(rp->r_dayofmonth > len_months[1][rp->r_month])) {				error("invalid day of month");				ifree(dp);				return;		}	}	ifree(dp);}