summaryrefslogtreecommitdiffstats
path: root/cpukit/libmisc/shell/shell.h
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2007-12-10 23:14:35 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2007-12-10 23:14:35 +0000
commit4e5299ffc4753255b53ec542050761d07ae0f813 (patch)
tree342f9041b753e865bbe2f4cdbd215b4a165e86de /cpukit/libmisc/shell/shell.h
parent2007-12-10 Joel Sherrill <joel.sherrill@oarcorp.com> (diff)
downloadrtems-4e5299ffc4753255b53ec542050761d07ae0f813.tar.bz2
2007-12-10 Joel Sherrill <joel.sherrill@oarcorp.com>
* ChangeLog, preinstall.am, libmisc/Makefile.am, libmisc/shell/cmds.c, libmisc/shell/shell.c, libmisc/shell/shell.h: Split shell commands into multiple files and add initial stages of command configuration. This seems to work but the monitor commands need to be integrated this way and the ability to configure user commands needs to be tested. * libmisc/shell/cat_file.c, libmisc/shell/cmd_alias.c, libmisc/shell/cmd_cat.c, libmisc/shell/cmd_cd.c, libmisc/shell/cmd_chdir.c, libmisc/shell/cmd_chmod.c, libmisc/shell/cmd_chroot.c, libmisc/shell/cmd_date.c, libmisc/shell/cmd_dir.c, libmisc/shell/cmd_exit.c, libmisc/shell/cmd_help.c, libmisc/shell/cmd_id.c, libmisc/shell/cmd_logoff.c, libmisc/shell/cmd_ls.c, libmisc/shell/cmd_mallocdump.c, libmisc/shell/cmd_mdump.c, libmisc/shell/cmd_medit.c, libmisc/shell/cmd_mfill.c, libmisc/shell/cmd_mkdir.c, libmisc/shell/cmd_mmove.c, libmisc/shell/cmd_mwdump.c, libmisc/shell/cmd_pwd.c, libmisc/shell/cmd_rm.c, libmisc/shell/cmd_rmdir.c, libmisc/shell/cmd_tty.c, libmisc/shell/cmd_umask.c, libmisc/shell/cmd_whoami.c, libmisc/shell/internal.h, libmisc/shell/shellconfig.c, libmisc/shell/shellconfig.h, libmisc/shell/str2int.c: New files.
Diffstat (limited to 'cpukit/libmisc/shell/shell.h')
-rw-r--r--cpukit/libmisc/shell/shell.h83
1 files changed, 50 insertions, 33 deletions
diff --git a/cpukit/libmisc/shell/shell.h b/cpukit/libmisc/shell/shell.h
index 4e4cb96044..e901cb9c5d 100644
--- a/cpukit/libmisc/shell/shell.h
+++ b/cpukit/libmisc/shell/shell.h
@@ -29,41 +29,46 @@ extern "C" {
typedef int (*shell_command_t)(int argc,char * argv[]);
-struct shell_cmd_tt ;
+struct shell_cmd_tt;
typedef struct shell_cmd_tt shell_cmd_t;
struct shell_cmd_tt {
- char *name;
- char *usage;
- char *topic;
- shell_command_t command;
- shell_cmd_t *alias;
- shell_cmd_t *next;
+ char *name;
+ char *usage;
+ char *topic;
+ shell_command_t command;
+ shell_cmd_t *alias;
+ shell_cmd_t *next;
};
-uint32_t new_rtems_name(char * rtems_name);
+typedef struct {
+ char *name;
+ char *alias;
+} shell_alias_t;
+
shell_cmd_t * shell_lookup_cmd(char * cmd);
-shell_cmd_t * shell_add_cmd(char * cmd,
- char * topic,
- char * usage,
- shell_command_t command);
-shell_cmd_t * shell_alias_cmd(char * cmd, char * alias);
-int shell_make_args(char * cmd,
- int * pargc,
- char * argv[]);
+shell_cmd_t *shell_add_cmd_struct(
+ shell_cmd_t *shell_cmd
+);
-typedef struct {
- rtems_name magic; /* 'S','E','N','V': Shell Environment */
- char * devname;
- char * taskname;
- tcflag_t tcflag;
- /* user extensions */
- int exit_shell; /* logout */
- int forever ; /* repeat login */
- int errorlevel;
- int mdump_adr;
-} shell_env_t;
+shell_cmd_t * shell_add_cmd(
+ char *cmd,
+ char *topic,
+ char *usage,
+ shell_command_t command
+);
+
+shell_cmd_t * shell_alias_cmd(
+ char *cmd,
+ char *alias
+);
+
+int shell_make_args(
+ char * cmd,
+ int * pargc,
+ char * argv[]
+);
int shell_scanline(char * line,int size,FILE * in,FILE * out) ;
void cat_file(FILE * out,char *name);
@@ -93,6 +98,24 @@ rtems_status_code shell_init(
int forever
);
+/*
+ * Things that are useful to external entities developing commands and plugging
+ * them in.
+ */
+int str2int(char * s);
+
+typedef struct {
+ rtems_name magic; /* 'S','E','N','V': Shell Environment */
+ char *devname;
+ char *taskname;
+ tcflag_t tcflag;
+ /* user extensions */
+ int exit_shell; /* logout */
+ int forever ; /* repeat login */
+ int errorlevel;
+ uintptr_t mdump_addr;
+} shell_env_t;
+
rtems_boolean shell_shell_loop(
shell_env_t *shell_env
);
@@ -100,12 +123,6 @@ rtems_boolean shell_shell_loop(
extern shell_env_t global_shell_env;
extern shell_env_t *current_shell_env;
-/*--------*/
-/* cmds.c */
-/*--------*/
-int str2int(char * s);
-void register_cmds(void);
-
#ifdef __cplusplus
}
#endif