Add API for getting name and options from plugin handle

This commit is contained in:
Panu Matilainen 2013-04-03 11:46:13 +03:00
parent 91cefc3c3f
commit 79a18457ad
2 changed files with 24 additions and 0 deletions

View File

@ -90,6 +90,20 @@ struct rpmPluginHooks_s {
extern "C" {
#endif
/** \ingroup rpmplugin
* Return plugin name
* @param plugin plugin handle
* @return plugin name string
*/
const char *rpmPluginName(rpmPlugin plugin);
/** \ingroup rpmplugin
* Return plugin options
* @param plugin plugin handle
* @return plugin options string (or NULL if none)
*/
const char *rpmPluginOpts(rpmPlugin plugin);
#ifdef __cplusplus
}
#endif

View File

@ -98,6 +98,16 @@ static rpmPlugin rpmPluginFree(rpmPlugin plugin)
return NULL;
}
const char *rpmPluginName(rpmPlugin plugin)
{
return (plugin != NULL) ? plugin->name : NULL;
}
const char *rpmPluginOpts(rpmPlugin plugin)
{
return (plugin != NULL) ? plugin->opts : NULL;
}
rpmRC rpmpluginsAdd(rpmPlugins plugins, const char *name, const char *path,
const char *opts)
{