#include <sys/queue.h>
#include <stdint.h>
#include "cli.h"
#include "cne_common.h"
Go to the source code of this file.
CNE Command line history
Definition in file cli_history.h.
◆ anonymous enum
Enumerator |
---|
CLI_NO_HISTORY | Use the default history count
|
Definition at line 24 of file cli_history.h.
◆ cli_hist_alloc()
CNDP_API struct cli_hist* cli_hist_alloc |
( |
void |
| ) |
|
Create and allocate a history structure
- Note
- Uses the thread variable this_cli
- Returns
- pointer to history structure or NULL on error
◆ cli_hist_free()
CNDP_API void cli_hist_free |
( |
struct cli_hist * |
hist | ) |
|
Free a CLI history structure and other memory
- Note
- Uses the thread variable this_cli
- Parameters
-
hist | Pointer to the history structure |
- Returns
- N/A
◆ cli_history_add()
CNDP_API void cli_history_add |
( |
char * |
line | ) |
|
Add line to history at the end
- Note
- Uses the thread variable this_cli
- Parameters
-
line | Pointer to string to add to the history list |
- Returns
- N/A
◆ cli_history_del()
CNDP_API void cli_history_del |
( |
void |
| ) |
|
Delete a history entry
- Note
- Uses the thread variable this_cli
- Returns
- N/A
◆ cli_history_line()
CNDP_API char* cli_history_line |
( |
int |
lineno | ) |
|
Return the history command from line number
- Note
- Uses the thread variable this_cli
- Parameters
-
lineno | The line number of the command to return. |
- Returns
- Pointer to line or NULL on error
◆ cli_history_clear()
void cli_history_clear |
( |
void |
| ) |
|
Clear all of the history lines from the list
- Note
- Uses the thread variable this_cli
- Returns
- N/A
◆ cli_history_delete()
CNDP_API void cli_history_delete |
( |
void |
| ) |
|
Delete the history lines and structure
- Note
- Uses the thread variable this_cli
- Returns
- N/A
◆ cli_set_history()
CNDP_API int cli_set_history |
( |
uint32_t |
nb_hist | ) |
|
Set the number of lines max in the history list
- Parameters
-
nb_hist | Number of lines max in the history list |
- Returns
- 0 is ok, -1 is error
◆ cli_history_prev()
CNDP_API char* cli_history_prev |
( |
void |
| ) |
|
Return the previous history line
- Note
- Uses the thread variable this_cli
- Returns
- pointer to the previous history line wrap if needed
◆ cli_history_next()
CNDP_API char* cli_history_next |
( |
void |
| ) |
|
Return the next history line
- Returns
- pointer to the next history line wrap if needed
◆ cli_history_reset()
CNDP_API void cli_history_reset |
( |
void |
| ) |
|
Reset the current history pointer to the last entry.
- Note
- Uses the thread variable this_cli
◆ cli_history_dump()
CNDP_API void cli_history_dump |
( |
void |
| ) |
|
Add the default set of directories and commands
- Note
- Uses the thread variable this_cli
- Returns
- 0 is ok, -1 is error