Loading...
Searching...
No Matches
cli_registry_i.h
Go to the documentation of this file.
1
6#pragma once
7
8#include <furi.h>
9#include <m-dict.h>
10#include "cli_registry.h"
11
12#ifdef __cplusplus
13extern "C" {
14#endif
15
16#define CLI_BUILTIN_COMMAND_STACK_SIZE (4 * 1024U)
17
18typedef struct {
19 void* context; //<! Context passed to callbacks
20 CliCommandExecuteCallback execute_callback; //<! Callback for command execution
21 CliCommandFlag flags;
22 size_t stack_depth;
24
25DICT_DEF2(CliCommandDict, FuriString*, FURI_STRING_OPLIST, CliRegistryCommand, M_POD_OPLIST);
26
27#define M_OPL_CliCommandDict_t() DICT_OPLIST(CliCommandDict, FURI_STRING_OPLIST, M_POD_OPLIST)
28
29bool cli_registry_get_command(
30 CliRegistry* registry,
31 FuriString* command,
32 CliRegistryCommand* result);
33
34void cli_registry_lock(CliRegistry* registry);
35
36void cli_registry_unlock(CliRegistry* registry);
37
41CliCommandDict_t* cli_registry_get_commands(CliRegistry* registry);
42
43#ifdef __cplusplus
44}
45#endif
CliCommandFlag
Definition cli_command.h:18
void(* CliCommandExecuteCallback)(PipeSide *pipe, FuriString *args, void *context)
CLI command execution callback pointer.
Definition cli_command.h:47
API for registering commands with a CLI shell.
CliCommandDict_t * cli_registry_get_commands(CliRegistry *registry)
Definition cli_registry.c:173
#define FURI_STRING_OPLIST
OPLIST for FuriString.
Definition string.h:778
Definition cli_registry_i.h:18
Definition cli_registry.c:8
Definition string.c:4