]> diplodocus.org Git - nmh/blobdiff - uip/conflict.c
Disable assertions by default.
[nmh] / uip / conflict.c
index a3bd1d7bbf6fd8cca8412ceeaf7aa7931edb0d4e..a43c70ee2c899edb578d11b1353c94483f4ad724 100644 (file)
  */
 #define        NGRPS   100
 
-static struct swit switches[] = {
-#define        MAILSW         0
-    { "mail name", 0 },
-#define        SERCHSW        1
-    { "search directory", 0 },
-#define VERSIONSW      2
-    { "version", 0 },
-#define        HELPSW         3
-    { "help", 0 },
-    { NULL, 0 }
-};
+#define CONFLICT_SWITCHES \
+    X("mail name", 0, MAILSW) \
+    X("search directory", 0, SERCHSW) \
+    X("version", 0, VERSIONSW) \
+    X("help", 0, HELPSW) \
+
+#define X(sw, minchars, id) id,
+DEFINE_SWITCH_ENUM(CONFLICT);
+#undef X
+
+#define X(sw, minchars, id) { sw, minchars, id },
+DEFINE_SWITCH_ARRAY(CONFLICT, switches);
+#undef X
 
 static char *mail = NULL;
 static char *dirs[NDIRS];
@@ -92,10 +94,10 @@ main (int argc, char **argv)
                    snprintf (buf, sizeof(buf), "%s [switches] [aliasfiles ...]",
                        invo_name);
                    print_help (buf, switches, 0);
-                   done (1);
+                   done (0);
                case VERSIONSW:
                    print_version(invo_name);
-                   done (1);
+                   done (0);
 
                case MAILSW: 
                    if (!(cp = *argp++) || *cp == '-')
@@ -364,7 +366,7 @@ setup (void)
                        close (fd);
                    }
                execlp (mailproc, r1bindex (mailproc, '/'),
-                       mail, "-subject", invo_name, NULL);
+                       mail, "-subject", invo_name, (void *) NULL);
                adios (mailproc, "unable to exec ");
 
            default: