X-Git-Url: http://git.marmaro.de/?p=mmh;a=blobdiff_plain;f=uip%2Fscan.c;h=d228c717128f0add4af4031ec169c1059806be78;hp=f3e5a4fa14d9a6732f3576ef31f4eec052d426bb;hb=67411b1f95d6ec987b4c732459e1ba8a8ac192c6;hpb=9f9bfa91d88b3ca4cd9206c1f2b17c6d13ebcaba diff --git a/uip/scan.c b/uip/scan.c index f3e5a4f..d228c71 100644 --- a/uip/scan.c +++ b/uip/scan.c @@ -10,7 +10,6 @@ #include #include #include -#include #include #include @@ -23,34 +22,19 @@ static struct swit switches[] = { { "form formatfile", 0 }, #define FMTSW 3 { "format string", 5 }, -#define HEADSW 4 - { "header", 0 }, -#define NHEADSW 5 - { "noheader", 0 }, -#define WIDTHSW 6 +#define WIDTHSW 4 { "width columns", 0 }, -#define REVSW 7 - { "reverse", 0 }, -#define NREVSW 8 - { "noreverse", 0 }, -#define FILESW 9 +#define FILESW 5 { "file file", 4 }, -#define VERSIONSW 10 +#define VERSIONSW 6 { "version", 0 }, -#define HELPSW 11 +#define HELPSW 7 { "help", 0 }, { NULL, 0 } }; /* -** global for sbr/formatsbr.c - yech! -*/ -#ifdef LBL -extern struct msgs *fmt_current_folder; -#endif - -/* ** prototypes */ void clear_screen(void); /* from termsbr.c */ @@ -59,8 +43,8 @@ void clear_screen(void); /* from termsbr.c */ int main(int argc, char **argv) { - int clearflag = 0, hdrflag = 0, ontty; - int width = 0, revflag = 0; + int clearflag = 0, ontty; + int width = 0; int i, state, msgnum; int seqnum[NUMATTRS], unseen, num_unseen_seq = 0; char *cp, *maildir, *file = NULL, *folder = NULL; @@ -78,7 +62,6 @@ main(int argc, char **argv) /* read user profile/context */ context_read(); - mts_init(invo_name); arguments = getarguments(invo_name, argc, argv, 1); argp = arguments; @@ -122,25 +105,12 @@ main(int argc, char **argv) form = NULL; continue; - case HEADSW: - hdrflag++; - continue; - case NHEADSW: - hdrflag = 0; - continue; - case WIDTHSW: if (!(cp = *argp++) || *cp == '-') adios(NULL, "missing argument to %s", argp[-2]); width = atoi(cp); continue; - case REVSW: - revflag++; - continue; - case NREVSW: - revflag = 0; - continue; case FILESW: if (!(cp = *argp++) || (cp[0] == '-' && cp[1])) @@ -182,16 +152,10 @@ main(int argc, char **argv) adios(file, "unable to open"); } -#ifndef JLR - if (hdrflag) { - printf("FOLDER %s\t%s\n", file, dtimenow(1)); - } -#endif /* JLR */ - m_unknown(in); for (msgnum = 1; ; ++msgnum) { state = scan(in, msgnum, -1, nfs, width, 0, 0, - hdrflag ? file : NULL, 0L, 1); + NULL, 0L, 1); if (state != SCNMSG && state != SCNENC) break; } @@ -252,26 +216,13 @@ main(int argc, char **argv) ontty = isatty(fileno(stdout)); -#ifdef LBL - else - fmt_current_folder = mp; -#endif - - for (msgnum = revflag ? mp->hghsel : mp->lowsel; - (revflag ? msgnum >= mp->lowsel : msgnum <= mp->hghsel); - msgnum += (revflag ? -1 : 1)) { + for (msgnum = mp->lowsel; msgnum <= mp->hghsel; msgnum++) { if (is_selected(mp, msgnum)) { if ((in = fopen(cp = m_name(msgnum), "r")) == NULL) { admonish(cp, "unable to open message"); continue; } -#ifndef JLR - if (hdrflag) { - printf("FOLDER %s\t%s\n", folder, dtimenow(1)); - } -#endif /* JLR */ - /* ** Check if message is in any sequence given ** by Unseen-Sequence profile entry. @@ -299,17 +250,12 @@ main(int argc, char **argv) advise(NULL, "message %d: empty", msgnum); break; } - hdrflag = 0; fclose(in); if (ontty) fflush(stdout); } } -#ifdef LBL - seq_save(mp); /* because formatsbr might have made changes */ -#endif - folder_free(mp); /* free folder/message structure */ if (clearflag) clear_screen();