|
CNDP 22.08.0
|
#include <strings.h>#include <stdint.h>#include <stdio.h>#include <stdlib.h>#include <string.h>#include "cli.h"#include "cli_common.h"#include "cli_gapbuf.h"#include "cne_log.h"#include "cne_common.h"#include "cne_stdio.h"#include "cne_tty.h"#include "vt100_out.h"Go to the source code of this file.
Functions | |
| CNDP_API int | cli_poll (char *c) |
| static void | cli_cursor_left (void) |
| static void | cli_cursor_right (void) |
| static void | cli_save_cursor (void) |
| static void | cli_restore_cursor (void) |
| static void | cli_display_left (void) |
| static void | cli_display_right (void) |
| static void | cli_clear_screen (void) |
| static void | cli_clear_to_eol (void) |
| static void | cli_clear_line (int lineno) |
| static void | cli_move_cursor_up (int lineno) |
| static void | cli_display_prompt (int t) |
| static void | cli_redisplay_line (void) |
| CNDP_API void | cli_input (char *str, int n, int silent) |
| CNDP_API cli_prompt_t | cli_set_prompt (cli_prompt_t prompt) |
| CNDP_API void | cli_set_io (FILE *in, FILE *out) |
| CNDP_API int | cli_stdin_setup (void) |
| CNDP_API void | cli_stdin_restore (void) |
| CNDP_API char | cli_pause (const char *msg, const char *keys) |
| CNDP_API int | cli_yield_io (void) |
CNE Command line input interface
Definition in file cli_input.h.
| CNDP_API int cli_poll | ( | char * | c | ) |
Poll for a input character
| c | Pointer to character address. |
|
inlinestatic |
Move the vt100 cursor to the left one character
Definition at line 89 of file cli_input.h.
|
inlinestatic |
Move the vt100 cursor to the right one character
Definition at line 103 of file cli_input.h.
|
inlinestatic |
Save the vt100 cursor location
Definition at line 117 of file cli_input.h.
|
inlinestatic |
Restore the cursor to the saved location on the console
Definition at line 131 of file cli_input.h.
|
inlinestatic |
Print out the left side of the input in the Gap Buffer.
Definition at line 145 of file cli_input.h.
|
inlinestatic |
Print out the right side of the input in the Gap Buffer.
Definition at line 160 of file cli_input.h.
|
inlinestatic |
Clear the console screen
Definition at line 175 of file cli_input.h.
|
inlinestatic |
clear from cursor to end of line
Definition at line 189 of file cli_input.h.
|
inlinestatic |
Clear the current line or the line given
| lineno | if lineno is -1 then clear the current line else the lineno given. |
Definition at line 205 of file cli_input.h.
|
inlinestatic |
Move the cursor up by the number of lines given
| lineno | Number of lines to move the cursor |
Definition at line 226 of file cli_input.h.
|
inlinestatic |
Display the prompt on the next line
| t | The type of prompt. |
Definition at line 239 of file cli_input.h.
|
inlinestatic |
Print out the complete line in the Gap Buffer.
Definition at line 309 of file cli_input.h.
| CNDP_API void cli_input | ( | char * | str, |
| int | n, | ||
| int | silent ) |
Add a input text string the cli input parser
| str | Pointer to string to insert |
| n | Number of bytes in string |
| silent | Set silent mode if non-zero |
| CNDP_API cli_prompt_t cli_set_prompt | ( | cli_prompt_t | prompt | ) |
Set the CLI prompt function pointer
| prompt | Function pointer to display the prompt |
| CNDP_API void cli_set_io | ( | FILE * | in, |
| FILE * | out ) |
Set the I/O file descriptors
| in | File descriptor for input |
| out | File descriptor for output |
| CNDP_API int cli_stdin_setup | ( | void | ) |
Set the I/O to use stdin/stdout
| CNDP_API void cli_stdin_restore | ( | void | ) |
Restore the stdin/stdout tty params from setup
| CNDP_API char cli_pause | ( | const char * | msg, |
| const char * | keys ) |
Pause and wait for input character
| msg | TODO |
| keys | List of keys to force return, if NULL defaults to ESC and q/Q |
| CNDP_API int cli_yield_io | ( | void | ) |
return true if calling yield should are enabled.