XINU
Data Structures | Macros | Variables
shell.h File Reference

XINUシェルで使用される宣言と定数。 More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  cmdent
 XINUシェルコマンドテーブルエントリ用の構造体 More...
 

Macros

#define SH_AMPER   '&'
 アンパサンド文字'&'(字句解析時に用いる) More...
 
#define SH_BLANK   ' '
 ブランク(空白)文字(字句解析時に用いる) More...
 
#define SH_DQUOTE   '"'
 ダブルクォート文字'"'(字句解析時に用いる) More...
 
#define SH_EOF   '\04'
 End of File = Ctrl-D(字句解析時に用いる) More...
 
#define SH_GREATER   '>'
 大なり記号'>' More...
 
#define SH_LESS   '<'
 小なり記号'<' More...
 
#define SH_NEWLINE   '\n'
 LF改行コード'
'(字句解析時に用いる) More...
 
#define SH_SQUOTE   '\''
 シングルクォート文字'''(字句解析時に用いる) More...
 
#define SH_TAB   '\t'
 TAB文字(字句解析時に用いる) More...
 
#define SH_TOK_AMPER   0
 アンパサンド'&'トークン More...
 
#define SH_TOK_GREATER   2
 大なり'>'トークン More...
 
#define SH_TOK_LESS   1
 小なり'<'トークン More...
 
#define SH_TOK_OTHER   3
 その他('&'、'<'、'>以外')のトークン(例:英数字文字列) More...
 
#define SHELL_ARGLEN   (SHELL_BUFLEN + SHELL_MAXTOK)
 引数の領域(長さ) More...
 
#define SHELL_BAN0   "\033[31;1m"
 シェル起動時のバナー その0(文字色を赤くするANSIエスケープシーケンス) More...
 
#define SHELL_BAN1   "------------------------------------------"
 シェル起動時のバナー その1 More...
 
#define SHELL_BAN2   " __ __ _____ _ _ _ _ "
 シェル起動時のバナー その2 More...
 
#define SHELL_BAN3   " \\ \\ / / |__ __| | \\ | | | | | | "
 シェル起動時のバナー その3 More...
 
#define SHELL_BAN4   " \\ \\/ / | | | \\| | | | | | "
 シェル起動時のバナー その4 More...
 
#define SHELL_BAN5   " / /\\ \\ _| |_ | \\ | | | | | "
 シェル起動時のバナー その5 More...
 
#define SHELL_BAN6   " / / \\ \\ | | | | \\ | \\ -- / "
 シェル起動時のバナー その6 More...
 
#define SHELL_BAN7   " -- -- ----- - - ---- "
 シェル起動時のバナー その7 More...
 
#define SHELL_BAN8   "------------------------------------------"
 シェル起動時のバナー その8 More...
 
#define SHELL_BAN9   "\033[0m\n"
 シェル起動時のバナー その9(文字色をデフォルトに戻すANSIエスケープシーケンス) More...
 
#define SHELL_BGERRMSG   "Cannot redirect I/O or background a builtin\n"
 I/Oリダイレクトできなかった場合もしくはバックグラウンドのXINUシェルビルトインコマンドエラー用のメッセージ More...
 
#define SHELL_BUFLEN   TY_IBUFLEN + 1
 インプットバッファの長さ More...
 
#define SHELL_CMDPRIO   20
 コマンドに対するプロセス優先度 More...
 
#define SHELL_CMDSTK   8192
 コマンドを実行するプロセスに対するスタックサイズ More...
 
#define SHELL_CREATMSG   "Cannot create process\n"
 コマンド実行時にプロセスを生成できなかった場合のエラーメッセージ More...
 
#define SHELL_ERROR   1
 XINUシェルの処理失敗 More...
 
#define SHELL_EXIT   -3
 XINUシェルを終了させる返り値 More...
 
#define SHELL_EXITMSG   "Shell closed\n"
 XINUシェル終了時のメッセージ More...
 
#define SHELL_INERRMSG   "Cannot open file %s for input\n"
 インプットとして用いるファイルが開けなかった場合のエラーメッセージ More...
 
#define SHELL_MAXTOK   32
 一行あたりの最大トークン数 More...
 
#define SHELL_OK   0
 XINUシェルの処理成功 More...
 
#define SHELL_OUTERRMSG   "Cannot open file %s for output\n"
 アウトプットとして用いるファイルが開けなかった場合のエラーメッセージ More...
 
#define SHELL_PROMPT   "xsh $ "
 コマンドプロンプト More...
 
#define SHELL_STRTMSG   "Welcome to Xinu!\n"
 Welcomeメッセージ More...
 
#define SHELL_SYNERRMSG   "Syntax error\n"
 シンタックスエラー時のメッセージ More...
 

Variables

const struct cmdent cmdtab []
 XINUシェルが提供するコマンドを管理する配列 More...
 
uint32 ncmd
 XINUシェルが提供するコマンドの数 More...
 

Detailed Description

XINUシェルで使用される宣言と定数。

Definition in file shell.h.

Macro Definition Documentation

◆ SH_AMPER

#define SH_AMPER   '&'

アンパサンド文字'&'(字句解析時に用いる)

Definition at line 60 of file shell.h.

Referenced by lexan().

◆ SH_BLANK

#define SH_BLANK   ' '

ブランク(空白)文字(字句解析時に用いる)

Definition at line 62 of file shell.h.

Referenced by lexan().

◆ SH_DQUOTE

#define SH_DQUOTE   '"'

ダブルクォート文字'"'(字句解析時に用いる)

Definition at line 68 of file shell.h.

Referenced by lexan().

◆ SH_EOF

#define SH_EOF   '\04'

End of File = Ctrl-D(字句解析時に用いる)

Definition at line 58 of file shell.h.

◆ SH_GREATER

#define SH_GREATER   '>'

大なり記号'>'

Definition at line 72 of file shell.h.

Referenced by lexan().

◆ SH_LESS

#define SH_LESS   '<'

小なり記号'<'

Definition at line 70 of file shell.h.

Referenced by lexan().

◆ SH_NEWLINE

#define SH_NEWLINE   '\n'

LF改行コード'
'(字句解析時に用いる)

Definition at line 56 of file shell.h.

Referenced by lexan(), and shell().

◆ SH_SQUOTE

#define SH_SQUOTE   '\''

シングルクォート文字'''(字句解析時に用いる)

