summaryrefslogtreecommitdiff
path: root/lib/cmdline
diff options
context:
space:
mode:
authorDmitry Kozlyuk <[email protected]>2021-10-08 01:10:27 +0300
committerThomas Monjalon <[email protected]>2021-10-22 22:44:18 +0200
commitf43809d28c0b9e7b71afcde56a60fa578a4a7b5f (patch)
tree1fa6d0117c84a831d8234abbb64fbd57aabcc091 /lib/cmdline
parent2f5c4025abb325144e53cedc1b1ecb52d03f38dc (diff)
cmdline: make struct cmdline opaque
Remove the definition of `struct cmdline` from public header. Deprecation notice: https://mails.dpdk.org/archives/dev/2020-September/183310.html Signed-off-by: Dmitry Kozlyuk <[email protected]> Acked-by: David Marchand <[email protected]> Acked-by: Olivier Matz <[email protected]> Acked-by: Narcisa Vasile <[email protected]>
Diffstat (limited to 'lib/cmdline')
-rw-r--r--lib/cmdline/cmdline.h19
-rw-r--r--lib/cmdline/cmdline_private.h8
2 files changed, 7 insertions, 20 deletions
diff --git a/lib/cmdline/cmdline.h b/lib/cmdline/cmdline.h
index c29762ddae..96674dfda2 100644
--- a/lib/cmdline/cmdline.h
+++ b/lib/cmdline/cmdline.h
@@ -7,10 +7,6 @@
#ifndef _CMDLINE_H_
#define _CMDLINE_H_
-#ifndef RTE_EXEC_ENV_WINDOWS
-#include <termios.h>
-#endif
-
#include <rte_common.h>
#include <rte_compat.h>
@@ -27,23 +23,8 @@
extern "C" {
#endif
-#ifndef RTE_EXEC_ENV_WINDOWS
-
-struct cmdline {
- int s_in;
- int s_out;
- cmdline_parse_ctx_t *ctx;
- struct rdline rdl;
- char prompt[RDLINE_PROMPT_SIZE];
- struct termios oldterm;
-};
-
-#else
-
struct cmdline;
-#endif /* RTE_EXEC_ENV_WINDOWS */
-
struct cmdline *cmdline_new(cmdline_parse_ctx_t *ctx, const char *prompt, int s_in, int s_out);
void cmdline_set_prompt(struct cmdline *cl, const char *prompt);
void cmdline_free(struct cmdline *cl);
diff --git a/lib/cmdline/cmdline_private.h b/lib/cmdline/cmdline_private.h
index a87c45275c..2e93674c66 100644
--- a/lib/cmdline/cmdline_private.h
+++ b/lib/cmdline/cmdline_private.h
@@ -11,6 +11,8 @@
#include <rte_os_shim.h>
#ifdef RTE_EXEC_ENV_WINDOWS
#include <rte_windows.h>
+#else
+#include <termios.h>
#endif
#include <cmdline.h>
@@ -22,6 +24,7 @@ struct terminal {
int is_console_input;
int is_console_output;
};
+#endif
struct cmdline {
int s_in;
@@ -29,11 +32,14 @@ struct cmdline {
cmdline_parse_ctx_t *ctx;
struct rdline rdl;
char prompt[RDLINE_PROMPT_SIZE];
+#ifdef RTE_EXEC_ENV_WINDOWS
struct terminal oldterm;
char repeated_char;
WORD repeat_count;
-};
+#else
+ struct termios oldterm;
#endif
+};
/* Disable buffering and echoing, save previous settings to oldterm. */
void terminal_adjust(struct cmdline *cl);