46 cli_get_cursor(
int *row,
int *col)
54 memset(buf, 0,
sizeof(buf));
242 this_cli->plen = this_cli->prompt(t);
248 cli_display_line(
void)
250 struct gapbuf *gb = this_cli->gb;
257 if (cli_tst_flag(DELETE_CHAR)) {
258 cli_clr_flag(DELETE_CHAR);
260 cli_set_flag(CLEAR_TO_EOL);
262 if (cli_tst_flag(CLEAR_LINE)) {
263 cli_clr_flag(CLEAR_LINE);
266 cli_set_flag(DISPLAY_PROMPT);
268 if (cli_tst_flag(CLEAR_TO_EOL)) {
269 cli_clr_flag(CLEAR_TO_EOL);
272 if (cli_tst_flag(DISPLAY_PROMPT)) {
273 cli_clr_flag(DISPLAY_PROMPT | PROMPT_CONTINUE);
277 if (point < window) {
280 wend = point + (len - point);
282 wend = point + (window - point);
284 wstart = point - window;
285 wend = wstart + window;
289 vt_cnright(this_cli->plen);
297 vt_cnright(this_cli->plen + point);
313 this_cli->flags |= DISPLAY_PROMPT;
395 CNDP_API
char cli_pause(
const char *msg,
const char *keys);
int(* cli_prompt_t)(int continuation)
static void gb_move_gap_to_point(struct gapbuf *gb)
CNDP_API uint32_t gb_copy_to_buf(struct gapbuf *gb, char *dst, uint32_t size)
static int gb_point_offset(struct gapbuf *gb)
static char * gb_start_of_buf(struct gapbuf *gb)
static char * gb_end_of_gap(struct gapbuf *gb)
static uint32_t gb_left_data_size(struct gapbuf *gb)
static uint32_t gb_right_data_size(struct gapbuf *gb)
static uint32_t gb_data_size(struct gapbuf *gb)
CNDP_API int cne_printf(const char *fmt,...)
CNDP_API int tty_num_columns(void)
CNDP_API int tty_read(char *buf, int len)
CNDP_API int tty_write(const char *buf, int len)