X-Git-Url: http://git.marmaro.de/?p=mmh;a=blobdiff_plain;f=uip%2Fmhshow.c;h=ac6b0c3e59c9fc6534b1942c1e4b67836206e20c;hp=42e0ee06867d8a99fcf1d974d79eec250b9d1f46;hb=31dc797eb5178970d68962ca8939da3fd9a8efda;hpb=3d78b9c80a95f4e7885ed607018f9b1b9be559b4 diff --git a/uip/mhshow.c b/uip/mhshow.c index 42e0ee0..ac6b0c3 100644 --- a/uip/mhshow.c +++ b/uip/mhshow.c @@ -9,70 +9,36 @@ #include #include #include -#include #include #include -#include #include #include #include #include #include -#ifdef HAVE_SYS_WAIT_H -# include -#endif - static struct swit switches[] = { -#define CHECKSW 0 - { "check", 0 }, -#define NCHECKSW 1 - { "nocheck", 0 }, -#define PAUSESW 2 - { "pause", 0 }, -#define NPAUSESW 3 - { "nopause", 0 }, -#define SERIALSW 4 - { "serialonly", 0 }, -#define NSERIALSW 5 - { "noserialonly", 0 }, -#define VERBSW 6 +#define VERBSW 0 { "verbose", 0 }, -#define NVERBSW 7 +#define NVERBSW 1 { "noverbose", 0 }, -#define FILESW 8 /* interface from show */ +#define FILESW 2 /* interface from show */ { "file file", 0 }, -#define FORMSW 9 +#define FORMSW 3 { "form formfile", 0 }, -#define PARTSW 10 +#define PARTSW 4 { "part number", 0 }, -#define TYPESW 11 +#define TYPESW 5 { "type content", 0 }, -#define RCACHESW 12 +#define RCACHESW 6 { "rcache policy", 0 }, -#define WCACHESW 13 +#define WCACHESW 7 { "wcache policy", 0 }, -#define VERSIONSW 14 +#define VERSIONSW 8 { "version", 0 }, -#define HELPSW 15 +#define HELPSW 9 { "help", 0 }, - -/* -** switches for moreproc/mhlproc -*/ -#define PROGSW 16 - { "moreproc program", -4 }, -#define NPROGSW 17 - { "nomoreproc", -3 }, -#define LENSW 18 - { "length lines", -4 }, -#define WIDTHSW 19 - { "width columns", -4 }, - -/* -** switches for debugging -*/ -#define DEBUGSW 20 +#define DEBUGSW 10 { "debug", -5 }, { NULL, 0 } }; @@ -88,11 +54,7 @@ extern char *cache_public; extern char *cache_private; /* mhshowsbr.c */ -extern int pausesw; -extern int serialsw; -extern char *progsw; extern int nolist; -extern int nomore; /* flags for moreproc/header display */ extern char *formsw; /* mhmisc.c */ @@ -127,7 +89,7 @@ void freects_done(int) NORETURN; /* ** static prototypes */ -static RETSIGTYPE pipeser(int); +static void pipeser(int); int @@ -195,27 +157,6 @@ do_cache: } continue; - case CHECKSW: - checksw++; - continue; - case NCHECKSW: - checksw = 0; - continue; - - case PAUSESW: - pausesw = 1; - continue; - case NPAUSESW: - pausesw = 0; - continue; - - case SERIALSW: - serialsw = 1; - continue; - case NSERIALSW: - serialsw = 0; - continue; - case PARTSW: if (!(cp = *argp++) || *cp == '-') adios(NULL, "missing argument to %s", @@ -238,7 +179,7 @@ do_cache: if (!(cp = *argp++) || (*cp == '-' && cp[1])) adios(NULL, "missing argument to %s", argp[-2]); - file = *cp == '-' ? cp : path(cp, TFILE); + file = *cp == '-' ? cp : getcpy(expanddir(cp)); continue; case FORMSW: @@ -250,25 +191,6 @@ do_cache: formsw = getcpy(etcpath(cp)); continue; - /* - ** Switches for moreproc/mhlproc - */ - case PROGSW: - if (!(progsw = *argp++) || *progsw == '-') - adios(NULL, "missing argument to %s", - argp[-2]); - continue; - case NPROGSW: - nomore++; - continue; - - case LENSW: - case WIDTHSW: - if (!(cp = *argp++) || *cp == '-') - adios(NULL, "missing argument to %s", - argp[-2]); - continue; - case VERBSW: verbosw = 1; continue; @@ -284,7 +206,7 @@ do_cache: if (folder) adios(NULL, "only one folder at a time!"); else - folder = pluspath(cp); + folder = getcpy(expandfol(cp)); } else app_msgarg(&msgs, cp); } @@ -295,9 +217,8 @@ do_cache: set_endian(); - if ((cp = getenv("MM_NOASK")) && !strcmp(cp, "1")) { + if ((cp = getenv("MM_NOASK")) && strcmp(cp, "1")==0) { nolist = 1; - pausesw = 0; } /* @@ -328,7 +249,7 @@ do_cache: /* Check for private cache location */ if (!(cache_private = context_find(nmhprivcache))) cache_private = ".cache"; - cache_private = getcpy(m_maildir(cache_private)); + cache_private = getcpy(toabsdir(cache_private)); /* ** Check for storage directory. If specified, @@ -338,7 +259,7 @@ do_cache: if ((cp = context_find(nmhstorage)) && *cp) tmp = concat(cp, "/", invo_name, NULL); else - tmp = add(m_maildir(invo_name), NULL); + tmp = getcpy(toabsdir(invo_name)); if (file && msgs.size) adios(NULL, "cannot specify msg and file at same time!"); @@ -351,17 +272,17 @@ do_cache: adios(NULL, "out of memory"); ctp = cts; - if ((ct = parse_mime(file))); + if ((ct = parse_mime(file))) *ctp++ = ct; } else { /* ** message(s) are coming from a folder */ if (!msgs.size) - app_msgarg(&msgs, "cur"); + app_msgarg(&msgs, seq_cur); if (!folder) - folder = getfolder(FCUR); - maildir = m_maildir(folder); + folder = getcurfol(); + maildir = toabsdir(folder); if (chdir(maildir) == NOTOK) adios(maildir, "unable to change directory to"); @@ -389,7 +310,7 @@ do_cache: set_unseen(mp, msgnum); seq_setprev(mp); /* set the Previous-Sequence */ - seq_setunseen(mp, 1); /* unset the Unseen-Sequence */ + seq_setunseen(mp, 0); /* unset unseen seqs for shown msgs */ if (!(cts = (CT *) calloc((size_t) (mp->numsel + 1), sizeof(*cts)))) @@ -446,8 +367,8 @@ do_cache: /* If reading from a folder, do some updating */ if (mp) { - context_replace(pfolder, folder); /* update current folder */ - seq_setcur(mp, mp->hghsel); /* update current message */ + context_replace(curfolder, folder); /* update current folder */ + seq_setcur(mp, mp->hghsel); /* update current message */ seq_save(mp); /* synchronize sequences */ context_save(); /* save the context file */ } @@ -457,7 +378,7 @@ do_cache: } -static RETSIGTYPE +static void pipeser(int i) { if (i == SIGQUIT) {