示例#1
0
文件: core.c 项目: steeve85/proxenet
int proxenet_initialize_plugins_list()
{
	if(proxenet_create_list_plugins(cfg->plugins_path) < 0) {
		xlog(LOG_ERROR, "%s\n", "Failed to build plugins list, leaving");
		return -1;
	}
	
	if(cfg->verbose) {
		xlog(LOG_INFO, "%s\n", "Plugins loaded");
		if (cfg->verbose > 1) {
			xlog(LOG_INFO, "%d plugin(s) found\n", proxenet_plugin_list_size());
			proxenet_print_plugins_list(-1);
		}
	}
	
	return 0;
}
示例#2
0
/**
 * This function is called when proxenet is loaded. Therefore, only the scripts
 * located in the `autoload_path` must be loaded.
 * Additionnal plugins can be added via the command line client.
 *
 * @return 0 on success
 * @return -1 on error
 */
int proxenet_initialize_plugins_list()
{
        /* NULL as 2nd arg means to try to add all valid plugins from the path */
        if(proxenet_add_new_plugins(cfg->autoload_path, NULL) < 0) {
                xlog(LOG_CRITICAL, "%s\n", "Failed to build plugins list, leaving");
                return -1;
        }

        if(cfg->verbose) {
                xlog(LOG_INFO, "%s\n", "Plugins loaded");
                if (cfg->verbose > 1) {
                        xlog(LOG_INFO, "%d plugin(s) found\n", proxenet_plugin_list_size());
                        proxenet_print_plugins_list(-1);
                }
        }

        return 0;
}