* complete copyright information.
*/
-#include <h/mh.h>
-#include <h/utils.h>
+#include "h/mh.h"
+#include "sbr/path.h"
+#include "sbr/print_version.h"
+#include "sbr/print_help.h"
+#include "sbr/error.h"
+#include "h/done.h"
+#include "h/utils.h"
#include "sbr/m_maildir.h"
#define MHPATH_SWITCHES \
struct msgs_array msgs = { 0, 0, NULL };
struct msgs *mp;
- if (nmh_init(argv[0], 2)) { return 1; }
+ if (nmh_init(argv[0], true, false)) { return 1; }
arguments = getarguments (invo_name, argc, argv, 1);
argp = arguments;
ambigsw (cp, switches);
done (1);
case UNKWNSW:
- adios (NULL, "-%s unknown", cp);
+ die("-%s unknown", cp);
case HELPSW:
snprintf (buf, sizeof(buf), "%s [+folder] [msgs] [switches]",
}
if (*cp == '+' || *cp == '@') {
if (folder)
- adios (NULL, "only one folder at a time!");
+ die("only one folder at a time!");
folder = pluspath (cp);
} else
app_msgarg(&msgs, cp);
/* read folder and create message structure */
if (!(mp = folder_read (folder, 1)))
- adios (NULL, "unable to read folder %s", folder);
+ die("unable to read folder %s", folder);
/*
* We need to make sure there is message status space
*/
if (mp->hghmsg >= mp->hghoff) {
if (!(mp = folder_realloc (mp, 1, mp->hghmsg + 10)))
- adios (NULL, "unable to allocate folder storage");
+ die("unable to allocate folder storage");
} else if (mp->lowoff > 1) {
if (!(mp = folder_realloc (mp, 1, mp->hghoff)))
- adios (NULL, "unable to allocate folder storage");
+ die("unable to allocate folder storage");
}
mp->msgflags |= ALLOW_NEW; /* allow the "new" sequence */