/*
- * mhbuild.c -- expand/translate MIME composition files
- *
- * 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.
- */
+** mhbuild.c -- expand/translate MIME composition files
+**
+** 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 <h/mh.h>
#include <fcntl.h>
int contentidsw = 1;
/*
- * Temporary files
- */
+** Temporary files
+*/
static char infile[BUFSIZ];
static int unlink_infile = 0;
adios (NULL, "cannot specify both standard input and a file");
else
compfile = cp;
- listsw = 0; /* turn off -list if using standard in/out */
+ listsw = 0; /* turn off -list if using std in/out */
verbosw = 0; /* turn off -verbose listings */
break;
}
listsw = 0;
/*
- * Check if we've specified an additional profile
- */
+ ** Check if we've specified an additional profile
+ */
if ((cp = getenv ("MHBUILD"))) {
if ((fp = fopen (cp, "r"))) {
readconfig ((struct node **) 0, fp, cp, 0);
}
/*
- * Read the standard profile setup
- */
+ ** Read the standard profile setup
+ */
if ((fp = fopen (cp = etcpath ("mhn.defaults"), "r"))) {
readconfig ((struct node **) 0, fp, cp, 0);
fclose (fp);
cache_private = getcpy (m_maildir (cache_private));
/*
- * Check for storage directory. If defined, we
- * will store temporary files there. Else we
- * store them in standard nmh directory.
- */
+ ** Check for storage directory. If defined, we
+ ** will store temporary files there. Else we
+ ** store them in standard nmh directory.
+ */
if ((cp = context_find (nmhstorage)) && *cp)
tmp = concat (cp, "/", invo_name, NULL);
else
adios (NULL, "need to specify a %s composition file", invo_name);
/*
- * Process the composition file from standard input.
- */
+ ** Process the composition file from standard input.
+ */
if (compfile[0] == '-' && compfile[1] == '\0') {
/* copy standard input to temporary file */
strncpy (infile, m_mktemp(invo_name, NULL, &fp), sizeof(infile));
}
/*
- * Process the composition file from a file.
- */
+ ** Process the composition file from a file.
+ */
/* build the content structures for MIME message */
ct = build_mime (compfile);
fclose(fp_out);
/*
- * List the message info
- */
+ ** List the message info
+ */
if (listsw)
list_all_messages (cts, headsw, sizesw, verbosw, debugsw);
unlink_done (int status)
{
/*
- * Check if we need to remove stray
- * temporary files.
- */
+ ** Check if we need to remove stray temporary files.
+ */
if (unlink_infile)
unlink (infile);
if (unlink_outfile)