source: rtems/cpukit/libmisc/shell/shell.h @ 2cc9367

4.104.114.84.95
Last change on this file since 2cc9367 was 70d689a, checked in by Joel Sherrill <joel.sherrill@…>, on Aug 9, 2001 at 10:08:46 PM

2001-08-09 Fernando-Ruiz Casas <correo@…>

  • shell/Makefile.am, shell/README, shell/cmds.c, shell/shell.c, shell/shell.h: Updates.
  • Property mode set to 100644
File size: 1.9 KB
Line 
1/*
2 *
3 *  Instantatiate a new terminal shell.
4 *
5 *  Author:
6 *
7 *   WORK: fernando.ruiz@ctv.es
8 *   HOME: correo@fernando-ruiz.com
9 *
10 *   Thanks at:
11 *    Chris John
12 *
13 *  $Id$
14 */
15
16#ifndef __SHELL_H__
17#define __SHELL_H__
18
19#ifdef __cplusplus
20extern "C" {
21#endif 
22
23#include <rtems.h>      
24#include <stdio.h>      
25#include <termios.h>    
26
27typedef int (*shell_command_t)(int argc,char * argv[]);
28
29struct shell_cmd_tt ;
30typedef struct shell_cmd_tt shell_cmd_t;
31
32struct shell_cmd_tt {
33 char * name;
34 char * usage;
35 char * topic;
36 shell_command_t command;
37 shell_cmd_t * alias;
38 shell_cmd_t * next;
39};
40
41rtems_unsigned32 new_rtems_name(char * rtems_name);
42shell_cmd_t * shell_lookup_cmd(char * cmd);
43shell_cmd_t * shell_add_cmd(char * cmd,
44                            char * topic,
45                            char * usage,
46                            shell_command_t command);
47shell_cmd_t * shell_alias_cmd(char * cmd, char * alias);
48
49int shell_make_args(char * cmd,
50                    int  * pargc,
51                    char * argv[]);
52
53typedef struct  {
54  rtems_name magic; /* 'S','E','N','V': Shell Environment */   
55  char * devname;
56  char * taskname;
57  tcflag_t tcflag;
58  /* user extensions */
59  int  exit_shell; /* logout */
60  int  forever   ; /* repeat login */
61  int  errorlevel;
62  int  mdump_adr;
63} shell_env_t;
64
65int shell_scanline(char * line,int size,FILE * in,FILE * out) ;
66void cat_file(FILE * out,char *name);
67void write_file(char *name,char * content);
68       
69rtems_status_code shell_init(char * task_name      ,
70                              rtems_unsigned32    task_stacksize,/*0 default*/
71                              rtems_task_priority task_priority ,
72                              char * devname      ,
73                              tcflag_t tcflag     ,
74                              int forever         );   
75
76extern shell_env_t global_shell_env,
77                *  current_shell_env;
78/*--------*/
79/* cmds.c */ 
80/*--------*/
81int str2int(char * s);
82void register_cmds(void);
83 
84#ifdef __cplusplus
85}
86#endif 
87
88#endif
Note: See TracBrowser for help on using the repository browser.