version 1.12, 2013/11/22 15:17:22
|
version 1.13, 2013/12/03 20:33:14
|
Line 106 printfEOL(linebuffer_t * __restrict buf, int len, int
|
Line 106 printfEOL(linebuffer_t * __restrict buf, int len, int
|
} |
} |
|
|
write(buf->line_out, buf->line_buf, len == -1 ? |
write(buf->line_out, buf->line_buf, len == -1 ? |
buf->line_eol - buf->line_bol: len); | buf->line_eol - buf->line_bol : len); |
} |
} |
} |
} |
|
|
Line 154 bufCHAR(int idx, void * __restrict cli_buffer)
|
Line 154 bufCHAR(int idx, void * __restrict cli_buffer)
|
memcpy(buf->line_buf + pos, buf->line_keys[idx].key_ch, buf->line_keys[idx].key_len); |
memcpy(buf->line_buf + pos, buf->line_keys[idx].key_ch, buf->line_keys[idx].key_len); |
buf->line_buf[buf->line_len - 1] = 0; |
buf->line_buf[buf->line_len - 1] = 0; |
|
|
write(buf->line_out, buf->line_keys[idx].key_ch, buf->line_keys[idx].key_len); | if (buf->line_prompt) |
| write(buf->line_out, buf->line_keys[idx].key_ch, buf->line_keys[idx].key_len); |
|
|
if (buf->line_mode == LINEMODE_INS) { |
if (buf->line_mode == LINEMODE_INS) { |
write(buf->line_out, (const u_char*) buf->line_buf + pos + buf->line_keys[idx].key_len, |
write(buf->line_out, (const u_char*) buf->line_buf + pos + buf->line_keys[idx].key_len, |
Line 1050 cliInit(int fin, int fout, const char *prompt)
|
Line 1051 cliInit(int fin, int fout, const char *prompt)
|
keys[i].key_func = bufEOL; |
keys[i].key_func = bufEOL; |
if (cli_buffer->line_prompt && (i == *K_CTRL_H || i == *K_BACKSPACE)) |
if (cli_buffer->line_prompt && (i == *K_CTRL_H || i == *K_BACKSPACE)) |
keys[i].key_func = bufBS; |
keys[i].key_func = bufBS; |
if (cli_buffer->line_prompt && i == *K_CTRL_C) | if (i == *K_CTRL_C) |
keys[i].key_func = bufCLR; |
keys[i].key_func = bufCLR; |
if (cli_buffer->line_prompt && i == *K_CTRL_A) |
if (cli_buffer->line_prompt && i == *K_CTRL_A) |
keys[i].key_func = bufBEGIN; |
keys[i].key_func = bufBEGIN; |
Line 1058 cliInit(int fin, int fout, const char *prompt)
|
Line 1059 cliInit(int fin, int fout, const char *prompt)
|
keys[i].key_func = bufEND; |
keys[i].key_func = bufEND; |
if (cli_buffer->line_prompt && i == *K_TAB) |
if (cli_buffer->line_prompt && i == *K_TAB) |
keys[i].key_func = bufComp; |
keys[i].key_func = bufComp; |
if (cli_buffer->line_prompt && i == *K_CTRL_Z) | if (i == *K_CTRL_Z) |
keys[i].key_func = bufEndNode; |
keys[i].key_func = bufEndNode; |
if (i >= *K_SPACE && i < *K_BACKSPACE) |
if (i >= *K_SPACE && i < *K_BACKSPACE) |
keys[i].key_func = bufCHAR; |
keys[i].key_func = bufCHAR; |
Line 1517 cliLoop(linebuffer_t * __restrict cli_buffer, const ch
|
Line 1518 cliLoop(linebuffer_t * __restrict cli_buffer, const ch
|
} |
} |
|
|
if (!cmd) { |
if (!cmd) { |
cli_Printf(cli_buffer, "\nCommand '%s' not found!\n", items[0]); | cli_Printf(cli_buffer, "%sCommand '%s' not found!\n", |
| cli_buffer->line_prompt ? "\n" : "", items[0]); |
ret = -1; |
ret = -1; |
} else |
} else |
if (cmd->cmd_func) { |
if (cmd->cmd_func) { |
cli_Printf(cli_buffer, "\n"); | if (cli_buffer->line_prompt) |
| cli_Printf(cli_buffer, "\n"); |
ret = cmd->cmd_func(cli_buffer, |
ret = cmd->cmd_func(cli_buffer, |
cli_buffer->line_level, items); |
cli_buffer->line_level, items); |
} else { |
} else { |