Lines Matching refs:cli
21 } cli; variable
31 if (cli.num_commands < MAX_COMMANDS) in cli_register_command()
36 for (i = 0; i < cli.num_commands; i++) in cli_register_command()
38 if (cli.commands[i] == command) in cli_register_command()
43 cli.commands[cli.num_commands++] = command; in cli_register_command()
58 while (i < cli.num_commands) in cli_unregister_command()
60 if (cli.commands[i] == command) in cli_unregister_command()
62 cli.num_commands--; in cli_unregister_command()
63 unsigned int remaining_cmds = cli.num_commands - i; in cli_unregister_command()
66 …(void)memmove(&cli.commands[i], &cli.commands[i + 1U], (remaining_cmds * sizeof(struct cli_command… in cli_unregister_command()
68 cli.commands[cli.num_commands] = NULL; in cli_unregister_command()
109 while (i < MAX_COMMANDS && n < cli.num_commands) in lookup_command()
111 if (cli.commands[i]->name == NULL) in lookup_command()
119 if (strncmp(cli.commands[i]->name, name, (size_t)len) == 0) in lookup_command()
121 return cli.commands[i]; in lookup_command()
126 if (strcmp(cli.commands[i]->name, name) == 0) in lookup_command()
128 return cli.commands[i]; in lookup_command()
144 while (i < MAX_COMMANDS && n < cli.num_commands) in help_command()
146 if (cli.commands[i]->name != NULL) in help_command()
148 (void)PRINTF("%s %s\r\n", (char *)cli.commands[i]->name + 5, in help_command()
149 cli.commands[i]->help != NULL ? cli.commands[i]->help : ""); in help_command()