Definition at line 66 of file shell.h.

Referenced by lexan().

◆ SH_TAB

#define SH_TAB   '\t'

TAB文字(字句解析時に用いる)

Definition at line 64 of file shell.h.

Referenced by lexan().

◆ SH_TOK_AMPER

#define SH_TOK_AMPER   0

アンパサンド'&'トークン

Definition at line 75 of file shell.h.

Referenced by lexan(), and shell().

◆ SH_TOK_GREATER

#define SH_TOK_GREATER   2

大なり'>'トークン

Definition at line 79 of file shell.h.

Referenced by lexan(), and shell().

◆ SH_TOK_LESS

#define SH_TOK_LESS   1

小なり'<'トークン

Definition at line 77 of file shell.h.

Referenced by lexan(), and shell().

◆ SH_TOK_OTHER

#define SH_TOK_OTHER   3

その他('&'、'<'、'>以外')のトークン(例:英数字文字列)

Definition at line 81 of file shell.h.

Referenced by lexan(), and shell().

◆ SHELL_ARGLEN

#define SHELL_ARGLEN   (SHELL_BUFLEN + SHELL_MAXTOK)

引数の領域(長さ)

Definition at line 13 of file shell.h.

◆ SHELL_BAN0

#define SHELL_BAN0   "\033[31;1m"

シェル起動時のバナー その0(文字色を赤くするANSIエスケープシーケンス)

Definition at line 18 of file shell.h.

Referenced by shell().

◆ SHELL_BAN1

#define SHELL_BAN1   "------------------------------------------"

シェル起動時のバナー その1

Definition at line 20 of file shell.h.

Referenced by shell().

◆ SHELL_BAN2

#define SHELL_BAN2   " __ __ _____ _ _ _ _ "

シェル起動時のバナー その2

Definition at line 22 of file shell.h.

Referenced by shell().

◆ SHELL_BAN3

#define SHELL_BAN3   " \\ \\ / / |__ __| | \\ | | | | | | "

シェル起動時のバナー その3

Definition at line 24 of file shell.h.

Referenced by shell().

◆ SHELL_BAN4

#define SHELL_BAN4   " \\ \\/ / | | | \\| | | | | | "

シェル起動時のバナー その4

Definition at line 26 of file shell.h.

Referenced by shell().

◆ SHELL_BAN5

#define SHELL_BAN5   " / /\\ \\ _| |_ | \\ | | | | | "

