From 551be3bc1f47b78129a2c0ffd4b125ef95f15552 Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Wed, 3 Apr 2013 12:39:51 +0300 Subject: [PATCH] Drop now redundant name and opts arguments to plugin init hook - Both name and opts can be grabbed from the plugin handle, no need to pass separately --- lib/rpmplugin.h | 3 +-- lib/rpmplugins.c | 8 ++++---- plugins/sepolicy.c | 3 +-- plugins/syslog.c | 3 +-- 4 files changed, 7 insertions(+), 10 deletions(-) diff --git a/lib/rpmplugin.h b/lib/rpmplugin.h index 5ba24d3c7..7b7d37aae 100644 --- a/lib/rpmplugin.h +++ b/lib/rpmplugin.h @@ -37,8 +37,7 @@ typedef rpmFlags rpmFsmOp; #define XFO_FLAGS(_a) ((_a) & XFAF_MASK) /*!< File op flags part */ /* plugin hook typedefs */ -typedef rpmRC (*plugin_init_func)(rpmPlugin plugin, rpmts ts, - const char * name, const char * opts); +typedef rpmRC (*plugin_init_func)(rpmPlugin plugin, rpmts ts); typedef void (*plugin_cleanup_func)(rpmPlugin plugin); typedef rpmRC (*plugin_opente_func)(rpmPlugin plugin, rpmte te); typedef rpmRC (*plugin_coll_post_any_func)(rpmPlugin plugin); diff --git a/lib/rpmplugins.c b/lib/rpmplugins.c index 53aafee5c..0bd0bce5a 100644 --- a/lib/rpmplugins.c +++ b/lib/rpmplugins.c @@ -12,7 +12,7 @@ #define STR1(x) #x #define STR(x) STR1(x) -static rpmRC rpmpluginsCallInit(rpmPlugin plugin, rpmts ts, const char *opts); +static rpmRC rpmpluginsCallInit(rpmPlugin plugin, rpmts ts); struct rpmPlugin_s { char *name; @@ -129,7 +129,7 @@ rpmRC rpmpluginsAdd(rpmPlugins plugins, const char *name, const char *path, if (plugin == NULL) return RPMRC_FAIL; - rc = rpmpluginsCallInit(plugin, plugins->ts, opts); + rc = rpmpluginsCallInit(plugin, plugins->ts); if (rc == RPMRC_OK) { plugins->plugins = xrealloc(plugins->plugins, @@ -207,13 +207,13 @@ rpmPlugins rpmpluginsFree(rpmPlugins plugins) STR(hook), plugin->name); \ } -static rpmRC rpmpluginsCallInit(rpmPlugin plugin, rpmts ts, const char *opts) +static rpmRC rpmpluginsCallInit(rpmPlugin plugin, rpmts ts) { rpmRC rc = RPMRC_OK; plugin_init_func hookFunc; RPMPLUGINS_SET_HOOK_FUNC(init); if (hookFunc) - rc = hookFunc(plugin, ts, plugin->name, opts); + rc = hookFunc(plugin, ts); return rc; } diff --git a/plugins/sepolicy.c b/plugins/sepolicy.c index d000a2bd9..99e8914d3 100644 --- a/plugins/sepolicy.c +++ b/plugins/sepolicy.c @@ -621,8 +621,7 @@ static rpmRC sepolAddTE(rpmte te) -static rpmRC PLUGINHOOK_INIT_FUNC(rpmPlugin plugin, - rpmts _ts, const char *_name, const char *_opts) +static rpmRC PLUGINHOOK_INIT_FUNC(rpmPlugin plugin, rpmts _ts) { ts = _ts; name = strdup(_name); diff --git a/plugins/syslog.c b/plugins/syslog.c index 75fe46e5a..4116bba76 100644 --- a/plugins/syslog.c +++ b/plugins/syslog.c @@ -9,8 +9,7 @@ struct logstat { unsigned int pkgfail; }; -static rpmRC PLUGINHOOK_INIT_FUNC(rpmPlugin plugin, - rpmts ts, const char * name, const char * opts) +static rpmRC PLUGINHOOK_INIT_FUNC(rpmPlugin plugin, rpmts ts) { /* XXX make this configurable? */ const char * log_ident = "[RPM]";