Prebuild the data structure for builtin macros
[exim.git] / src / src / route.c
index 08b3e055dd6e9ea76cf614269b57ba1e393d4954..e30ae0e68523c88d2b24574b41bb01f0e53e0c69 100644 (file)
@@ -143,20 +143,28 @@ optionlist optionlist_routers[] = {
 int optionlist_routers_size = sizeof(optionlist_routers)/sizeof(optionlist);
 
 
+#ifdef MACRO_PREDEF
+
+# include "macro_predef.h"
+
 void
-readconf_options_routers(void)
+options_routers(void)
 {
 struct router_info * ri;
+uschar buf[64];
 
-readconf_options_from_list(optionlist_routers, nelem(optionlist_routers), US"ROUTERS", NULL);
+options_from_list(optionlist_routers, nelem(optionlist_routers), US"ROUTERS", NULL);
 
 for (ri = routers_available; ri->driver_name[0]; ri++)
   {
-  macro_create(string_sprintf("_DRIVER_ROUTER_%T", ri->driver_name), US"y", FALSE, TRUE);
-  readconf_options_from_list(ri->options, (unsigned)*ri->options_count, US"ROUTER", ri->driver_name);
+  snprintf(buf, sizeof(buf), "_DRIVER_ROUTER_%T", ri->driver_name);
+  builtin_macro_create(buf);
+  options_from_list(ri->options, (unsigned)*ri->options_count, US"ROUTER", ri->driver_name);
   }
 }
 
+#else  /*!MACRO_PREDEF*/
+
 /*************************************************
 *          Set router pointer from name          *
 *************************************************/
@@ -1919,4 +1927,5 @@ disable_logging = FALSE;
 return yield;
 }
 
+#endif /*!MACRO_PREDEF*/
 /* End of route.c */