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

Embed: (wiki syntax)

« Back to documentation index

text_history.h File Reference

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用テキストヒストリモジュールの定義。

Author:
Shinichiro Nakamura

文字列の入力履歴を論理的に扱うためのモジュール。 このモジュールはビューに関して一切感知しない。

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 )

初期化する。

Parameters:
pテキストヒストリ構造体。

Definition at line 48 of file text_history.c.

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 )

読み出しポインタを次に進める。

Parameters:
pテキストヒストリ構造体。

Definition at line 113 of file text_history.c.

int text_history_read_point_prev ( text_history_t p )

読み出しポインタを前に戻す。

Parameters:
pテキストヒストリ構造体。

Definition at line 128 of file text_history.c.

int text_history_write ( text_history_t p,
char *  buf 
)

テキストヒストリに対して書き込みを実行する。

Parameters:
pテキストヒストリ構造体。
bufバッファ。

Definition at line 64 of file text_history.c.