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