|
@@ -50,7 +50,6 @@ KGET(context, int, retcode);
|
|
|
FAUX_HIDDEN KSET(context, int, retcode);
|
|
|
|
|
|
|
|
|
-KGET(context, kplugin_t *, plugin);
|
|
|
FAUX_HIDDEN KSET(context, kplugin_t *, plugin);
|
|
|
|
|
|
|
|
@@ -214,7 +213,7 @@ bool_t kcontext_named_udata_new(kcontext_t *context,
|
|
|
}
|
|
|
|
|
|
|
|
|
-void *kcontext_named_udata(kcontext_t *context, const char *name)
|
|
|
+void *kcontext_named_udata(const kcontext_t *context, const char *name)
|
|
|
{
|
|
|
assert(context);
|
|
|
if (!context)
|
|
@@ -222,3 +221,26 @@ void *kcontext_named_udata(kcontext_t *context, const char *name)
|
|
|
|
|
|
return kscheme_named_udata(context->scheme, name);
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+kplugin_t *kcontext_plugin(const kcontext_t *context)
|
|
|
+{
|
|
|
+ const kaction_t *action = NULL;
|
|
|
+
|
|
|
+ assert(context);
|
|
|
+ if (!context)
|
|
|
+ return NULL;
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ if (context->plugin)
|
|
|
+ return context->plugin;
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ action = kcontext_action(context);
|
|
|
+ if (!action)
|
|
|
+ return NULL;
|
|
|
+
|
|
|
+ return kaction_plugin(action);
|
|
|
+}
|