Browse Source

Add func to get hook sym

Serj Kalichev 11 years ago
parent
commit
9f620d4b43
2 changed files with 4 additions and 11 deletions
  1. 1 2
      clish/shell.h
  2. 3 9
      clish/shell/shell_plugin.c

+ 1 - 2
clish/shell.h

@@ -180,8 +180,7 @@ clish_sym_t *clish_shell_add_sym(clish_shell_t *instance,
 	void *func, const char *name, int type);
 clish_sym_t *clish_shell_add_unresolved_sym(clish_shell_t *instance,
 	const char *name, int type);
-int clish_shell_set_hook(clish_shell_t *instance,
-	void *func, const char *name, int type);
+clish_sym_t *clish_shell_get_hook(const clish_shell_t *instance, int type);
 
 _END_C_DECL
 

+ 3 - 9
clish/shell/shell_plugin.c

@@ -172,14 +172,8 @@ int clish_shell_link_plugins(clish_shell_t *this)
 }
 
 /*----------------------------------------------------------------------- */
-/* Set params of hooks */
-int clish_shell_set_hook(clish_shell_t *this,
-	void *func, const char *name, int type)
+/* Get hook sym */
+clish_sym_t *clish_shell_get_hook(const clish_shell_t *this, int type)
 {
-	if (!name)
-		return -1;
-	clish_sym__set_name(this->hooks[type], name);
-	clish_sym__set_func(this->hooks[type], func);
-
-	return 0;
+	return this->hooks[type];
 }