version 1.18.2.1, 2022/10/19 22:58:23
|
version 1.18.2.2, 2022/12/05 22:19:33
|
Line 87 static inline void
|
Line 87 static inline void
|
clrscrEOL(linebuffer_t * __restrict buf) |
clrscrEOL(linebuffer_t * __restrict buf) |
{ |
{ |
register int i; |
register int i; |
|
int ign __attribute__((unused)); |
|
|
if (buf && buf->line_prompt) { |
if (buf && buf->line_prompt) { |
write(buf->line_out, K_CR, 1); | ign = write(buf->line_out, K_CR, 1); |
|
|
for (i = 0; i < buf->line_len; i++) |
for (i = 0; i < buf->line_len; i++) |
write(buf->line_out, K_SPACE, 1); | ign = write(buf->line_out, K_SPACE, 1); |
} |
} |
} |
} |
|
|
static inline void |
static inline void |
printfEOL(linebuffer_t * __restrict buf, int len, int prompt) |
printfEOL(linebuffer_t * __restrict buf, int len, int prompt) |
{ |
{ |
|
int ign __attribute__((unused)); |
|
|
if (buf) { |
if (buf) { |
if (prompt && buf->line_prompt) { |
if (prompt && buf->line_prompt) { |
write(buf->line_out, K_CR, 1); | ign = write(buf->line_out, K_CR, 1); |
write(buf->line_out, buf->line_prompt, buf->line_bol); | ign = write(buf->line_out, buf->line_prompt, buf->line_bol); |
} |
} |
|
|
write(buf->line_out, buf->line_buf, len == -1 ? | ign = write(buf->line_out, buf->line_buf, len == -1 ? |
buf->line_eol - buf->line_bol : len); |
buf->line_eol - buf->line_bol : len); |
} |
} |
} |
} |
Line 113 printfEOL(linebuffer_t * __restrict buf, int len, int
|
Line 116 printfEOL(linebuffer_t * __restrict buf, int len, int
|
static inline void |
static inline void |
printfCR(linebuffer_t * __restrict buf, int prompt) |
printfCR(linebuffer_t * __restrict buf, int prompt) |
{ |
{ |
|
int ign __attribute__((unused)); |
|
|
if (buf && prompt && buf->line_prompt) { |
if (buf && prompt && buf->line_prompt) { |
write(buf->line_out, K_CR, 1); | ign = write(buf->line_out, K_CR, 1); |
write(buf->line_out, buf->line_prompt, buf->line_bol); | ign = write(buf->line_out, buf->line_prompt, buf->line_bol); |
} |
} |
} |
} |
|
|
static inline void |
static inline void |
printfNL(linebuffer_t * __restrict buf, int prompt) |
printfNL(linebuffer_t * __restrict buf, int prompt) |
{ |
{ |
|
int ign __attribute__((unused)); |
|
|
if (buf) { |
if (buf) { |
write(buf->line_out, K_ENTER, 1); | ign = write(buf->line_out, K_ENTER, 1); |
|
|
if (prompt) |
if (prompt) |
if (prompt && buf->line_prompt) |
if (prompt && buf->line_prompt) |
write(buf->line_out, buf->line_prompt, buf->line_bol); | ign = write(buf->line_out, buf->line_prompt, buf->line_bol); |
} |
} |
} |
} |
|
|
Line 138 bufCHAR(int idx, void * __restrict cli_buffer)
|
Line 145 bufCHAR(int idx, void * __restrict cli_buffer)
|
{ |
{ |
linebuffer_t *buf = cli_buffer; |
linebuffer_t *buf = cli_buffer; |
int pos; |
int pos; |
|
int ign __attribute__((unused)); |
|
|
if (!cli_buffer || idx < 0 || idx > MAX_BINDKEY) |
if (!cli_buffer || idx < 0 || idx > MAX_BINDKEY) |
return RETCODE_ERR; |
return RETCODE_ERR; |
Line 155 bufCHAR(int idx, void * __restrict cli_buffer)
|
Line 163 bufCHAR(int idx, void * __restrict cli_buffer)
|
buf->line_buf[buf->line_len - 1] = 0; |
buf->line_buf[buf->line_len - 1] = 0; |
|
|
if (buf->line_prompt) |
if (buf->line_prompt) |
write(buf->line_out, buf->line_keys[idx].key_ch, buf->line_keys[idx].key_len); | ign = 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, | ign = write(buf->line_out, (const u_char*) buf->line_buf + pos + buf->line_keys[idx].key_len, |
buf->line_len - buf->line_eol); |
buf->line_len - buf->line_eol); |
printfEOL(buf, -1, 1); |
printfEOL(buf, -1, 1); |
} |
} |
Line 404 bufComp(int idx, void * __restrict cli_buffer)
|
Line 412 bufComp(int idx, void * __restrict cli_buffer)
|
register int i, j; |
register int i, j; |
struct tagCommand *cmd, *c; |
struct tagCommand *cmd, *c; |
int pos, ret = RETCODE_OK; |
int pos, ret = RETCODE_OK; |
|
int ign __attribute__((unused)); |
|
|
if (!cli_buffer || idx < 0 || idx > MAX_BINDKEY) |
if (!cli_buffer || idx < 0 || idx > MAX_BINDKEY) |
return RETCODE_ERR; |
return RETCODE_ERR; |
Line 466 bufComp(int idx, void * __restrict cli_buffer)
|
Line 475 bufComp(int idx, void * __restrict cli_buffer)
|
/* completion show actions ... */ |
/* completion show actions ... */ |
if (j > 1 && c) { |
if (j > 1 && c) { |
printfNL(buf, 0); |
printfNL(buf, 0); |
write(buf->line_out, szLine, strlen(szLine)); | ign = write(buf->line_out, szLine, strlen(szLine)); |
printfNL(buf, 1); |
printfNL(buf, 1); |
printfEOL(buf, buf->line_len - 1, 1); |
printfEOL(buf, buf->line_len - 1, 1); |
printfEOL(buf, -1, 1); |
printfEOL(buf, -1, 1); |