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> Acked-by: David Marchand <david.marchand@redhat.com> Acked-by: Olivier Matz <olivier.matz@6wind.com> Acked-by: Narcisa Vasile <navasile@linux.microsoft.com>
61 lines
1.2 KiB
C
61 lines
1.2 KiB
C
/* SPDX-License-Identifier: BSD-3-Clause
|
|
* Copyright (c) 2020 Dmitry Kozlyuk
|
|
*/
|
|
|
|
#ifndef _CMDLINE_PRIVATE_H_
|
|
#define _CMDLINE_PRIVATE_H_
|
|
|
|
#include <stdarg.h>
|
|
|
|
#include <rte_common.h>
|
|
#include <rte_os_shim.h>
|
|
#ifdef RTE_EXEC_ENV_WINDOWS
|
|
#include <rte_windows.h>
|
|
#else
|
|
#include <termios.h>
|
|
#endif
|
|
|
|
#include <cmdline.h>
|
|
|
|
#ifdef RTE_EXEC_ENV_WINDOWS
|
|
struct terminal {
|
|
DWORD input_mode;
|
|
DWORD output_mode;
|
|
int is_console_input;
|
|
int is_console_output;
|
|
};
|
|
#endif
|
|
|
|
struct cmdline {
|
|
int s_in;
|
|
int s_out;
|
|
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);
|
|
|
|
/* Restore terminal settings form oldterm. */
|
|
void terminal_restore(const struct cmdline *cl);
|
|
|
|
/* Check if a single character can be read from input. */
|
|
int cmdline_poll_char(struct cmdline *cl);
|
|
|
|
/* Read one character from input. */
|
|
ssize_t cmdline_read_char(struct cmdline *cl, char *c);
|
|
|
|
/* vdprintf(3) */
|
|
__rte_format_printf(2, 0)
|
|
int cmdline_vdprintf(int fd, const char *format, va_list op);
|
|
|
|
#endif
|