Browse Source

Remove deprecated builtin typedef

Serj Kalichev 11 years ago
parent
commit
d31e999c53
4 changed files with 5 additions and 41 deletions
  1. 1 2
      bin/clish.c
  2. 2 36
      clish/shell.h
  3. 0 1
      clish/shell/shell_internal.c
  4. 2 2
      clish/shell/shell_plugin.c

+ 1 - 2
bin/clish.c

@@ -41,8 +41,7 @@ static clish_shell_hooks_t my_hooks = {
     NULL, /* don't worry about cmd_line callback */
     NULL, /* don't worry about fini callback */
     clish_config_callback,
-    clish_log_callback,
-    NULL  /* don't register any builtin functions */
+    clish_log_callback
 };
 
 static void help(int status, const char *argv0);

+ 2 - 36
clish/shell.h

@@ -175,40 +175,6 @@ typedef bool_t clish_shell_access_fn_t(
 typedef int clish_shell_log_fn_t(
 	clish_context_t *context,
 	const char *line, int retcode);
- /**
-  * A hook function used as a built in command callback
-  * 
-  * This will be invoked from the context of the spawned shell's thread
-  * and will be called during the execution of a builting command.
-  * 
-  * A client may register any number of these callbacks in its 
-  * clish_shell_builtin_cmds_t structure.
-  *
-  * \return
-  * - Retval (int)
-  *
-  */
-typedef int clish_shell_builtin_fn_t(
-	/** 
-         * The shell instance which invoked this call
-         */
-					       clish_context_t *context,
-	/** 
-         * A vector of textual command line arguments.
-         */
-					       const lub_argv_t * argv);
-
-/** 
- * A client of libclish may provide some builtin commands which will be
- * interpreted by the framework, instead of the client's script engine.
- */
-typedef struct {
-	const char *name;		/**< The textual name to be used in 
-                                         *    the 'builtin' XML attribute"
-                                         */
-	clish_shell_builtin_fn_t *callback;
-					/**< The function to be invoked */
-} clish_shell_builtin_t;
 
 /** 
  * A client of libclish will provide hooks for the control of the CLI within 
@@ -219,11 +185,11 @@ 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_fini_fn_t *fini_fn;         /* Finalisation call */
+	clish_shell_fini_fn_t *fini_fn;         /* Finalization call */
 	clish_shell_config_fn_t *config_fn;     /* Config call */
 	clish_shell_log_fn_t *log_fn;           /* Logging call */
-	const clish_shell_builtin_t *cmd_list;  /* NULL terminated list */
 } clish_shell_hooks_t;
+
 /*-----------------
  * meta functions
  *----------------- */

+ 0 - 1
clish/shell/shell_internal.c

@@ -17,7 +17,6 @@
 #include <signal.h>
 #include <fcntl.h>
 
-
 /*----------------------------------------------------------- */
 /* Terminate the current shell session */
 CLISH_PLUGIN_SYM(clish_close)

+ 2 - 2
clish/shell/shell_plugin.c

@@ -45,7 +45,7 @@ int clish_shell_load_plugins(clish_shell_t *this)
 /* Iterate plugins to find symbol by name.
  * The symbol name can be simple or with namespace:
  * mysym@plugin1
- * The symbols with prefix will be resolved using specified plugin only.
+ * The symbols with suffix will be resolved using specified plugin only.
  */
 static clish_sym_t *plugins_find_sym(clish_shell_t *this, const char *name)
 {
@@ -109,7 +109,7 @@ clish_sym_t *clish_shell_find_sym(clish_shell_t *this, const char *name)
 		res = strcmp(clish_sym__get_name(sym), name);
 		if (!res)
 			return sym;
-		if (res > 0) /* No chances to find name */
+		if (res > 0) /* No chance to find name */
 			break;
 	}