[v11,1/3] cmdline: make rdline status not private
Checks
Commit Message
The function cmdline_poll() returns values from rdline_status enum
but that was moved to being defined only in cmdline_private.h.
For proper use of the API the return value needs to be visible
to callers. This was not a problem before because cmdline_poll()
was not used anywhere.
Fixes: f8f8dc289095 ("cmdline: make struct rdline opaque")
Cc: dmitry.kozliuk@gmail.com
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
lib/cmdline/cmdline.h | 6 ++++++
lib/cmdline/cmdline_private.h | 6 ------
2 files changed, 6 insertions(+), 6 deletions(-)
Comments
Acked-by: Chengwen Feng <fengchengwen@huawei.com>
On 2023/2/4 3:14, Stephen Hemminger wrote:
> The function cmdline_poll() returns values from rdline_status enum
> but that was moved to being defined only in cmdline_private.h.
>
> For proper use of the API the return value needs to be visible
> to callers. This was not a problem before because cmdline_poll()
> was not used anywhere.
>
> Fixes: f8f8dc289095 ("cmdline: make struct rdline opaque")
> Cc: dmitry.kozliuk@gmail.com
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> ---
...
@@ -23,6 +23,12 @@
extern "C" {
#endif
+enum rdline_status {
+ RDLINE_INIT,
+ RDLINE_RUNNING,
+ RDLINE_EXITED
+};
+
struct cmdline;
struct cmdline *cmdline_new(cmdline_parse_ctx_t *ctx, const char *prompt, int s_in, int s_out);
@@ -23,12 +23,6 @@
#define RDLINE_HISTORY_BUF_SIZE BUFSIZ
#define RDLINE_HISTORY_MAX_LINE 64
-enum rdline_status {
- RDLINE_INIT,
- RDLINE_RUNNING,
- RDLINE_EXITED
-};
-
struct rdline {
enum rdline_status status;
/* rdline bufs */