]> cloudbase.mooo.com Git - z180-stamp.git/blob - avr/cli_readline.h
5b25762720cb0ae8f9955fd251bf84b5b1e3841f
[z180-stamp.git] / avr / cli_readline.h
1 /*
2 * (C) Copyright 2014 Google, Inc
3 * Simon Glass <sjg@chromium.org>
4 *
5 * SPDX-License-Identifier: GPL-2.0+
6 */
7
8 #ifndef CLI_READLINE_H
9 #define CLI_READLINE_H
10
11 extern char console_buffer[]; /* console I/O buffer */
12
13 /**
14 * cli_readline() - read a line into the console_buffer
15 *
16 * This is a convenience function which calls cli_readline_into_buffer().
17 *
18 * @prompt: Prompt to display
19 * @return command line length excluding terminator, or -ve on error
20 */
21 int cli_readline(const FLASH char *const prompt);
22
23 /**
24 * readline_into_buffer() - read a line into a buffer
25 *
26 * Display the prompt, then read a command line into @buffer. The
27 * maximum line length is CONFIG_SYS_CBSIZE including a \0 terminator, which
28 * will always be added.
29 *
30 * The command is echoed as it is typed. Command editing is supported if
31 * CONFIG_CMDLINE_EDITING is defined. Tab auto-complete is supported if
32 * CONFIG_AUTO_COMPLETE is defined. If CONFIG_BOOT_RETRY_TIME is defined,
33 * then a timeout will be applied.
34 *
35 * If CONFIG_BOOT_RETRY_TIME is defined and retry_time >= 0,
36 * time out when time goes past endtime (timebase time in ticks).
37 *
38 * @prompt: Prompt to display
39 * @buffer: Place to put the line that is entered
40 * @timeout: Timeout in milliseconds, 0 if none
41 * @return command line length excluding terminator, or -ve on error: of the
42 * timeout is exceeded (either CONFIG_BOOT_RETRY_TIME or the timeout
43 * parameter), then -2 is returned. If a break is detected (Ctrl-C) then
44 * -1 is returned.
45 */
46 //int cli_readline_into_buffer(const char *const prompt, char *buffer, int timeout);
47
48
49 #endif /* CLI_READLINE_H */
50