XINU
shell.h
Go to the documentation of this file.
1 
6 #define SHELL_BUFLEN TY_IBUFLEN + 1
8 #define SHELL_MAXTOK 32
10 #define SHELL_CMDSTK 8192
12 #define SHELL_ARGLEN (SHELL_BUFLEN + SHELL_MAXTOK)
14 #define SHELL_CMDPRIO 20
16 
18 #define SHELL_BAN0 "\033[31;1m"
19 #define SHELL_BAN1 "------------------------------------------"
21 #define SHELL_BAN2 " __ __ _____ _ _ _ _ "
23 #define SHELL_BAN3 " \\ \\ / / |__ __| | \\ | | | | | | "
25 #define SHELL_BAN4 " \\ \\/ / | | | \\| | | | | | "
27 #define SHELL_BAN5 " / /\\ \\ _| |_ | \\ | | | | | "
29 #define SHELL_BAN6 " / / \\ \\ | | | | \\ | \\ -- / "
31 #define SHELL_BAN7 " -- -- ----- - - ---- "
33 #define SHELL_BAN8 "------------------------------------------"
35 #define SHELL_BAN9 "\033[0m\n"
37 
39 #define SHELL_PROMPT "xsh $ "
40 #define SHELL_STRTMSG "Welcome to Xinu!\n"
42 #define SHELL_EXITMSG "Shell closed\n"
44 #define SHELL_SYNERRMSG "Syntax error\n"
46 #define SHELL_CREATMSG "Cannot create process\n"
48 #define SHELL_INERRMSG "Cannot open file %s for input\n"
50 #define SHELL_OUTERRMSG "Cannot open file %s for output\n"
52 #define SHELL_BGERRMSG "Cannot redirect I/O or background a builtin\n"
54 
56 #define SH_NEWLINE '\n'
57 #define SH_EOF '\04'
59 #define SH_AMPER '&'
61 #define SH_BLANK ' '
63 #define SH_TAB '\t'
65 #define SH_SQUOTE '\''
67 #define SH_DQUOTE '"'
69 #define SH_LESS '<'
71 #define SH_GREATER '>'
73 
75 #define SH_TOK_AMPER 0
76 #define SH_TOK_LESS 1
78 #define SH_TOK_GREATER 2
80 #define SH_TOK_OTHER 3
82 
84 #define SHELL_OK 0
85 #define SHELL_ERROR 1
87 #define SHELL_EXIT -3
89 
90 /* Structure of an entry in the table of shell commands */
91 
97 struct cmdent
98 {
100  char *cname;
104  int32 (*cfunc)(int32, char *[]);
105 };
106 
108 extern uint32 ncmd;
110 extern const struct cmdent cmdtab[];
uint32 ncmd
XINUシェルが提供するコマンドの数
Definition: shell.c:35
bool8 cbuiltin
ビルトインコマンドかどうか
Definition: shell.h:102
byte bool8
Boolean値
Definition: kernel.h:36
char * cname
コマンド名称
Definition: shell.h:100
int int32
符号あり32ビット整数(int)
Definition: kernel.h:11
const struct cmdent cmdtab[]
XINUシェルが提供するコマンドを管理する配列
Definition: shell.c:10
XINUシェルコマンドテーブルエントリ用の構造体
Definition: shell.h:97
unsigned int uint32
符号なし32ビット整数(unsigned int)
Definition: kernel.h:15
int32(* cfunc)(int32, char *[])
コマンドの機能を提供する関数(正確には関数ポインタ)
Definition: shell.h:104