mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-04-25 03:29:58 -07:00
cli_registry: move from bptree to dict, fix memory leak
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <furi.h>
|
||||
#include <m-bptree.h>
|
||||
#include <m-dict.h>
|
||||
#include "cli_registry.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
@@ -22,19 +22,9 @@ typedef struct {
|
||||
size_t stack_depth;
|
||||
} CliRegistryCommand;
|
||||
|
||||
#define CLI_COMMANDS_TREE_RANK 4
|
||||
DICT_DEF2(CliCommandDict, FuriString*, FURI_STRING_OPLIST, CliRegistryCommand, M_POD_OPLIST);
|
||||
|
||||
// -V:BPTREE_DEF2:1103
|
||||
// -V:BPTREE_DEF2:524
|
||||
BPTREE_DEF2(
|
||||
CliCommandTree,
|
||||
CLI_COMMANDS_TREE_RANK,
|
||||
FuriString*,
|
||||
FURI_STRING_OPLIST,
|
||||
CliRegistryCommand,
|
||||
M_POD_OPLIST);
|
||||
|
||||
#define M_OPL_CliCommandTree_t() BPTREE_OPLIST2(CliCommandTree, FURI_STRING_OPLIST, M_POD_OPLIST)
|
||||
#define M_OPL_CliCommandDict_t() DICT_OPLIST(CliCommandDict, FURI_STRING_OPLIST, M_POD_OPLIST)
|
||||
|
||||
bool cli_registry_get_command(
|
||||
CliRegistry* registry,
|
||||
@@ -48,7 +38,7 @@ void cli_registry_unlock(CliRegistry* registry);
|
||||
/**
|
||||
* @warning Surround calls to this function with `cli_registry_[un]lock`
|
||||
*/
|
||||
CliCommandTree_t* cli_registry_get_commands(CliRegistry* registry);
|
||||
CliCommandDict_t* cli_registry_get_commands(CliRegistry* registry);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user