Browse Source

Remove unneeded script_fn callback

Serj Kalichev 11 years ago
parent
commit
7c8cbd87b7
4 changed files with 5 additions and 32 deletions
  1. 2 3
      bin/clish.c
  2. 0 2
      clish/internal.h
  3. 0 27
      clish/shell.h
  4. 3 0
      clish/shell/shell_plugin.c

+ 2 - 3
bin/clish.c

@@ -39,7 +39,6 @@ static clish_shell_hooks_t my_hooks = {
     NULL, /* don't worry about init callback */
     clish_access_callback,
     NULL, /* don't worry about cmd_line callback */
-    NULL, /* previously clish_script_callback, */
     NULL, /* don't worry about fini callback */
     clish_config_callback,
     clish_log_callback,
@@ -159,7 +158,7 @@ int main(int argc, char **argv)
 			log = BOOL_TRUE;
 			break;
 		case 'd':
-			my_hooks.script_fn = NULL; /* clish_dryrun_callback; */
+			/* TODO: clish_dryrun_callback; */
 			break;
 		case 'x':
 			xml_path = optarg;
@@ -172,7 +171,7 @@ int main(int argc, char **argv)
 			break;
 		case 'k':
 			lockless = BOOL_TRUE;
-			my_hooks.script_fn = NULL; /* clish_dryrun_callback; */
+			/* TODO: set clish_dryrun_callback; */
 			my_hooks.config_fn = NULL;
 			break;
 		case 't':

+ 0 - 2
clish/internal.h

@@ -14,8 +14,6 @@ extern struct termios clish_default_tty_termios;
 
 /* Standard clish callback functions */
 extern clish_shell_access_fn_t clish_access_callback;
-extern clish_shell_script_fn_t clish_script_callback;
-extern clish_shell_script_fn_t clish_dryrun_callback;
 extern clish_shell_config_fn_t clish_config_callback;
 extern clish_shell_log_fn_t clish_log_callback;
 

+ 0 - 27
clish/shell.h

@@ -133,32 +133,6 @@ typedef void clish_shell_cmd_line_fn_t(
          */
 					      const char *cmd_line);
 
-/**
-  * A hook function used to invoke the script associated with a command
-  * 
-  * This will be invoked from the context of the spawned shell's thread
-  * and will be invoked with the ACTION script which is to be performed.
-  * 
-  * The clish component will only pass down a call when a command has been
-  * correctly input.
-  *
-  * The client may choose to implement invocation of the script in a number of
-  * ways, which may include forking a sub-process or thread. It is important 
-  * that the call doesn't return until the script has been fully evaluated.
-  * 
-  * \return 
-  * - Retval (int)
-  *
-  * \post
-  * - If the script executes successfully then any "view" tag associated with the
-  *   command will be honored. i.e. the CLI will switch to the new view
-  */
-typedef int clish_shell_script_fn_t(
-	clish_context_t *context,
-	clish_action_t *action,
-	const char *script,
-	char **out);
-
 /**
   * A hook function used to control config file write
   * 
@@ -245,7 +219,6 @@ typedef struct {
 	clish_shell_init_fn_t *init_fn;         /* Initialisation call */
 	clish_shell_access_fn_t *access_fn;     /* Access control call */
 	clish_shell_cmd_line_fn_t *cmd_line_fn; /* Command line logging call */
-	clish_shell_script_fn_t *script_fn;     /* script evaluation call */
 	clish_shell_fini_fn_t *fini_fn;         /* Finalisation call */
 	clish_shell_config_fn_t *config_fn;     /* Config call */
 	clish_shell_log_fn_t *log_fn;           /* Logging call */

+ 3 - 0
clish/shell/shell_plugin.c

@@ -106,6 +106,7 @@ end:
 }
 
 /*--------------------------------------------------------- */
+/* Find symbol by name in the list of unresolved symbols */
 clish_sym_t *clish_shell_find_sym(clish_shell_t *this, const char *name)
 {
 	lub_list_node_t *iter;
@@ -127,6 +128,7 @@ clish_sym_t *clish_shell_find_sym(clish_shell_t *this, const char *name)
 }
 
 /*----------------------------------------------------------------------- */
+/* Add symbol to the table of unresolved symbols */
 clish_sym_t *clish_shell_add_sym(clish_shell_t *this,
 	clish_plugin_fn_t *func, const char *name)
 {
@@ -151,6 +153,7 @@ clish_sym_t *clish_shell_add_unresolved_sym(clish_shell_t *this,
 }
 
 /*----------------------------------------------------------------------- */
+/* Link unresolved symbols */
 int clish_shell_link_plugins(clish_shell_t *this)
 {
 	clish_sym_t *sym;