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
This commit is contained in:
Panu Matilainen 2013-04-03 12:39:51 +03:00
parent 40335819cf
commit 551be3bc1f
4 changed files with 7 additions and 10 deletions

View File

@ -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);

View File

@ -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;
}

View File

@ -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);

View File

@ -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]";