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
text_history.h File Reference
NT-Shell用テキストヒストリモジュールの定義。 More...
Go to the source code of this file.
Data Structures | |
struct | text_history_t |
テキストヒストリ構造体。 More... | |
Functions | |
void | text_history_init (text_history_t *p) |
初期化する。 | |
int | text_history_write (text_history_t *p, char *buf) |
テキストヒストリに対して書き込みを実行する。 | |
int | text_history_read (text_history_t *p, char *buf, const int siz) |
テキストヒストリから読み出しを実行する。 | |
int | text_history_read_point_next (text_history_t *p) |
読み出しポインタを次に進める。 | |
int | text_history_read_point_prev (text_history_t *p) |
読み出しポインタを前に戻す。 | |
int | text_history_find (text_history_t *p, const int index, const char *text, char *buf, const int siz) |
与えられたテキストで始まる文字列を探す。 |
Detailed Description
NT-Shell用テキストヒストリモジュールの定義。
文字列の入力履歴を論理的に扱うためのモジュール。 このモジュールはビューに関して一切感知しない。
Definition in file text_history.h.
Function Documentation
int text_history_find | ( | text_history_t * | p, |
const int | index, | ||
const char * | text, | ||
char * | buf, | ||
const int | siz | ||
) |
与えられたテキストで始まる文字列を探す。
このインターフェースはテキスト入力補完のために作られた。
- Parameters:
-
p テキストヒストリオブジェクト。 index ヒストリ中で見つかる文字列のindex個目。 text 検索する文字列。 buf 格納先バッファ。 siz 格納先バッファサイズ。
- Return values:
-
0 成功。 0以外 失敗。
Definition at line 154 of file text_history.c.
void text_history_init | ( | text_history_t * | p ) |
int text_history_read | ( | text_history_t * | p, |
char * | buf, | ||
const int | siz | ||
) |
テキストヒストリから読み出しを実行する。
得られる文字列が与えられたバッファサイズよりも大きい場合、 バッファに格納される文字列は途中で途切れるものとする。
- Parameters:
-
p テキストヒストリ構造体。 buf バッファ。 siz バッファサイズ。
Definition at line 91 of file text_history.c.
int text_history_read_point_next | ( | text_history_t * | p ) |
int text_history_read_point_prev | ( | text_history_t * | p ) |
int text_history_write | ( | text_history_t * | p, |
char * | buf | ||
) |
テキストヒストリに対して書き込みを実行する。
- Parameters:
-
p テキストヒストリ構造体。 buf バッファ。
Definition at line 64 of file text_history.c.
Generated on Fri Jul 15 2022 00:05:03 by 1.7.2