CNDP  22.08.0
cli_history.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright (c) 2019-2022 Intel Corporation.
3  */
4 
5 #ifndef _CLI_HISTORY_H_
6 #define _CLI_HISTORY_H_
7 
14 #include <sys/queue.h> // for CIRCLEQ_ENTRY
15 #include <stdint.h> // for uint32_t
16 
17 #include "cli.h"
18 #include "cne_common.h" // for CNDP_API
19 
20 #ifdef __cplusplus
21 extern "C" {
22 #endif
23 
24 enum {
25  CLI_DEFAULT_HISTORY = -1,
27 };
28 
29 struct cli_hist {
30  CIRCLEQ_ENTRY(cli_hist) next;
31  char *line;
32 };
33 
34 struct cli;
35 
44 CNDP_API struct cli_hist *cli_hist_alloc(void);
45 
56 CNDP_API void cli_hist_free(struct cli_hist *hist);
57 
68 CNDP_API void cli_history_add(char *line);
69 
78 CNDP_API void cli_history_del(void);
79 
90 CNDP_API char *cli_history_line(int lineno);
91 
100 void cli_history_clear(void);
101 
110 CNDP_API void cli_history_delete(void);
111 
120 CNDP_API int cli_set_history(uint32_t nb_hist);
121 
130 CNDP_API char *cli_history_prev(void);
131 
138 CNDP_API char *cli_history_next(void);
139 
145 CNDP_API void cli_history_reset(void);
146 
155 CNDP_API void cli_history_dump(void);
156 
157 #ifdef __cplusplus
158 }
159 #endif
160 
161 #endif /* _CLI_HISTORY_H_ */
void cli_history_clear(void)
CNDP_API int cli_set_history(uint32_t nb_hist)
CNDP_API char * cli_history_next(void)
@ CLI_NO_HISTORY
Definition: cli_history.h:26
CNDP_API struct cli_hist * cli_hist_alloc(void)
CNDP_API void cli_history_dump(void)
CNDP_API void cli_hist_free(struct cli_hist *hist)
CNDP_API void cli_history_reset(void)
CNDP_API void cli_history_del(void)
CNDP_API void cli_history_add(char *line)
CNDP_API char * cli_history_line(int lineno)
CNDP_API void cli_history_delete(void)
CNDP_API char * cli_history_prev(void)