X-Git-Url: http://git.marmaro.de/?a=blobdiff_plain;f=uip%2Fmhbuild.c;h=e8e74231b53edd2bcdc2beb949ea31ff247c4375;hb=e69044f7624abe5cb2cb796d528c0cc5f29515f7;hp=fbe2b2c6c5a86fe1efac1542c6b77fab661cf533;hpb=2f689a1cb907a5de04e6d39ffd217a69af3216c7;p=mmh diff --git a/uip/mhbuild.c b/uip/mhbuild.c index fbe2b2c..e8e7423 100644 --- a/uip/mhbuild.c +++ b/uip/mhbuild.c @@ -2,8 +2,6 @@ /* * mhbuild.c -- expand/translate MIME composition files * - * $Id$ - * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. @@ -22,52 +20,52 @@ #include #include -#ifdef HAVE_SYS_WAIT_H -# include -#endif - static struct swit switches[] = { #define CHECKSW 0 { "check", 0 }, #define NCHECKSW 1 { "nocheck", 0 }, -#define EBCDICSW 2 +#define DIRECTIVES 2 + { "directives", 0 }, +#define NDIRECTIVES 3 + { "nodirectives", 0 }, +#define EBCDICSW 4 { "ebcdicsafe", 0 }, -#define NEBCDICSW 3 +#define NEBCDICSW 5 { "noebcdicsafe", 0 }, -#define HEADSW 4 +#define HEADSW 6 { "headers", 0 }, -#define NHEADSW 5 +#define NHEADSW 7 { "noheaders", 0 }, -#define LISTSW 6 +#define LISTSW 8 { "list", 0 }, -#define NLISTSW 7 +#define NLISTSW 9 { "nolist", 0 }, -#define SIZESW 8 +#define SIZESW 10 { "realsize", 0 }, -#define NSIZESW 9 +#define NSIZESW 11 { "norealsize", 0 }, -#define RFC934SW 10 +#define RFC934SW 12 { "rfc934mode", 0 }, -#define NRFC934SW 11 +#define NRFC934SW 13 { "norfc934mode", 0 }, -#define VERBSW 12 +#define VERBSW 14 { "verbose", 0 }, -#define NVERBSW 13 +#define NVERBSW 15 { "noverbose", 0 }, -#define RCACHESW 14 +#define RCACHESW 16 { "rcache policy", 0 }, -#define WCACHESW 15 +#define WCACHESW 17 { "wcache policy", 0 }, -#define CONTENTIDSW 16 +#define CONTENTIDSW 18 { "contentid", 0 }, -#define NCONTENTIDSW 17 +#define NCONTENTIDSW 19 { "nocontentid", 0 }, -#define VERSIONSW 18 +#define VERSIONSW 20 { "version", 0 }, -#define HELPSW 19 +#define HELPSW 21 { "help", 0 }, -#define DEBUGSW 20 +#define DEBUGSW 22 { "debug", -5 }, { NULL, 0 } }; @@ -102,16 +100,13 @@ static int unlink_outfile = 0; static void unlink_done (int) NORETURN; /* mhbuildsbr.c */ -CT build_mime (char *); +CT build_mime (char *, int); int output_message (CT, char *); int output_message_fp (CT, FILE *, char*); /* mhlistsbr.c */ int list_all_messages (CT *, int, int, int, int); -/* mhmisc.c */ -void set_endian (void); - /* mhfree.c */ void free_content (CT); @@ -119,7 +114,7 @@ void free_content (CT); int main (int argc, char **argv) { - int sizesw = 1, headsw = 1; + int sizesw = 1, headsw = 1, directives = 1; int *icachesw; char *cp, buf[BUFSIZ]; char buffer[BUFSIZ], *compfile = NULL; @@ -162,10 +157,10 @@ main (int argc, char **argv) case HELPSW: snprintf (buf, sizeof(buf), "%s [switches] file", invo_name); print_help (buf, switches, 1); - done (1); + done (0); case VERSIONSW: print_version(invo_name); - done (1); + done (0); case RCACHESW: icachesw = &rcachesw; @@ -207,6 +202,13 @@ main (int argc, char **argv) headsw = 0; continue; + case DIRECTIVES: + directives = 1; + continue; + case NDIRECTIVES: + directives = 0; + continue; + case LISTSW: listsw++; continue; @@ -252,11 +254,6 @@ main (int argc, char **argv) compfile = cp; } - set_endian (); - - if ((cp = getenv ("MM_NOASK")) && !strcmp (cp, "1")) - listsw = 0; - /* * Check if we've specified an additional profile */ @@ -315,7 +312,7 @@ main (int argc, char **argv) unlink_infile = 1; /* build the content structures for MIME message */ - ct = build_mime (infile); + ct = build_mime (infile, directives); cts[0] = ct; cts[1] = NULL; @@ -349,7 +346,7 @@ main (int argc, char **argv) */ /* build the content structures for MIME message */ - ct = build_mime (compfile); + ct = build_mime (compfile, directives); cts[0] = ct; cts[1] = NULL;