|
|
| version 1.21, 2025/12/17 23:41:04 | version 1.21.2.1, 2025/12/21 22:36:19 |
|---|---|
| Line 1303 cliResetLine(linebuffer_t * __restrict cli_buffer, str | Line 1303 cliResetLine(linebuffer_t * __restrict cli_buffer, str |
| } | } |
| /* | /* |
| * cliEcho() - Switch echo on or off | |
| * | |
| * @cli_buffer = CLI buffer | |
| * @on = On or off for echo on input handler | |
| * return: -1 error or 0 ok | |
| */ | |
| int | |
| cliEcho(linebuffer_t * __restrict cli_buffer, int on) | |
| { | |
| struct termios t; | |
| if (tcgetattr(cli_buffer->line_in, &t) == -1) { | |
| cli_SetErr(errno, "tcgetattr(%d) - %s", cli_buffer->line_in, strerror(errno)); | |
| return -1; | |
| } | |
| if (on) | |
| t.c_lflag |= (ECHO); | |
| else | |
| t.c_lflag &= ~(ECHO); | |
| return tcsetattr(cli_buffer->line_in, TCSANOW, &t); | |
| } | |
| /* | |
| * cliReadLine() - Read line from opened CLI session | * cliReadLine() - Read line from opened CLI session |
| * | * |
| * @cli_buffer = CLI buffer | * @cli_buffer = CLI buffer |