refactor show-supported coding
authorJeremy Harris <jgh146exb@wizmail.org>
Mon, 1 Jan 2018 13:47:26 +0000 (13:47 +0000)
committerJeremy Harris <jgh146exb@wizmail.org>
Mon, 1 Jan 2018 13:47:26 +0000 (13:47 +0000)
src/src/drtables.c
src/src/exim.c
src/src/functions.h

index 1d81557983dd7dc5d8ff4769b0792f85e3a532cb..d8904ac4fb1a7a4c81df618062efd299d84c8258 100644 (file)
@@ -171,9 +171,19 @@ auth_info auths_available[] = {
   },
 #endif
 
-{ .driver_name = US"" }                /* end marker */
+  { .driver_name = US"" }              /* end marker */
 };
 
+void
+auth_show_supported(FILE * f)
+{
+auth_info * ai;
+fprintf(f, "Authenticators:");
+for (ai = auths_available; ai->driver_name[0]; ai++)
+               fprintf(f, " %s", ai->driver_name);
+fprintf(f, "\n");
+}
+
 
 /* Tables of information about which routers and transports are included in the
 exim binary. */
@@ -329,10 +339,22 @@ router_info routers_available[] = {
   .ri_flags =          ri_notransport
   },
 #endif
-{ US"" }
+  { US"" }
 };
 
 
+void
+route_show_supported(FILE * f)
+{
+router_info * rr;
+fprintf(f, "Routers:");
+for (rr = routers_available; rr->driver_name[0]; rr++)
+               fprintf(f, " %s", rr->driver_name);
+fprintf(f, "\n");
+}
+
+
+
 
 transport_info transports_available[] = {
 #ifdef TRANSPORT_APPENDFILE
@@ -419,9 +441,43 @@ transport_info transports_available[] = {
   .local =             FALSE
   },
 #endif
-{ US"" }
+  { US"" }
 };
 
+void
+transport_show_supported(FILE * f)
+{
+fprintf(f, "Transports:");
+#ifdef TRANSPORT_APPENDFILE
+  fprintf(f, " appendfile");
+  #ifdef SUPPORT_MAILDIR
+    fprintf(f, "/maildir");    /* damn these subclasses */
+  #endif
+  #ifdef SUPPORT_MAILSTORE
+    fprintf(f, "/mailstore");
+  #endif
+  #ifdef SUPPORT_MBX
+    fprintf(f, "/mbx");
+  #endif
+#endif
+#ifdef TRANSPORT_AUTOREPLY
+  fprintf(f, " autoreply");
+#endif
+#ifdef TRANSPORT_LMTP
+  fprintf(f, " lmtp");
+#endif
+#ifdef TRANSPORT_PIPE
+  fprintf(f, " pipe");
+#endif
+#ifdef EXPERIMENTAL_QUEUEFILE
+  fprintf(f, " queuefile");
+#endif
+#ifdef TRANSPORT_SMTP
+  fprintf(f, " smtp");
+#endif
+fprintf(f, "\n");
+}
+
 
 #ifndef MACRO_PREDEF
 
index 39e68c04c88cb935e19acfc5ef15250ae4273602..8bd1456358b8318b970e4445cf81191d57e1bc02 100644 (file)
@@ -930,86 +930,9 @@ fprintf(f, "Lookups (built-in):");
 #endif
 fprintf(f, "\n");
 
