|
@@ -176,7 +176,7 @@ void clish_plugin_free(clish_plugin_t *this)
|
|
|
|
|
|
/*--------------------------------------------------------- */
|
|
|
clish_sym_t *clish_plugin_add_generic(clish_plugin_t *this,
|
|
|
- void *func, const char *name, int type)
|
|
|
+ void *func, const char *name, int type, bool_t permanent)
|
|
|
{
|
|
|
clish_sym_t *sym;
|
|
|
|
|
@@ -186,6 +186,7 @@ clish_sym_t *clish_plugin_add_generic(clish_plugin_t *this,
|
|
|
if (!(sym = clish_sym_new(name, func, type)))
|
|
|
return NULL;
|
|
|
clish_sym__set_plugin(sym, this);
|
|
|
+ clish_sym__set_permanent(sym, permanent);
|
|
|
lub_list_add(this->syms, sym);
|
|
|
|
|
|
return sym;
|
|
@@ -196,7 +197,16 @@ clish_sym_t *clish_plugin_add_sym(clish_plugin_t *this,
|
|
|
clish_hook_action_fn_t *func, const char *name)
|
|
|
{
|
|
|
return clish_plugin_add_generic(this, func,
|
|
|
- name, CLISH_SYM_TYPE_ACTION);
|
|
|
+ name, CLISH_SYM_TYPE_ACTION, BOOL_FALSE);
|
|
|
+}
|
|
|
+
|
|
|
+/*--------------------------------------------------------- */
|
|
|
+/* Add permanent symbol (can't be turned off by dry-run) */
|
|
|
+clish_sym_t *clish_plugin_add_psym(clish_plugin_t *this,
|
|
|
+ clish_hook_action_fn_t *func, const char *name)
|
|
|
+{
|
|
|
+ return clish_plugin_add_generic(this, func,
|
|
|
+ name, CLISH_SYM_TYPE_ACTION, BOOL_TRUE);
|
|
|
}
|
|
|
|
|
|
/*--------------------------------------------------------- */
|
|
@@ -204,21 +214,15 @@ clish_sym_t *clish_plugin_add_hook(clish_plugin_t *this,
|
|
|
void *func, const char *name, int type)
|
|
|
{
|
|
|
return clish_plugin_add_generic(this, func,
|
|
|
- name, type);
|
|
|
+ name, type, BOOL_FALSE);
|
|
|
}
|
|
|
|
|
|
/*--------------------------------------------------------- */
|
|
|
-/* Add permanent symbol (can't be turned off by dry-run) */
|
|
|
-clish_sym_t *clish_plugin_add_psym(clish_plugin_t *this,
|
|
|
- clish_hook_action_fn_t *func, const char *name)
|
|
|
+clish_sym_t *clish_plugin_add_phook(clish_plugin_t *this,
|
|
|
+ void *func, const char *name, int type)
|
|
|
{
|
|
|
- clish_sym_t *sym;
|
|
|
-
|
|
|
- if (!(sym = clish_plugin_add_sym(this, func, name)))
|
|
|
- return NULL;
|
|
|
- clish_sym__set_permanent(sym, BOOL_TRUE);
|
|
|
-
|
|
|
- return sym;
|
|
|
+ return clish_plugin_add_generic(this, func,
|
|
|
+ name, type, BOOL_TRUE);
|
|
|
}
|
|
|
|
|
|
/*--------------------------------------------------------- */
|