シェル起動時のバナー その5

Definition at line 28 of file shell.h.

Referenced by shell().

◆ SHELL_BAN6

#define SHELL_BAN6   " / / \\ \\ | | | | \\ | \\ -- / "

シェル起動時のバナー その6

Definition at line 30 of file shell.h.

Referenced by shell().

◆ SHELL_BAN7

#define SHELL_BAN7   " -- -- ----- - - ---- "

シェル起動時のバナー その7

Definition at line 32 of file shell.h.

Referenced by shell().

◆ SHELL_BAN8

#define SHELL_BAN8   "------------------------------------------"

シェル起動時のバナー その8

Definition at line 34 of file shell.h.

Referenced by shell().

◆ SHELL_BAN9

#define SHELL_BAN9   "\033[0m\n"

シェル起動時のバナー その9(文字色をデフォルトに戻すANSIエスケープシーケンス)

Definition at line 36 of file shell.h.

Referenced by shell().

◆ SHELL_BGERRMSG

#define SHELL_BGERRMSG   "Cannot redirect I/O or background a builtin\n"

I/Oリダイレクトできなかった場合もしくはバックグラウンドのXINUシェルビルトインコマンドエラー用のメッセージ

Definition at line 53 of file shell.h.

Referenced by shell().

◆ SHELL_BUFLEN

#define SHELL_BUFLEN   TY_IBUFLEN + 1

インプットバッファの長さ

Definition at line 7 of file shell.h.

Referenced by shell().

◆ SHELL_CMDPRIO

#define SHELL_CMDPRIO   20

コマンドに対するプロセス優先度

Definition at line 15 of file shell.h.

Referenced by shell().

◆ SHELL_CMDSTK

#define SHELL_CMDSTK   8192

コマンドを実行するプロセスに対するスタックサイズ

Definition at line 11 of file shell.h.

Referenced by shell().

◆ SHELL_CREATMSG

#define SHELL_CREATMSG   "Cannot create process\n"

コマンド実行時にプロセスを生成できなかった場合のエラーメッセージ

Definition at line 47 of file shell.h.

Referenced by shell().

◆ SHELL_ERROR

#define SHELL_ERROR   1

XINUシェルの処理失敗

Definition at line 86 of file shell.h.

◆ SHELL_EXIT

#define SHELL_EXIT   -3

XINUシェルを終了させる返り値

Definition at line 88 of file shell.h.

Referenced by shell(), and xsh_exit().

◆ SHELL_EXITMSG

#define SHELL_EXITMSG   "Shell closed\n"

XINUシェル終了時のメッセージ

Definition at line 43 of file shell.h.

Referenced by shell().

◆ SHELL_INERRMSG

#define SHELL_INERRMSG   "Cannot open file %s for input\n"

インプットとして用いるファイルが開けなかった場合のエラーメッセージ

Definition at line 49 of file shell.h.

Referenced by shell().

◆ SHELL_MAXTOK

#define SHELL_MAXTOK   32

一行あたりの最大トークン数

Definition at line 9 of file shell.h.

Referenced by lexan(), and shell().

◆ SHELL_OK

#define SHELL_OK   0

XINUシェルの処理成功

Definition at line 84 of file shell.h.

◆ SHELL_OUTERRMSG

#define SHELL_OUTERRMSG   "Cannot open file %s for output\n"

アウトプットとして用いるファイルが開けなかった場合のエラーメッセージ

Definition at line 51 of file shell.h.

Referenced by shell().

◆ SHELL_PROMPT

#define SHELL_PROMPT   "xsh $ "

コマンドプロンプト

Definition at line 39 of file shell.h.

Referenced by shell().

◆ SHELL_STRTMSG

#define SHELL_STRTMSG   "Welcome to Xinu!\n"

Welcomeメッセージ

Definition at line 41 of file shell.h.

Referenced by shell().

◆ SHELL_SYNERRMSG

#define SHELL_SYNERRMSG   "Syntax error\n"

シンタックスエラー時のメッセージ

Definition at line 45 of file shell.h.

Referenced by shell().

Variable Documentation

◆ cmdtab

const struct cmdent cmdtab[]

XINUシェルが提供するコマンドを管理する配列

Definition at line 10 of file shell.c.

Referenced by xsh_help().

◆ ncmd

uint32 ncmd

XINUシェルが提供するコマンドの数

Definition at line 35 of file shell.c.

Referenced by shell(), and xsh_help().