#define n_tws un.st3.un_tws
static int talked;
-static int pdebug = 0;
static char *datesw;
static char **argp;
int
pcompile (char **vec, char *date)
{
- register char *cp;
-
- if ((cp = getenv ("MHPDEBUG")) && *cp)
- pdebug++;
-
argp = vec;
if ((datesw = date) == NULL)
datesw = "date";
stop;
int
-pmatches (FILE *fp, int msgnum, long start, long stop)
+pmatches (FILE *fp, int msgnum, long start, long stop, int debug)
{
if (!head)
return 1;
- if (!talked++ && pdebug)
+ if (!talked++ && debug)
PRaction (head, 0);
return (*head->n_action) (args (head));
int cclcnt;
register unsigned char *ep, *dp, *sp, *lastep = 0;
- dp = (ep = n->n_expbuf) + sizeof n->n_expbuf;
- sp = astr;
+ dp = (ep = (unsigned char *) n->n_expbuf) + sizeof n->n_expbuf;
+ sp = (unsigned char *) astr;
if (*sp == '^') {
n->n_circf = 1;
sp++;
star:
do {
lp--;
- if (advance (lp, ep))
+ if (advance ((char *) lp, (char *) ep))
return (1);
} while (lp > curlp);
return 0;
register struct tws *tw;
time (&clock);
- if (!mh_strcasecmp (ap, "today"))
+ if (!strcasecmp (ap, "today"))
return dlocaltime (&clock);
- if (!mh_strcasecmp (ap, "yesterday")) {
+ if (!strcasecmp (ap, "yesterday")) {
clock -= (long) (60 * 60 * 24);
return dlocaltime (&clock);
}
- if (!mh_strcasecmp (ap, "tomorrow")) {
+ if (!strcasecmp (ap, "tomorrow")) {
clock += (long) (60 * 60 * 24);
return dlocaltime (&clock);
}
for (i = 0; tw_ldotw[i]; i++)
- if (!mh_strcasecmp (ap, tw_ldotw[i]))
+ if (!strcasecmp (ap, tw_ldotw[i]))
break;
if (tw_ldotw[i]) {
if ((tw = dlocaltime (&clock)) == NULL)
register char *bp;
char buf[BUFSIZ], name[NAMESZ];
register struct tws *tw;
+ m_getfld_state_t gstate = 0;
NMH_UNUSED (stop);
fseek (fp, start, SEEK_SET);
- for (state = FLD, bp = NULL;;) {
- switch (state = m_getfld (state, name, buf, sizeof buf, fp)) {
+ for (bp = NULL;;) {
+ int bufsz = sizeof buf;
+ switch (state = m_getfld (&gstate, name, buf, &bufsz, fp)) {
case FLD:
- case FLDEOF:
case FLDPLUS:
if (bp != NULL)
free (bp), bp = NULL;
bp = add (buf, NULL);
while (state == FLDPLUS) {
- state = m_getfld (state, name, buf, sizeof buf, fp);
+ bufsz = sizeof buf;
+ state = m_getfld (&gstate, name, buf, &bufsz, fp);
bp = add (buf, bp);
}
- if (!mh_strcasecmp (name, n->n_datef))
+ if (!strcasecmp (name, n->n_datef))
break;
- if (state != FLDEOF)
- continue;
+ continue;
case BODY:
- case BODYEOF:
case FILEEOF:
case LENERR:
case FMTERR:
}
break;
}
+ m_getfld_state_destroy (&gstate);
if ((tw = dparsetime (bp)) == NULL)
advise (NULL, "unable to parse %s field in message %d, matching...",