-fprintf(f, "Authenticators:");
-#ifdef AUTH_CRAM_MD5
-  fprintf(f, " cram_md5");
-#endif
-#ifdef AUTH_CYRUS_SASL
-  fprintf(f, " cyrus_sasl");
-#endif
-#ifdef AUTH_DOVECOT
-  fprintf(f, " dovecot");
-#endif
-#ifdef AUTH_GSASL
-  fprintf(f, " gsasl");
-#endif
-#ifdef AUTH_HEIMDAL_GSSAPI
-  fprintf(f, " heimdal_gssapi");
-#endif
-#ifdef AUTH_PLAINTEXT
-  fprintf(f, " plaintext");
-#endif
-#ifdef AUTH_SPA
-  fprintf(f, " spa");
-#endif
-#ifdef AUTH_TLS
-  fprintf(f, " tls");
-#endif
-fprintf(f, "\n");
-
-fprintf(f, "Routers:");
-#ifdef ROUTER_ACCEPT
-  fprintf(f, " accept");
-#endif
-#ifdef ROUTER_DNSLOOKUP
-  fprintf(f, " dnslookup");
-#endif
-#ifdef ROUTER_IPLITERAL
-  fprintf(f, " ipliteral");
-#endif
-#ifdef ROUTER_IPLOOKUP
-  fprintf(f, " iplookup");
-#endif
-#ifdef ROUTER_MANUALROUTE
-  fprintf(f, " manualroute");
-#endif
-#ifdef ROUTER_QUERYPROGRAM
-  fprintf(f, " queryprogram");
-#endif
-#ifdef ROUTER_REDIRECT
-  fprintf(f, " redirect");
-#endif
-fprintf(f, "\n");
-
-fprintf(f, "Transports:");
-#ifdef TRANSPORT_APPENDFILE
-  fprintf(f, " appendfile");
-  #ifdef SUPPORT_MAILDIR
-    fprintf(f, "/maildir");
-  #endif
-  #ifdef SUPPORT_MAILSTORE
-    fprintf(f, "/mailstore");
-  #endif
-  #ifdef SUPPORT_MBX
-    fprintf(f, "/mbx");
-  #endif
-#endif
-#ifdef TRANSPORT_AUTOREPLY
-  fprintf(f, " autoreply");
-#endif
-#ifdef TRANSPORT_LMTP
-  fprintf(f, " lmtp");
-#endif
-#ifdef TRANSPORT_PIPE
-  fprintf(f, " pipe");
-#endif
-#ifdef EXPERIMENTAL_QUEUEFILE
-  fprintf(f, " queuefile");
-#endif
-#ifdef TRANSPORT_SMTP
-  fprintf(f, " smtp");
-#endif
-fprintf(f, "\n");
+auth_show_supported(f);
+route_show_supported(f);
+transport_show_supported(f);
 
 if (fixed_never_users[0] > 0)
   {
index 0c34113f898d3b4f7112b48b939fb8e428a0e8c2..b9a0cbc7c5edc637fab50de9bb481e723056a8cd 100644 (file)
@@ -100,6 +100,7 @@ extern int     auth_check_some_cond(auth_instance *, uschar *, uschar *, int);
 
 extern int     auth_get_data(uschar **, uschar *, int);
 extern int     auth_get_no64_data(uschar **, uschar *);
+extern void    auth_show_supported(FILE *);
 extern uschar *auth_xtextencode(uschar *, int);
 extern int     auth_xtextdecode(uschar *, uschar **);
 
@@ -377,6 +378,7 @@ extern BOOL    route_find_expanded_group(uschar *, uschar *, uschar *, gid_t *,
 extern BOOL    route_find_expanded_user(uschar *, uschar *, uschar *,
                  struct passwd **, uid_t *, uschar **);
 extern void    route_init(void);
+extern void    route_show_supported(FILE *);
 extern void    route_tidyup(void);
 
 extern uschar *search_find(void *, uschar *, uschar *, int, const uschar *, int,
@@ -501,6 +503,7 @@ extern void    transport_write_reset(int);
 extern BOOL    transport_write_string(int, const char *, ...);
 extern BOOL    transport_headers_send(transport_ctx *,
                  BOOL (*)(transport_ctx *, uschar *, int));
+extern void    transport_show_supported(FILE *);
 extern BOOL    transport_write_message(transport_ctx *, int);
 extern void    tree_add_duplicate(uschar *, address_item *);
 extern void    tree_add_nonrecipient(uschar *);