int width = 0;
int i, state, msgnum;
int seqnum[NUMATTRS], unseen, num_unseen_seq = 0;
char *cp, *maildir, *file = NULL, *folder = NULL;
char *form = NULL, buf[BUFSIZ];
int width = 0;
int i, state, msgnum;
int seqnum[NUMATTRS], unseen, num_unseen_seq = 0;
char *cp, *maildir, *file = NULL, *folder = NULL;
char *form = NULL, buf[BUFSIZ];
case HELPSW:
snprintf(buf, sizeof(buf), "%s [+folder] [msgs] [switches]", invo_name);
print_help(buf, switches, 1);
case HELPSW:
snprintf(buf, sizeof(buf), "%s [+folder] [msgs] [switches]", invo_name);
print_help(buf, switches, 1);
argp[-2]);
if (strcmp(file = cp, "-")!=0)
file = getcpy(expanddir(cp));
argp[-2]);
if (strcmp(file = cp, "-")!=0)
file = getcpy(expanddir(cp));
/* check if "file" is really stdin */
if (strcmp(file, "-") == 0) {
in = stdin;
file = "stdin";
} else if (!(in = fopen(file, "r"))) {
/* check if "file" is really stdin */
if (strcmp(file, "-") == 0) {
in = stdin;
file = "stdin";
} else if (!(in = fopen(file, "r"))) {
- state = scan(in, msgnum, -1, nfs, width, 0, 0,
- NULL, 0L, 1);
- if (state != SCNMSG && state != SCNENC)
+ state = scan(in, msgnum, SCN_MBOX, fmtstr, width, 0, 0);
+ if (state != SCNMSG)
- adios(NULL, "unable to read folder %s", folder);
+ adios(EX_IOERR, NULL, "unable to read folder %s", folder);
/* parse all the message ranges/sequences and set SELECTED */
for (msgnum = 0; msgnum < msgs.size; msgnum++)
if (!m_convert(mp, msgs.msgs[msgnum]))
/* parse all the message ranges/sequences and set SELECTED */
for (msgnum = 0; msgnum < msgs.size; msgnum++)
if (!m_convert(mp, msgs.msgs[msgnum]))
seq_setprev(mp); /* set the Previous-Sequence */
context_replace(curfolder, folder); /* update current folder */
seq_setprev(mp); /* set the Previous-Sequence */
context_replace(curfolder, folder); /* update current folder */
for (msgnum = mp->lowsel; msgnum <= mp->hghsel; msgnum++) {
if (is_selected(mp, msgnum)) {
if ((in = fopen(cp = m_name(msgnum), "r")) == NULL) {
for (msgnum = mp->lowsel; msgnum <= mp->hghsel; msgnum++) {
if (is_selected(mp, msgnum)) {
if ((in = fopen(cp = m_name(msgnum), "r")) == NULL) {
- switch (state = scan(in, msgnum, 0, nfs, width,
- msgnum == mp->curmsg, unseen,
- folder, 0L, 1)) {
+ switch (state = scan(in, msgnum, SCN_FOLD, fmtstr,
+ width, msgnum==mp->curmsg, unseen)) {