X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/6345e60c392bbf92b3d7ca2bba473f9da5c073ff..9779a9db4316e2348eb120c716acc41e6b12a849:/uip/mhbuild.c diff --git a/uip/mhbuild.c b/uip/mhbuild.c index 09c8efec..48f7e4b4 100644 --- a/uip/mhbuild.c +++ b/uip/mhbuild.c @@ -6,17 +6,21 @@ */ #include "h/mh.h" +#include "sbr/getarguments.h" +#include "sbr/smatch.h" +#include "sbr/m_backup.h" +#include "sbr/context_find.h" +#include "sbr/readconfig.h" +#include "sbr/ambigsw.h" #include "sbr/path.h" #include "sbr/print_version.h" #include "sbr/print_help.h" #include "sbr/error.h" #include -#include "h/md5.h" #include "h/mts.h" #include "h/tws.h" #include "h/mime.h" #include "h/mhparse.h" -#include "h/mhcachesbr.h" #include "h/done.h" #include "h/utils.h" #include "sbr/m_maildir.h" @@ -27,8 +31,8 @@ #define MHBUILD_SWITCHES \ X("auto", 0, AUTOSW) \ X("noauto", 0, NAUTOSW) \ - X("check", 0, CHECKSW) \ - X("nocheck", 0, NCHECKSW) \ + X("check", -5, CHECKSW) \ + X("nocheck", -7, NCHECKSW) \ X("directives", 0, DIRECTIVES) \ X("nodirectives", 0, NDIRECTIVES) \ X("headers", 0, HEADSW) \ @@ -43,8 +47,6 @@ X("noverbose", 0, NVERBSW) \ X("disposition", 0, DISPOSW) \ X("nodisposition", 0, NDISPOSW) \ - X("rcache policy", 0, RCACHESW) \ - X("wcache policy", 0, WCACHESW) \ X("contentid", 0, CONTENTIDSW) \ X("nocontentid", 0, NCONTENTIDSW) \ X("headerencoding encoding-algorithm", 0, HEADERENCSW) \ @@ -101,7 +103,6 @@ main (int argc, char **argv) bool verbosw = false; bool dispo = false; size_t maxunencoded = MAXTEXTPERLN; - int *icachesw; char *cp, buf[BUFSIZ]; char buffer[BUFSIZ], *compfile = NULL; char **argp, **arguments; @@ -142,12 +143,12 @@ main (int argc, char **argv) done (0); case AUTOSW: - /* -auto implies -nodirectives */ + /* -auto implies -nodirectives */ autobuild = true; directives = false; continue; case NAUTOSW: - /* + /* * We're turning directives back on since this is likely here * to override a profile entry */ @@ -155,30 +156,9 @@ main (int argc, char **argv) directives = true; continue; - case RCACHESW: - icachesw = &rcachesw; - goto do_cache; - case WCACHESW: - icachesw = &wcachesw; - do_cache: ; - if (!(cp = *argp++) || *cp == '-') - die("missing argument to %s", argp[-2]); - switch (*icachesw = smatch (cp, cache_policy)) { - case AMBIGSW: - ambigsw (cp, cache_policy); - done (1); - case UNKWNSW: - die("%s unknown", cp); - default: - break; - } - continue; - case CHECKSW: - checksw++; - continue; case NCHECKSW: - checksw = 0; + /* Currently a NOP */ continue; case HEADSW: @@ -224,7 +204,7 @@ main (int argc, char **argv) continue; case HEADERENCSW: { - int encoding; + int encoding; if (!(cp = *argp++) || *cp == '-') die("missing argument to %s", argp[-2]); @@ -250,7 +230,7 @@ main (int argc, char **argv) } case AUTOHEADERENCSW: - header_encoding = CE_UNKNOWN; + header_encoding = CE_UNKNOWN; continue; case MAXUNENCSW: @@ -307,15 +287,6 @@ main (int argc, char **argv) fclose (fp); } - /* 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 = mh_xstrdup(m_maildir(cache_private)); - if (!context_find ("path")) free (path ("./", TFOLDER)); @@ -374,7 +345,7 @@ main (int argc, char **argv) /* build the content structures for MIME message */ ct = build_mime (compfile, autobuild, dist, directives, header_encoding, - maxunencoded, verbosw); + maxunencoded, verbosw); /* * If ct == NULL, that means -auto was set and we found a MIME version