|
@@ -14,10 +14,12 @@
|
|
|
#include <klish/kscheme.h>
|
|
|
#include <klish/ksession.h>
|
|
|
#include <klish/kaction.h>
|
|
|
+#include <klish/kscheme.h>
|
|
|
|
|
|
|
|
|
struct kcontext_s {
|
|
|
kcontext_type_e type;
|
|
|
+ kscheme_t *scheme;
|
|
|
int retcode;
|
|
|
ksession_t *session;
|
|
|
kplugin_t *plugin;
|
|
@@ -39,6 +41,10 @@ struct kcontext_s {
|
|
|
KGET(context, kcontext_type_e, type);
|
|
|
FAUX_HIDDEN KSET(context, kcontext_type_e, type);
|
|
|
|
|
|
+
|
|
|
+KGET(context, kscheme_t *, scheme);
|
|
|
+KSET(context, kscheme_t *, scheme);
|
|
|
+
|
|
|
|
|
|
KGET(context, int, retcode);
|
|
|
FAUX_HIDDEN KSET(context, int, retcode);
|
|
@@ -99,6 +105,7 @@ kcontext_t *kcontext_new(kcontext_type_e type)
|
|
|
|
|
|
|
|
|
context->type = type;
|
|
|
+ context->scheme = NULL;
|
|
|
context->retcode = 0;
|
|
|
context->plugin = NULL;
|
|
|
context->pargv = NULL;
|
|
@@ -194,3 +201,24 @@ const char *kcontext_script(const kcontext_t *context)
|
|
|
|
|
|
return kaction_script(action);
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+bool_t kcontext_named_udata_new(kcontext_t *context,
|
|
|
+ const char *name, void *data, kudata_data_free_fn free_fn)
|
|
|
+{
|
|
|
+ assert(context);
|
|
|
+ if (!context)
|
|
|
+ return BOOL_FALSE;
|
|
|
+
|
|
|
+ return kscheme_named_udata_new(context->scheme, name, data, free_fn);
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+void *kcontext_named_udata(kcontext_t *context, const char *name)
|
|
|
+{
|
|
|
+ assert(context);
|
|
|
+ if (!context)
|
|
|
+ return NULL;
|
|
|
+
|
|
|
+ return kscheme_named_udata(context->scheme, name);
|
|
|
+}
|