uschar **, error_block **, int *, const uschar *);
extern int rda_is_filter(const uschar *);
extern BOOL readconf_depends(driver_instance *, uschar *);
-extern void readconf_driver_init(uschar *, driver_instance **,
- driver_info *, int, void *, int, optionlist *, int);
+extern void readconf_driver_init(driver_instance **, driver_info *, int,
+ void *, int, optionlist *, int, const uschar *);
extern const uschar *readconf_find_option(void *);
extern void readconf_main(BOOL);
extern void readconf_options_from_list(optionlist *, unsigned, const uschar *, uschar *);
*/
static driver_info *
-init_driver(driver_instance *d, driver_info *drivers_available,
- int size_of_info, uschar *class)
+init_driver(driver_instance * d, driver_info * drivers_available,
+ int size_of_info, const uschar * class)
{
-for (driver_info * dd = drivers_available; dd->driver_name[0] != 0;
+/*XXX this is walking the old-array */
+for (driver_info * dd = drivers_available; *dd->driver_name;
dd = (driver_info *)((US dd) + size_of_info))
if (Ustrcmp(d->driver_name, dd->driver_name) == 0)
{
d->info = dd;
d->options_block = store_get_perm(len, GET_UNTAINTED);
memcpy(d->options_block, dd->options_block, len);
- for (int i = 0; i < *(dd->options_count); i++)
+ for (int i = 0; i < *dd->options_count; i++)
dd->options[i].type &= ~opt_set;
return dd;
}
blocks for this shared code to work.
Arguments:
- class "router", "transport", or "authenticator"
anchor &routers, &transports, &auths
drivers_available available drivers
size_of_info size of each info block
instance_size size of instance block
driver_optionlist generic option list
driver_optionlist_count count of generic option list
+ class "router", "transport", or "authenticator"
+ for error message
Returns: nothing
*/
void
readconf_driver_init(
- uschar *class,
- driver_instance **anchor,
- driver_info *drivers_available,
+ driver_instance ** anchor,
+ driver_info * drivers_available,
int size_of_info,
- void *instance_default,
+ void * instance_default,
int instance_size,
- optionlist *driver_optionlist,
- int driver_optionlist_count)
+ optionlist * driver_optionlist,
+ int driver_optionlist_count,
+ const uschar * class)
{
driver_instance ** p = anchor;
driver_instance * d = NULL;
int nauths = 0;
#endif
-readconf_driver_init(US"authenticator",
- (driver_instance **)(&auths), /* chain anchor */
+readconf_driver_init((driver_instance **)&auths, /* chain anchor */
(driver_info *)auths_available, /* available drivers */
sizeof(auth_info), /* size of info block */
&auth_defaults, /* default values for generic options */
sizeof(auth_instance), /* size of instance block */
optionlist_auths, /* generic options */
- optionlist_auths_size);
+ optionlist_auths_size,
+ US"authenticator");
for (auth_instance * au = auths; au; au = au->drinst.next)
{
void
route_init(void)
{
-readconf_driver_init(US"router",
- (driver_instance **)(&routers), /* chain anchor */
+readconf_driver_init((driver_instance **)&routers, /* chain anchor */
(driver_info *)routers_available, /* available drivers */
sizeof(router_info), /* size of info blocks */
&router_defaults, /* default values for generic options */
sizeof(router_instance), /* size of instance block */
optionlist_routers, /* generic options */
- optionlist_routers_size);
+ optionlist_routers_size,
+ US"router");
for (router_instance * r = routers; r; r = r->drinst.next)
{
void
transport_init(void)
{
-readconf_driver_init(US"transport",
- (driver_instance **)(&transports), /* chain anchor */
+readconf_driver_init((driver_instance **)&transports, /* chain anchor */
(driver_info *)transports_available, /* available drivers */
sizeof(transport_info), /* size of info block */
- &transport_defaults, /* default values for generic options */
+ &transport_defaults, /* default values for generic options*/
sizeof(transport_instance), /* size of instance block */
optionlist_transports, /* generic options */
- optionlist_transports_size);
+ optionlist_transports_size,
+ US"transport");
/* Now scan the configured transports and check inconsistencies. A shadow
transport is permitted only for local transports. */