]> diplodocus.org Git - nmh/blobdiff - uip/mhparam.c
Added temporary probes to see what file --mime and file -i do on
[nmh] / uip / mhparam.c
index 1b35518b6939c83c45bf724508c18164abf5827a..9da7ba1392afb669a186c5e0740a57c0ba197ae4 100644 (file)
 
 #include <h/mh.h>
 
+#define MHPARAM_SWITCHES \
+    X("components", 0, COMPSW) \
+    X("nocomponents", 0, NCOMPSW) \
+    X("all", 0, ALLSW) \
+    X("version", 0, VERSIONSW) \
+    X("help", 0, HELPSW) \
+    X("debug", 5, DEBUGSW) \
+
+#define X(sw, minchars, id) id,
+DEFINE_SWITCH_ENUM(MHPARAM);
+#undef X
+
+#define X(sw, minchars, id) { sw, minchars, id },
+DEFINE_SWITCH_ARRAY(MHPARAM, switches);
+#undef X
+
 extern char *mhlibdir;
 extern char *mhetcdir;
 
 char *sbackup = BACKUP_PREFIX;
-char *slink = LINK;
-
-static struct swit switches[] = {
-#define        COMPSW    0
-    { "components", 0 },
-#define        NCOMPSW   1
-    { "nocomponents", 0 },
-#define        ALLSW     2
-    { "all", 0 },
-#define VERSIONSW 3
-    { "version", 0 },
-#define        HELPSW    4
-    { "help", 0 },
-#define DEBUGSW   5
-    { "debug", -5 },
-    { NULL, 0 }
-};
+
+char *lockmethod =
+#if defined FCNTL_LOCKING
+    "fcntl"
+#elif defined FLOCK_LOCKING
+    "flock"
+#elif defined LOCKF_LOCKING
+    "lockf"
+#elif defined DOT_LOCKING
+    "dot"
+#else
+    "none"
+#endif
+    ;
+
+char *sasl =
+#ifdef CYRUS_SASL
+    "cyrus_sasl";
+#else
+    "";
+#endif
+
+char *tls =
+#ifdef TLS_SUPPORT
+    "tls";
+#else
+    "";
+#endif
 
 struct proc {
     char *p_name;
@@ -43,12 +70,10 @@ static struct proc procs [] = {
      { "context",       &context },
      { "mh-sequences",  &mh_seq },
      { "buildmimeproc", &buildmimeproc },
-     { "faceproc",      &faceproc },
      { "fileproc",      &fileproc },
      { "foldprot",      &foldprot },
      { "formatproc",   &formatproc },
      { "incproc",       &incproc },
-     { "installproc",   &installproc  },
      { "lproc",         &lproc },
      { "mailproc",      &mailproc },
      { "mhlproc",       &mhlproc },
@@ -57,7 +82,6 @@ static struct proc procs [] = {
      { "mshproc",       &mshproc },
      { "packproc",      &packproc },
      { "postproc",      &postproc },
-     { "rmfproc",       &rmfproc },
      { "rmmproc",       &rmmproc },
      { "sendproc",      &sendproc },
      { "showmimeproc",  &showmimeproc },
@@ -69,7 +93,9 @@ static struct proc procs [] = {
      { "etcdir",        &mhetcdir },
      { "libdir",        &mhlibdir },
      { "sbackup",       &sbackup },
-     { "link",          &slink },
+     { "lockmethod",    &lockmethod },
+     { "sasl",          &sasl },
+     { "tls",           &tls },
      { NULL,            NULL },
 };
 
@@ -110,10 +136,10 @@ main(int argc, char **argv)
                    snprintf (buf, sizeof(buf), "%s [profile-components] [switches]",
                        invo_name);
                    print_help (buf, switches, 1);
-                   done (1);
+                   done (0);
                case VERSIONSW:
                    print_version(invo_name);
-                   done (1);
+                   done (0);
 
                case COMPSW:
                    components = 1;
@@ -191,7 +217,7 @@ p_find(char *str)
     struct proc *ps;
 
     for (ps = procs; ps->p_name; ps++)
-       if (!mh_strcasecmp (ps->p_name, str))
+       if (!strcasecmp (ps->p_name, str ? str : ""))
            return (*ps->p_field);
 
     return NULL;