cmdline: make cmdline structure opaque

Message ID 20210910231639.789066-1-dmitry.kozliuk@gmail.com (mailing list archive)
State Superseded, archived
Headers
Series cmdline: make cmdline structure opaque |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Dmitry Kozlyuk Sept. 10, 2021, 11:16 p.m. UTC
  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 <dmitry.kozliuk@gmail.com>
---
Unfortunately there's no deprection notice for struct rdline.
If its definition was also hidden, the line buffer size limit
could be changed or removed completely in the future.

 lib/cmdline/cmdline.h         | 19 -------------------
 lib/cmdline/cmdline_private.h | 11 ++++++++++-
 2 files changed, 10 insertions(+), 20 deletions(-)
  

Patch

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..7743807d0b 100644
--- a/lib/cmdline/cmdline_private.h
+++ b/lib/cmdline/cmdline_private.h
@@ -33,7 +33,16 @@  struct cmdline {
 	char repeated_char;
 	WORD repeat_count;
 };
-#endif
+#else
+struct cmdline {
+	int s_in;
+	int s_out;
+	cmdline_parse_ctx_t *ctx;
+	struct rdline rdl;
+	char prompt[RDLINE_PROMPT_SIZE];
+	struct termios oldterm;
+};
+#endif /* !RTE_EXEC_ENV_WINDOWS */
 
 /* Disable buffering and echoing, save previous settings to oldterm. */
 void terminal_adjust(struct cmdline *cl);