X-Git-Url: http://git.marmaro.de/?a=blobdiff_plain;f=uip%2Fmhlist.c;h=99b2cc787c8a9f0becc47cc021e044583b42675b;hb=264f6e648f566f8efaa0188fb6a9e4908329d6d6;hp=b87e522132d550cd9499c391ce6294aa53ed5834;hpb=d39e2c447b0d163a5a63f480b23d06edb7a73aa0;p=mmh diff --git a/uip/mhlist.c b/uip/mhlist.c index b87e522..99b2cc7 100644 --- a/uip/mhlist.c +++ b/uip/mhlist.c @@ -9,56 +9,37 @@ #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 HEADSW 2 +#define HEADSW 0 { "headers", 0 }, -#define NHEADSW 3 +#define NHEADSW 1 { "noheaders", 0 }, -#define SIZESW 4 +#define SIZESW 2 { "realsize", 0 }, -#define NSIZESW 5 +#define NSIZESW 3 { "norealsize", 0 }, -#define VERBSW 6 +#define VERBSW 4 { "verbose", 0 }, -#define NVERBSW 7 +#define NVERBSW 5 { "noverbose", 0 }, -#define FILESW 8 /* interface from show */ +#define FILESW 6 /* interface from show */ { "file file", 0 }, -#define PARTSW 9 +#define PARTSW 7 { "part number", 0 }, -#define TYPESW 10 +#define TYPESW 8 { "type content", 0 }, -#define RCACHESW 11 - { "rcache policy", 0 }, -#define WCACHESW 12 - { "wcache policy", 0 }, -#define VERSIONSW 13 +#define VERSIONSW 9 { "version", 0 }, -#define HELPSW 14 +#define HELPSW 10 { "help", 0 }, - -/* -** switches for debugging -*/ -#define DEBUGSW 15 +#define DEBUGSW 11 { "debug", -5 }, { NULL, 0 } }; @@ -67,12 +48,6 @@ static struct swit switches[] = { /* mhparse.c */ extern char *tmp; /* directory to place temp files */ -/* mhcachesbr.c */ -extern int rcachesw; -extern int wcachesw; -extern char *cache_public; -extern char *cache_private; - /* mhmisc.c */ extern int npart; extern int ntype; @@ -111,14 +86,14 @@ void freects_done(int) NORETURN; /* ** static prototypes */ -static RETSIGTYPE pipeser(int); +static void pipeser(int); int main(int argc, char **argv) { int sizesw = 1, headsw = 1; - int msgnum, *icachesw; + int msgnum; char *cp, *file = NULL, *folder = NULL; char *maildir, buf[100], **argp; char **arguments; @@ -159,32 +134,6 @@ main(int argc, char **argv) print_version(invo_name); done(1); - case RCACHESW: - icachesw = &rcachesw; - goto do_cache; - case WCACHESW: - icachesw = &wcachesw; -do_cache: - if (!(cp = *argp++) || *cp == '-') - adios(NULL, "missing argument to %s", argp[-2]); - switch (*icachesw = smatch(cp, caches)) { - case AMBIGSW: - ambigsw(cp, caches); - done(1); - case UNKWNSW: - adios(NULL, "%s unknown", cp); - default: - break; - } - continue; - - case CHECKSW: - checksw++; - continue; - case NCHECKSW: - checksw = 0; - continue; - case HEADSW: headsw = 1; continue; @@ -250,15 +199,6 @@ do_cache: set_endian(); - /* Check for public cache location */ - if ((cache_public = context_find(nmhcache)) && *cache_public != '/') - cache_public = NULL; - - /* Check for private cache location */ - if (!(cache_private = context_find(nmhprivcache))) - cache_private = ".cache"; - cache_private = getcpy(toabsdir(cache_private)); - /* ** Check for storage directory. If specified, ** then store temporary files there. Else we @@ -280,14 +220,14 @@ 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 = getcurfol(); maildir = toabsdir(folder); @@ -361,7 +301,7 @@ do_cache: /* If reading from a folder, do some updating */ if (mp) { - context_replace(pfolder, folder); /* update current folder */ + 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 */ @@ -372,7 +312,7 @@ do_cache: } -static RETSIGTYPE +static void pipeser(int i) { if (i == SIGQUIT) {