1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2010-2014 Intel Corporation.
3 * Copyright (c) 2009, Olivier MATZ <zer0@droids-corp.org>
10 #ifndef RTE_EXEC_ENV_WINDOWS
14 #include <rte_common.h>
15 #include <rte_compat.h>
17 #include <cmdline_rdline.h>
18 #include <cmdline_parse.h>
30 #ifndef RTE_EXEC_ENV_WINDOWS
35 cmdline_parse_ctx_t *ctx;
37 char prompt[RDLINE_PROMPT_SIZE];
38 struct termios oldterm;
45 #endif /* RTE_EXEC_ENV_WINDOWS */
47 struct cmdline *cmdline_new(cmdline_parse_ctx_t *ctx, const char *prompt, int s_in, int s_out);
48 void cmdline_set_prompt(struct cmdline *cl, const char *prompt);
49 void cmdline_free(struct cmdline *cl);
50 void cmdline_printf(const struct cmdline *cl, const char *fmt, ...)
51 __rte_format_printf(2, 3);
52 int cmdline_in(struct cmdline *cl, const char *buf, int size);
53 int cmdline_write_char(struct rdline *rdl, char c);
57 cmdline_get_rdline(struct cmdline *cl);
60 * This function is nonblocking equivalent of ``cmdline_interact()``. It polls
61 * *cl* for one character and interpret it. If return value is *RDLINE_EXITED*
62 * it mean that ``cmdline_quit()`` was invoked.
65 * The command line object.
68 * On success return object status - one of *enum rdline_status*.
69 * On error return negative value.
71 int cmdline_poll(struct cmdline *cl);
73 void cmdline_interact(struct cmdline *cl);
74 void cmdline_quit(struct cmdline *cl);
80 #endif /* _CMDLINE_SOCKET_H_ */