/*
- * packf.c -- pack a nmh folder into a file
- *
- * 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.
- */
+** packf.c -- pack a nmh folder into a file
+**
+** 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>
argp = arguments;
/*
- * Parse arguments
- */
+ ** Parse arguments
+ */
while ((cp = *argp++)) {
if (*cp == '-') {
switch (smatch (++cp, switches)) {
adios (NULL, "-%s unknown", cp);
case HELPSW:
- snprintf (buf, sizeof(buf), "%s [+folder] [msgs] [switches]",
- invo_name);
+ snprintf (buf, sizeof(buf), "%s [+folder] [msgs] [switches]", invo_name);
print_help (buf, switches, 1);
done (1);
case VERSIONSW:
adios (NULL, "only one folder at a time!");
folder = pluspath (cp);
} else
- app_msgarg(&msgs, cp);
+ app_msgarg(&msgs, cp);
}
if (!file)
file = path (file, TFILE);
/*
- * Check if file to be created (or appended to)
- * exists. If not, ask for confirmation.
- */
+ ** Check if file to be created (or appended to)
+ ** exists. If not, ask for confirmation.
+ */
if (stat (file, &st) == NOTOK) {
if (errno != ENOENT)
adios (file, "error on file");
seq_setprev (mp); /* set the previous-sequence */
/* open and lock new maildrop file */
- if ((md = mbx_open(file, mbx_style, getuid(), getgid(), m_gmprot())) == NOTOK)
+ if ((md = mbx_open(file, mbx_style, getuid(), getgid(), m_gmprot()))
+ == NOTOK)
adios (file, "unable to open");
/* copy all the SELECTED messages to the file */
for (msgnum = mp->lowsel; msgnum <= mp->hghsel; msgnum++)
if (is_selected(mp, msgnum)) {
- if ((fd = open (msgnam = m_name (msgnum), O_RDONLY)) == NOTOK) {
+ if ((fd = open (msgnam = m_name (msgnum), O_RDONLY))
+ == NOTOK) {
admonish (msgnam, "unable to read message");
break;
}
- if (mbx_copy (file, mbx_style, md, fd, mapping, NULL, 1) == NOTOK)
+ if (mbx_copy(file, mbx_style, md, fd, mapping, NULL, 1)
+ == NOTOK)
adios (file, "error writing to file");
close (fd);