Move #include from h/mh.h to source files
[mmh] / uip / burst.c
index 1464cd6..21b218b 100644 (file)
@@ -7,6 +7,9 @@
 */
 
 #include <h/mh.h>
+#include <unistd.h>
+#include <sys/stat.h>
+#include <locale.h>
 
 static struct swit switches[] = {
 #define VERBSW 0
@@ -45,9 +48,7 @@ main(int argc, char **argv)
        struct smsg *smsgs;
        struct msgs *mp;
 
-#ifdef LOCALE
        setlocale(LC_ALL, "");
-#endif
        invo_name = mhbasename(argv[0]);
 
        /* read user profile/context */
@@ -61,17 +62,18 @@ main(int argc, char **argv)
                        switch (smatch(++cp, switches)) {
                        case AMBIGSW:
                                ambigsw(cp, switches);
-                               done(1);
+                               /* sysexits.h EX_USAGE */
+                               exit(1);
                        case UNKWNSW:
                                adios(NULL, "-%s unknown\n", cp);
 
                        case HELPSW:
                                snprintf(buf, sizeof(buf), "%s [+folder] [msgs] [switches]", invo_name);
                                print_help(buf, switches, 1);
-                               done(1);
+                               exit(0);
                        case VERSIONSW:
                                print_version(invo_name);
-                               done(1);
+                               exit(0);
 
                        case VERBSW:
                                verbosw++;
@@ -111,7 +113,8 @@ main(int argc, char **argv)
        /* parse all the message ranges/sequences and set SELECTED */
        for (msgnum = 0; msgnum < msgp; msgnum++)
                if (!m_convert(mp, msgs[msgnum]))
-                       done(1);
+                       /* sysexits.h EX_USAGE */
+                       exit(1);
        seq_setprev(mp);  /* set the previous-sequence */
 
        smsgs = (struct smsg *)
@@ -150,8 +153,7 @@ main(int argc, char **argv)
        seq_save(mp);
        context_save();
        folder_free(mp);
-       done(0);
-       return 1;
+       return 0;
 }