Natural Tiny Shell (NT-Shell) library is a tiny shell library for a small embedded system. The interface is really simple. You should only know ntshell_execute in ntshell.h. So you can port it to any embedded system easily. Please enjoy your small embedded system with it. :)
Dependents: NaturalTinyShell_TestProgram
小規模組み込みシステム向けのシェルシステムの実装。 More...
Go to the source code of this file.
Functions | |
static void | actfunc_history_prev (vtparse_t *parser, vtparse_action_t action, unsigned char ch) |
テキストヒストリで1つ後ろを辿る。 | |
static void | actfunc_history_next (vtparse_t *parser, vtparse_action_t action, unsigned char ch) |
テキストヒストリで1つ前を辿る。 | |
static void | actfunc_cursor_left (vtparse_t *parser, vtparse_action_t action, unsigned char ch) |
カーソルを左へ移動させる。 | |
static void | actfunc_cursor_right (vtparse_t *parser, vtparse_action_t action, unsigned char ch) |
カーソルを右へ移動させる。 | |
static void | actfunc_enter (vtparse_t *parser, vtparse_action_t action, unsigned char ch) |
エンターキーの処理を実行する。 | |
static void | actfunc_cancel (vtparse_t *parser, vtparse_action_t action, unsigned char ch) |
キャンセルキーの処理を実行する。 | |
static void | actfunc_insert (vtparse_t *parser, vtparse_action_t action, unsigned char ch) |
挿入処理を実行する。 | |
static void | actfunc_backspace (vtparse_t *parser, vtparse_action_t action, unsigned char ch) |
バックスペース処理を実行する。 | |
static void | actfunc_suggest (vtparse_t *parser, vtparse_action_t action, unsigned char ch) |
入力補完処理を実行する。 | |
void | parser_callback (vtparse_t *parser, vtparse_action_t action, unsigned char ch) |
パーサーに対するコールバック関数。 | |
void | ntshell_version (int *major, int *minor, int *release) |
Natural Tiny Shellのバージョンを返す。 | |
void | ntshell_execute (ntshell_t *p, int(*func_read)(char *buf, int cnt), int(*func_write)(const char *buf, int cnt), int(*func_cb)(const char *text)) |
Natural Tiny Shellを実行する。 | |
Variables | |
static const ntshell_action_table_t | action_table [] |
アクションに対する処理関数テーブル。 |
Detailed Description
小規模組み込みシステム向けのシェルシステムの実装。
Definition in file ntshell.c.
Function Documentation
static void actfunc_backspace | ( | vtparse_t * | parser, |
vtparse_action_t | action, | ||
unsigned char | ch | ||
) | [static] |
static void actfunc_cancel | ( | vtparse_t * | parser, |
vtparse_action_t | action, | ||
unsigned char | ch | ||
) | [static] |
static void actfunc_cursor_left | ( | vtparse_t * | parser, |
vtparse_action_t | action, | ||
unsigned char | ch | ||
) | [static] |
static void actfunc_cursor_right | ( | vtparse_t * | parser, |
vtparse_action_t | action, | ||
unsigned char | ch | ||
) | [static] |
static void actfunc_enter | ( | vtparse_t * | parser, |
vtparse_action_t | action, | ||
unsigned char | ch | ||
) | [static] |
static void actfunc_history_next | ( | vtparse_t * | parser, |
vtparse_action_t | action, | ||
unsigned char | ch | ||
) | [static] |
static void actfunc_history_prev | ( | vtparse_t * | parser, |
vtparse_action_t | action, | ||
unsigned char | ch | ||
) | [static] |
static void actfunc_insert | ( | vtparse_t * | parser, |
vtparse_action_t | action, | ||
unsigned char | ch | ||
) | [static] |
static void actfunc_suggest | ( | vtparse_t * | parser, |
vtparse_action_t | action, | ||
unsigned char | ch | ||
) | [static] |
void ntshell_execute | ( | ntshell_t * | p, |
int(*)(char *buf, int cnt) | func_read, | ||
int(*)(const char *buf, int cnt) | func_write, | ||
int(*)(const char *text) | func_cb | ||
) |
void ntshell_version | ( | int * | major, |
int * | minor, | ||
int * | release | ||
) |
void parser_callback | ( | vtparse_t * | parser, |
vtparse_action_t | action, | ||
unsigned char | ch | ||
) |
Variable Documentation
const ntshell_action_table_t action_table[] [static] |
{ {VTPARSE_ACTION_EXECUTE, 0x01, actfunc_cursor_head}, {VTPARSE_ACTION_EXECUTE, 0x02, actfunc_cursor_left}, {VTPARSE_ACTION_EXECUTE, 0x03, actfunc_cancel}, {VTPARSE_ACTION_EXECUTE, 0x05, actfunc_cursor_tail}, {VTPARSE_ACTION_EXECUTE, 0x06, actfunc_cursor_right}, {VTPARSE_ACTION_EXECUTE, 0x08, actfunc_backspace}, {VTPARSE_ACTION_EXECUTE, 0x09, actfunc_suggest}, {VTPARSE_ACTION_EXECUTE, 0x0d, actfunc_enter}, {VTPARSE_ACTION_EXECUTE, 0x0e, actfunc_history_next}, {VTPARSE_ACTION_EXECUTE, 0x10, actfunc_history_prev}, {VTPARSE_ACTION_CSI_DISPATCH, 0x41, actfunc_history_prev}, {VTPARSE_ACTION_CSI_DISPATCH, 0x42, actfunc_history_next}, {VTPARSE_ACTION_CSI_DISPATCH, 0x43, actfunc_cursor_right}, {VTPARSE_ACTION_CSI_DISPATCH, 0x44, actfunc_cursor_left}, {VTPARSE_ACTION_PRINT, 0x7f, actfunc_backspace}, }
アクションに対する処理関数テーブル。
やってくるコードは仮想端末側の処理に依存する。 よって様々なプラットフォームの様々な仮想端末で試すと良い。
Platform
Tools
Windows
Hyper Terminal, Poderossa, TeraTerm
Linux
minicom, screen, kermit
Generated on Fri Jul 15 2022 00:05:03 by 1.7.2