version 1.7, 1998/12/13 07:31:07 |
version 1.10, 1999/11/25 03:46:46 |
|
|
* 3-charweekday (Friday, Monday, mon.) |
* 3-charweekday (Friday, Monday, mon.) |
* numeric month or day (1, 2, 04) |
* numeric month or day (1, 2, 04) |
* |
* |
* Any character may separate them, or they may not be separated. Any line, |
* Any character except \t or '*' may separate them, or they may not be |
* following a line that is matched, that starts with "whitespace", is shown |
* separated. Any line following a line that is matched, that starts |
* along with the matched line. |
* with \t, is shown along with the matched line. |
*/ |
*/ |
struct match * |
struct match * |
isnow(endp) |
isnow(endp) |
|
|
memcpy(&tmtmp, tp, sizeof(struct tm)); |
memcpy(&tmtmp, tp, sizeof(struct tm)); |
tmtmp.tm_mday = dayp; |
tmtmp.tm_mday = dayp; |
tmtmp.tm_mon = monthp - 1; |
tmtmp.tm_mon = monthp - 1; |
|
if (vwd) { |
|
/* We want the event next year if it's late now |
|
* this year. The 50-day limit means we don't have to |
|
* worry if next year is or isn't a leap year. |
|
*/ |
|
if (tp->tm_yday > 300 && tmtmp.tm_mon <= 1) |
|
variable_weekday(&vwd, tmtmp.tm_mon + 1, |
|
tmtmp.tm_year + TM_YEAR_BASE + 1); |
|
else |
|
variable_weekday(&vwd, tmtmp.tm_mon + 1, |
|
tmtmp.tm_year + TM_YEAR_BASE); |
|
day = cumdays[tmtmp.tm_mon + 1] + vwd; |
|
tmtmp.tm_mday = vwd; |
|
} |
v2 = day - tp->tm_yday; |
v2 = day - tp->tm_yday; |
if ((v2 > v1) || (v2 < 0)) { |
if ((v2 > v1) || (v2 < 0)) { |
if ((v2 += isleap(tp->tm_year + TM_YEAR_BASE) ? 366 : 365) |
if ((v2 += isleap(tp->tm_year + TM_YEAR_BASE) ? 366 : 365) |
|
|
if (flags & F_SPECIAL) { |
if (flags & F_SPECIAL) { |
tmtmp.tm_mon = 0; /* Gee, mktime() is nice */ |
tmtmp.tm_mon = 0; /* Gee, mktime() is nice */ |
tmtmp.tm_mday = spev[v1].getev(tmtmp.tm_year + |
tmtmp.tm_mday = spev[v1].getev(tmtmp.tm_year + |
vwd + TM_YEAR_BASE); |
TM_YEAR_BASE) + vwd; |
} else if (vwd) { |
} else if (vwd) { |
v1 = vwd; |
v1 = vwd; |
variable_weekday(&v1, tmtmp.tm_mon + 1, |
variable_weekday(&v1, tmtmp.tm_mon + 1, |