version 1.1.1.1, 2010/04/16 13:20:29
|
version 1.1.1.1.2.2, 2010/04/19 09:30:49
|
Line 89 inline void cliComp(cli_Completion_t *cmdComplete, cli
|
Line 89 inline void cliComp(cli_Completion_t *cmdComplete, cli
|
} |
} |
|
|
/* |
/* |
|
* cliTTY() Initialize I/O TTY CLI features |
|
* @inp = input handle |
|
* @out = output handle |
|
* return: none |
|
*/ |
|
inline void cliTTY(FILE *inp, FILE *out) |
|
{ |
|
rl_outstream = inp; |
|
rl_outstream = out; |
|
} |
|
|
|
/* |
* cliExec() Execute CLI main loop |
* cliExec() Execute CLI main loop |
* @cmdList = Commands list |
* @cmdList = Commands list |
* @out = Output handle |
|
* @csPrompt = Prompt text |
* @csPrompt = Prompt text |
* return: -1 error, 0 = exit w/^+D, 1 done. |
* return: -1 error, 0 = exit w/^+D, 1 done. |
*/ |
*/ |
int cliExec(cliCommands_t *cmdList, FILE *out, const char *csPrompt) | int cliExec(cliCommands_t *cmdList, const char *csPrompt) |
{ |
{ |
char *line, *s, *t, **app, *items[MAX_PROMPT_ITEMS]; |
char *line, *s, *t, **app, *items[MAX_PROMPT_ITEMS]; |
int ret = 0; |
int ret = 0; |
register int i; |
register int i; |
cliCommands_t *cmd = NULL; |
cliCommands_t *cmd = NULL; |
|
FILE *out; |
|
|
inline int inline_help() |
inline int inline_help() |
{ |
{ |
Line 145 int cliExec(cliCommands_t *cmdList, FILE *out, const c
|
Line 157 int cliExec(cliCommands_t *cmdList, FILE *out, const c
|
} |
} |
|
|
/* --- main body of CLI --- */ |
/* --- main body of CLI --- */ |
|
|
|
out = rl_outstream; |
|
if (!out) |
|
out = stdout; |
|
|
rl_bind_key('?', inline_help); |
rl_bind_key('?', inline_help); |
if (!rl_attempted_completion_function) |
if (!rl_attempted_completion_function) |