|
|
| version 1.2.2.2, 2010/06/04 12:46:27 | version 1.2.2.3, 2010/06/04 13:51:21 |
|---|---|
| Line 209 inline const char *cli_GetError(); | Line 209 inline const char *cli_GetError(); |
| /* CLI Functions */ | /* CLI Functions */ |
| /* | /* |
| * cli_BindKey() Bind function to key | |
| * @key = key structure | |
| * @buffer = CLI buffer | |
| * return: RETCODE_ERR error, RETCODE_OK ok, >0 bind at position | |
| */ | |
| int cli_BindKey(bindkey_t * __restrict key, linebuffer_t * __restrict buffer); | |
| /* | |
| * cli_addHistory() Add line to history | |
| * @buffer = CLI buffer | |
| * @str = Add text | |
| * return: RETCODE_ERR error, RETCODE_OK ok | |
| */ | |
| int cli_addHistory(linebuffer_t * __restrict buffer, const char * __restrict str); | |
| /* | |
| * cli_saveHistory() Save history to file | |
| * @buffer = CLI buffer | |
| * @histfile = History filename, if NULL will be use default name | |
| * @lines = Maximum history lines to save | |
| * return: RETCODE_ERR error, RETCODE_OK ok | |
| */ | |
| int cli_saveHistory(linebuffer_t * __restrict buffer, const char *histfile, int lines); | |
| /* | |
| * cli_loadHistory() Load history from file | |
| * @buffer = CLI buffer | |
| * @histfile = History filename, if NULL will be use default name | |
| * return: RETCODE_ERR error, RETCODE_OK ok | |
| */ | |
| int cli_loadHistory(linebuffer_t * __restrict buffer, const char *histfile); | |
| /* | |
| * cli_resetHistory() Reset history search in CLI session | |
| * @buffer = CLI buffer | |
| * return: none | |
| */ | |
| inline void cli_resetHistory(linebuffer_t * __restrict buffer); | |
| /* | |
| * cli_freeLine() Clear entire line | |
| * @buffer = CLI buffer | |
| * return: RETCODE_ERR error, RETCODE_OK ok | |
| */ | |
| inline int cli_freeLine(linebuffer_t * __restrict buffer); | |
| /* | |
| * cli_setPrompt() Set new prompt for CLI session | |
| * @buffer = CLI buffer | |
| * @prompt = new text for prompt or if NULL disable prompt | |
| * return: none | |
| */ | |
| inline void cli_setPrompt(linebuffer_t * __restrict buffer, const char *prompt); | |
| /* | |
| * cliEnd() Clear data, Free resources and close CLI session | |
| * @buffer = CLI buffer | |
| * return: RETCODE_ERR error, RETCODE_OK ok | |
| */ | |
| void cliEnd(linebuffer_t * __restrict buffer); | |
| /* | |
| * cliInit() Start CLI session, allocate memory for resources and bind keys | |
| * @fin = Input device handle | |
| * @fout = Output device handle | |
| * @prompt = text for prompt, if NULL disable prompt | |
| * return: NULL if error or !=NULL CLI buffer | |
| */ | |
| linebuffer_t *cliInit(int fin, int fout, const char *prompt); | |
| /* | |
| * cliExec() Execute CLI main loop | * cliExec() Execute CLI main loop |
| * @cmdList = Commands list | * @cmdList = Commands list |
| * @csPrompt = Prompt text | * @csPrompt = Prompt text |