diff options
Diffstat (limited to 'src/plugins/plugin-config.c')
-rw-r--r-- | src/plugins/plugin-config.c | 40 |
1 files changed, 22 insertions, 18 deletions
diff --git a/src/plugins/plugin-config.c b/src/plugins/plugin-config.c index 731fb2b54..1cd131223 100644 --- a/src/plugins/plugin-config.c +++ b/src/plugins/plugin-config.c @@ -282,6 +282,26 @@ plugin_config_free_all () } /* + * plugin_config_reload: reload plugins configuration file + * return: 0 = successful + * -1 = config file file not found + * -2 = error in config file + */ + +int +plugin_config_reload (struct t_config_file *config_file) +{ + /* make C compiler happy */ + (void) config_file; + + /* remove all plugin options */ + plugin_config_free_all (); + + /* reload plugins config file */ + return config_file_reload (plugin_config); +} + +/* * plugin_config_read_option: read an option in config file * Return: 0 = successful * -1 = option not found @@ -335,7 +355,8 @@ plugin_config_write_options (struct t_config_file *config_file, void plugin_config_init () { - plugin_config = config_file_new (NULL, PLUGIN_CONFIG_FILENAME); + plugin_config = config_file_new (NULL, PLUGIN_CONFIG_FILENAME, + &plugin_config_reload); if (plugin_config) { config_file_new_section (plugin_config, "plugins", @@ -359,23 +380,6 @@ plugin_config_read () } /* - * plugin_config_reload: read plugins configuration file - * return: 0 = successful - * -1 = config file file not found - * -2 = error in config file - */ - -int -plugin_config_reload () -{ - /* remove all plugin options */ - plugin_config_free_all (); - - /* reload plugins config file */ - return config_file_reload (plugin_config); -} - -/* * plugin_config_write: write plugins configuration file * return: 0 if ok * < 0 if error |