Move #include from h/mh.h to source files
[mmh] / uip / scan.c
index ba90e40..f53cf1d 100644 (file)
@@ -12,6 +12,8 @@
 #include <h/tws.h>
 #include <h/utils.h>
 #include <errno.h>
+#include <unistd.h>
+#include <locale.h>
 
 static struct swit switches[] = {
 #define FORMSW  0
@@ -58,17 +60,17 @@ main(int argc, char **argv)
                        switch (smatch(++cp, switches)) {
                        case AMBIGSW:
                                ambigsw(cp, switches);
-                               done(1);
+                               exit(1);
                        case UNKWNSW:
                                adios(NULL, "-%s unknown", 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 FORMSW:
                                if (!(form = *argp++) || *form == '-')
@@ -130,7 +132,7 @@ main(int argc, char **argv)
                                break;
                }
                fclose(in);
-               done(0);
+               exit(0);
        }
 
        /*
@@ -157,7 +159,7 @@ main(int argc, char **argv)
        /* parse all the message ranges/sequences and set SELECTED */
        for (msgnum = 0; msgnum < msgs.size; msgnum++)
                if (!m_convert(mp, msgs.msgs[msgnum]))
-                       done(1);
+                       exit(1);
        seq_setprev(mp);  /* set the Previous-Sequence */
 
        context_replace(curfolder, folder);  /* update current folder */
@@ -222,6 +224,5 @@ main(int argc, char **argv)
 
        folder_free(mp);  /* free folder/message structure */
 
-       done(0);
-       return 1;
+       return 0;
 }