]> diplodocus.org Git - nmh/blobdiff - uip/conflict.c
Fixed quoting of filename, expanded C-T parameter values, etc.,
[nmh] / uip / conflict.c
index 2324c650a4eabab9672695835eb29b491a1dfc4c..4c140022345c04285d1ac032186e2c537077c576 100644 (file)
  */
 #define        NGRPS   100
 
  */
 #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];
 
 static char *mail = NULL;
 static char *dirs[NDIRS];
@@ -66,14 +68,7 @@ main (int argc, char **argv)
     char *cp, **argp, **arguments;
     char buf[BUFSIZ], *akv[50];
 
     char *cp, **argp, **arguments;
     char buf[BUFSIZ], *akv[50];
 
-#ifdef LOCALE
-    setlocale(LC_ALL, "");
-#endif
-    invo_name = r1bindex (argv[0], '/');
-
-    /* foil search of user profile/context */
-    if (context_foil (NULL) == -1)
-       done (1);
+    if (nmh_init(argv[0], 0 /* use context_foil() */)) { return 1; }
 
     mts_init (invo_name);
     arguments = getarguments (invo_name, argc, argv, 0);
 
     mts_init (invo_name);
     arguments = getarguments (invo_name, argc, argv, 0);
@@ -364,7 +359,7 @@ setup (void)
                        close (fd);
                    }
                execlp (mailproc, r1bindex (mailproc, '/'),
                        close (fd);
                    }
                execlp (mailproc, r1bindex (mailproc, '/'),
-                       mail, "-subject", invo_name, NULL);
+                       mail, "-subject", invo_name, (void *) NULL);
                adios (mailproc, "unable to exec ");
 
            default: 
                adios (mailproc, "unable to exec ");
 
            default: