X-Git-Url: http://git.marmaro.de/?p=mmh;a=blobdiff_plain;f=uip%2Fmhbuild.c;h=15132eece4121407e176c0d4cbd4dbdf80050034;hp=bacec1003d26f62ecb697b4d678dfdf9f9b91da6;hb=56a805299de35d8924969138aef4d0f1580daa6d;hpb=1691e80890e5d8ba258c51c214a3e91880e1db2b diff --git a/uip/mhbuild.c b/uip/mhbuild.c index bacec10..15132ee 100644 --- a/uip/mhbuild.c +++ b/uip/mhbuild.c @@ -3,6 +3,10 @@ * 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. */ #include @@ -11,11 +15,12 @@ #include #include #include -#include -#include +#include +#include #include #include #include +#include #ifdef HAVE_SYS_WAIT_H # include @@ -54,18 +59,20 @@ static struct swit switches[] = { { "rcache policy", 0 }, #define WCACHESW 15 { "wcache policy", 0 }, -#define VERSIONSW 16 +#define CONTENTIDSW 16 + { "contentid", 0 }, +#define NCONTENTIDSW 17 + { "nocontentid", 0 }, +#define VERSIONSW 18 { "version", 0 }, -#define HELPSW 17 - { "help", 4 }, -#define DEBUGSW 18 +#define HELPSW 19 + { "help", 0 }, +#define DEBUGSW 20 { "debug", -5 }, { NULL, 0 } }; -extern int errno; - /* mhbuildsbr.c */ extern int checksw; extern char *tmp; /* directory to place temp files */ @@ -82,6 +89,7 @@ int verbosw = 0; int ebcdicsw = 0; int listsw = 0; int rfc934sw = 0; +int contentidsw = 1; /* * Temporary files @@ -92,6 +100,7 @@ static int unlink_infile = 0; static char outfile[BUFSIZ]; static int unlink_outfile = 0; +static int unlink_done (int); /* mhbuildsbr.c */ CT build_mime (char *); @@ -118,6 +127,8 @@ main (int argc, char **argv) CT ct, cts[2]; FILE *fp; + done=unlink_done; + #ifdef LOCALE setlocale(LC_ALL, ""); #endif @@ -216,6 +227,13 @@ main (int argc, char **argv) sizesw = 0; continue; + case CONTENTIDSW: + contentidsw = 1; + continue; + case NCONTENTIDSW: + contentidsw = 0; + continue; + case VERBSW: verbosw++; continue; @@ -363,13 +381,12 @@ main (int argc, char **argv) unlink_outfile = 0; free_content (ct); - done (0); - /* NOT REACHED */ + return done (0); } -void -done (int status) +static int +unlink_done (int status) { /* * Check if we need to remove stray @@ -381,4 +398,5 @@ done (int status) unlink (outfile); exit (status); + return 1; /* dead code to satisfy the compiler */ }