]>
Commit | Line | Data |
---|---|---|
d684c216 L |
1 | #ifndef CLI_H |
2 | #define CLI_H | |
3 | ||
4 | /** | |
5 | * Go into the command loop | |
6 | * | |
7 | * This will return if we get a timeout waiting for a command, but only for | |
8 | * the simple parser (not hush). See CONFIG_BOOT_RETRY_TIME. | |
9 | */ | |
10 | void cli_loop(void); | |
11 | ||
12 | /** | |
13 | * cli_simple_run_command() - Execute a command with the simple CLI | |
14 | * | |
15 | * @cmd: String containing the command to execute | |
16 | * @flag Flag value - see CMD_FLAG_... | |
17 | * @return 1 - command executed, repeatable | |
18 | * 0 - command executed but not repeatable, interrupted commands are | |
19 | * always considered not repeatable | |
20 | * -1 - not executed (unrecognized, bootd recursion or too many args) | |
21 | * (If cmd is NULL or "" or longer than CONFIG_SYS_CBSIZE-1 it is | |
22 | * considered unrecognized) | |
23 | */ | |
24 | //int cli_simple_run_command(const char *cmd, int flag); | |
25 | ||
26 | /** | |
27 | * cli_simple_run_command_list() - Execute a list of command | |
28 | * | |
29 | * The commands should be separated by ; or \n and will be executed | |
30 | * by the built-in parser. | |
31 | * | |
32 | * This function cannot take a const char * for the command, since if it | |
33 | * finds newlines in the string, it replaces them with \0. | |
34 | * | |
35 | * @param cmd String containing list of commands | |
36 | * @param flag Execution flags (CMD_FLAG_...) | |
37 | * @return 0 on success, or != 0 on error. | |
38 | */ | |
39 | //int cli_simple_run_command_list(char *cmd, int flag); | |
40 | ||
41 | /** | |
42 | * parse_line() - split a command line down into separate arguments | |
43 | * | |
44 | * The argv[] array is filled with pointers into @line, and each argument | |
45 | * is terminated by \0 (i.e. @line is changed in the process unless there | |
46 | * is only one argument). | |
47 | * | |
48 | * #argv is terminated by a NULL after the last argument pointer. | |
49 | * | |
50 | * At most CONFIG_SYS_MAXARGS arguments are permited - if there are more | |
51 | * than that then an error is printed, and this function returns | |
52 | * CONFIG_SYS_MAXARGS, with argv[] set up to that point. | |
53 | * | |
54 | * @line: Command line to parse | |
55 | * @args: Array to hold arguments | |
56 | * @return number of arguments | |
57 | */ | |
58 | //int cli_simple_parse_line(char *line, char *argv[]); | |
59 | ||
60 | int run_command_list(const char *cmd, int len); | |
61 | ||
62 | ||
63 | #endif /* CLI_H */ | |
64 |