GadgetSeed  0.9.6
shell.h ファイル

コマンドシェル [詳解]

#include "sysconfig.h"
#include "str.h"
#include "lineedit.h"
#include "history.h"
#include "console.h"
shell.h の依存先関係図:
被依存関係図:

[ソースコード]

データ構造

struct  st_file_operation
 ファイル種別に対するコマンド実行定義 [詳解]
 
struct  st_shell_command
 シェルコマンド構造体 [詳解]
 
struct  st_shell
 シェルデータ構造体 [詳解]
 

マクロ定義

#define GSC_SHELL_MAX_COM_ARGV   10
 
#define CMDATTR_CONT   0x0001
 
#define CMDATTR_ARGLESS   0x0002
 
#define CMDATTR_CTAL   (CMDATTR_CONT|CMDATTR_ARGLESS)
 

関数

void init_shell (struct st_shell *shell, struct st_shell_command *const *coms, const uchar *prompt)
 シェルを初期化する [詳解]
 
void print_prompt (struct st_shell *shell)
 プロンプトを表示する [詳解]
 
void dispose_shell_line (struct st_shell *shell)
 編集中のコマンドラインを破棄する [詳解]
 
int exec_shell_command (struct st_shell *shell, uchar *str)
 str文字列のコマンドを実行する [詳解]
 
void print_command_usage (const struct st_shell_command *command)
 
int task_shell (struct st_shell *shell, uchar ch)
 文字列編集タスク [詳解]
 
void startup_shell (void)
 
int add_shell_command (struct st_shell_command *command)
 
int exec_command (uchar *str)
 
int escaped_str (uchar *dstr, uchar *sstr)
 文字列をshellで処理可能なようにエスケープシーケンスを追加する [詳解]
 
void set_file_operation (const struct st_file_operation *const fileop[])
 
int do_file_operation (uchar *str, uchar *arg)
 

詳解

コマンドシェル

日付
2007.03.16
2002.03.24
著者
Takashi SHUDO

shell.h に定義があります。

関数詳解

◆ dispose_shell_line()

void dispose_shell_line ( struct st_shell shell)

編集中のコマンドラインを破棄する

引数
[in]shellshellデータ構造体ポインタ

shell.c67 行目に定義があります。

参照先 st_shell::comLine, new_lineedit().

呼び出し関係図:

◆ escaped_str()

int escaped_str ( uchar dstr,
uchar sstr 
)

文字列をshellで処理可能なようにエスケープシーケンスを追加する

引数
dsrt変換後文字列
ssrt変換前文字列
戻り値
変換後文字数

shell.c506 行目に定義があります。

◆ exec_shell_command()

int exec_shell_command ( struct st_shell shell,
uchar str 
)

str文字列のコマンドを実行する

引数
[in]shellshellデータ構造体ポインタ
[in]strコマンド文字列ポインタ
戻り値
コマンド実行結果

shell.c218 行目に定義があります。

参照先 GSC_SHELL_MAX_LINE_COLUMS, st_shell::lastCom, st_shell::shell_coms, strncopy().

呼び出し関係図:

◆ init_shell()

void init_shell ( struct st_shell shell,
struct st_shell_command *const *  coms,
const uchar prompt 
)

シェルを初期化する

引数
[in]shellshellデータ構造体ポインタ
[in]coms初期化するshell_commandのポインタ
[in]promptプロンプト文字列ポインタ

shell.c39 行目に定義があります。

◆ print_prompt()

void print_prompt ( struct st_shell shell)

プロンプトを表示する

引数
[in]shellshellデータ構造体ポインタ

shell.c57 行目に定義があります。

参照先 st_shell::prompt, tprintf().

呼び出し関係図:

◆ task_shell()

int task_shell ( struct st_shell shell,
uchar  ch 
)

文字列編集タスク

引数
[in]shellshellデータ構造体ポインタ
ch編集文字データ
戻り値
コマンド実行結果

shell.c457 行目に定義があります。