source: rtems/cpukit/libmisc/shell/shell.h @ dd74e612

4.104.114.84.95
Last change on this file since dd74e612 was dd74e612, checked in by Joel Sherrill <joel.sherrill@…>, on Apr 20, 2001 at 8:35:45 PM

2001-04-20 Correo Fernando-ruiz <correo@…>

  • Added initial shell functionality.
  • Makefile.am, configure.in, wrapup/Makefile.am:
  • shell/.cvsignore, shell/Makefile.am, shell/README, shell/cmds.c, shell/shell.c, shell/shell.h: New files.
  • Property mode set to 100644
File size: 1.6 KB
Line 
1/*
2 *  $Id$
3 */
4
5#ifndef __SHELL_H__
6#define __SHELL_H__
7
8#ifdef __cplusplus
9extern "C" {
10#endif 
11
12#include <rtems.h>      
13#include <stdio.h>      
14#include <termios.h>    
15
16typedef int (*shell_command_t)(int argc,char * argv[]);
17
18struct shell_cmd_tt ;
19typedef struct shell_cmd_tt shell_cmd_t;
20
21struct shell_cmd_tt {
22 char * name;
23 char * usage;
24 char * topic;
25 shell_command_t command;
26 shell_cmd_t * alias;
27 shell_cmd_t * next;
28};
29
30rtems_unsigned32 new_rtems_name(char * rtems_name);
31shell_cmd_t * shell_lookup_cmd(char * cmd);
32shell_cmd_t * shell_add_cmd(char * cmd,
33                            char * topic,
34                            char * usage,
35                            shell_command_t command);
36shell_cmd_t * shell_alias_cmd(char * cmd, char * alias);
37
38int shell_make_args(char * cmd,
39                    int  * pargc,
40                    char * argv[]);
41
42typedef struct  {
43  rtems_name magic; /* 'S','E','N','V': Shell Environment */   
44  char * devname;
45  char * taskname;
46  tcflag_t tcflag;
47  /* user extensions */
48  int  errorlevel;
49  int  mdump_adr;
50} shell_env_t;
51
52int shell_scanline(char * line,int size,FILE * in,FILE * out) ;
53       
54rtems_status_code shell_init(char * task_name      ,
55                              rtems_unsigned32    task_stacksize,/*0 default*/
56                              rtems_task_priority task_priority ,
57                              char * devname      ,
58                              tcflag_t tcflag     );
59
60extern shell_env_t global_shell_env,
61                *  current_shell_env;
62/*--------*/
63/* cmds.c */ 
64/*--------*/
65int str2int(char * s);
66void register_cmds(void);
67 
68#ifdef __cplusplus
69}
70#endif 
71
72#endif
Note: See TracBrowser for help on using the repository browser.