API for registering commands with a CLI shell. More...
Go to the source code of this file.
Typedefs | |
typedef struct CliRegistry | CliRegistry |
Functions | |
CliRegistry * | cli_registry_alloc (void) |
Allocates a CliRegistry . | |
void | cli_registry_free (CliRegistry *registry) |
Frees a CliRegistry . | |
void | cli_registry_add_command (CliRegistry *registry, const char *name, CliCommandFlag flags, CliCommandExecuteCallback callback, void *context) |
Registers a command with the registry. | |
void | cli_registry_add_command_ex (CliRegistry *registry, const char *name, CliCommandFlag flags, CliCommandExecuteCallback callback, void *context, size_t stack_size) |
Registers a command with the registry. | |
void | cli_registry_delete_command (CliRegistry *registry, const char *name) |
Deletes a cli command. | |
void | cli_registry_remove_external_commands (CliRegistry *registry) |
Unregisters all external commands. | |
void | cli_registry_reload_external_commands (CliRegistry *registry, const CliCommandExternalConfig *config) |
Reloads the list of externally available commands. | |
API for registering commands with a CLI shell.
void cli_registry_add_command | ( | CliRegistry * | registry, |
const char * | name, | ||
CliCommandFlag | flags, | ||
CliCommandExecuteCallback | callback, | ||
void * | context ) |
Registers a command with the registry.
Provides less options than the _ex
counterpart.
[in] | registry | Pointer to registry instance |
[in] | name | Command name |
[in] | flags | see CliCommandFlag |
[in] | callback | Callback function |
[in] | context | Custom context |
void cli_registry_add_command_ex | ( | CliRegistry * | registry, |
const char * | name, | ||
CliCommandFlag | flags, | ||
CliCommandExecuteCallback | callback, | ||
void * | context, | ||
size_t | stack_size ) |
Registers a command with the registry.
Provides more options than the non-_ex
counterpart.
[in] | registry | Pointer to registry instance |
[in] | name | Command name |
[in] | flags | see CliCommandFlag |
[in] | callback | Callback function |
[in] | context | Custom context |
[in] | stack_size | Thread stack size |
void cli_registry_delete_command | ( | CliRegistry * | registry, |
const char * | name ) |
Deletes a cli command.
[in] | registry | Pointer to registry instance |
[in] | name | Command name |
void cli_registry_reload_external_commands | ( | CliRegistry * | registry, |
const CliCommandExternalConfig * | config ) |
Reloads the list of externally available commands.
[in] | registry | Pointer to registry instance |
[in] | config | See CliCommandExternalConfig |
void cli_registry_remove_external_commands | ( | CliRegistry * | registry | ) |
Unregisters all external commands.
[in] | registry | Pointer to registry instance |