130 #ifndef BSP430_UTILITY_CLI_H
131 #define BSP430_UTILITY_CLI_H
145 #ifndef configBSP430_CLI_COMMAND_COMPLETION
146 #define configBSP430_CLI_COMMAND_COMPLETION 0
170 #ifndef configBSP430_CLI_COMMAND_COMPLETION_HELPER
171 #define configBSP430_CLI_COMMAND_COMPLETION_HELPER 0
390 const char ** argstrp,
391 size_t * argstr_lenp);
442 #if defined(BSP430_DOXYGEN) \
443 || ((configBSP430_CLI_COMMAND_COMPLETION - 0) \
444 && (configBSP430_CLI_COMMAND_COMPLETION_HELPER - 0))
551 const char * command,
555 const char ** argstrp,
556 size_t * argstr_lenp);
581 const char * command);
607 const char * command,
633 size_t * argstr_lenp,
658 size_t * argstr_lenp,
659 unsigned int * destp);
683 size_t * argstr_lenp,
708 size_t * argstr_lenp,
709 unsigned long * destp);
906 #if defined(BSP430_DOXYGEN) || (BSP430_CONSOLE - 0)
929 #if defined(BSP430_DOXYGEN) || (BSP430_CONSOLE - 0)
931 const char * argstr);
946 #if defined(BSP430_DOXYGEN) || (BSP430_CONSOLE - 0)
977 #if defined(BSP430_DOXYGEN) || ! defined(BSP430_CLI_CONSOLE_BUFFER_SIZE)
978 #define BSP430_CLI_CONSOLE_BUFFER_SIZE 0
1125 const char * candidate);
1151 #if defined(BSP430_DOXYGEN) || (0 < BSP430_CLI_CONSOLE_BUFFER_SIZE)
1173 #if defined(BSP430_DOXYGEN) || (0 < BSP430_CLI_CONSOLE_BUFFER_SIZE)
1209 #if defined(BSP430_DOXYGEN) || (0 < BSP430_CLI_CONSOLE_BUFFER_SIZE)
1264 #if defined(BSP430_DOXYGEN) || (configBSP430_CLI_COMMAND_COMPLETION - 0)
1268 #ifndef BSP430_CLI_CONSOLE_BUFFER_MAX_COMPLETIONS
1276 #define BSP430_CLI_CONSOLE_BUFFER_MAX_COMPLETIONS 5
1306 #if defined(BSP430_DOXYGEN) || (configBSP430_CLI_COMMAND_COMPLETION - 0)
1308 const char ** commandp);
void vBSP430cliCompletionHelperCallback(sBSP430cliCompletionData *cdp, const char *candidate)
const char * command
Definition: cli.h:1073
int iBSP430cliHandlerStoreL(struct sBSP430cliCommandLink *chain, void *param, const char *argstr, size_t argstr_len)
int iBSP430cliParseCommand(const sBSP430cliCommand *cmds, void *param, const char *command, iBSP430cliHandlerFunction chain_handler, iBSP430cliHandlerFunction handler)
size_t ncandidates
Definition: cli.h:1097
struct sBSP430cliMatchCallback sBSP430cliMatchCallback
struct sBSP430cliCommandLink * link
Definition: cli.h:251
vBSP430cliCompletionHelper helper
Definition: cli.h:306
int iBSP430cliStoreExtractedI(const char **argstrp, size_t *argstr_lenp, int *destp)
eBSP430cliConsole
Definition: cli.h:985
const struct sBSP430cliCommand * command_set
Definition: cli.h:254
int iBSP430cliStoreExtractedL(const char **argstrp, size_t *argstr_lenp, long *destp)
sBSP430cliCompletionHelper completion_helper
Definition: cli.h:324
size_t command_len
Definition: cli.h:1076
eBSP430cliErrorType
Definition: cli.h:821
Common header included by all BSP430 leaf headers.
int iBSP430cliConsoleBufferExtend(const char *text, size_t len)
iBSP430cliSimpleHandler const simple_handler
Definition: cli.h:486
struct sBSP430cliCompletionHelper sBSP430cliCompletionHelper
size_t append_len
Definition: cli.h:1108
int iBSP430cliNullDiagnostic(sBSP430cliCommandLink *chain, enum eBSP430cliErrorType errtype, const char *argstr, size_t argstr_len)
int iBSP430cliHandlerSimple(sBSP430cliCommandLink *chain, void *param, const char *argstr, size_t argstr_len)
iBSP430cliHandlerFunction const handler
Definition: cli.h:469
void vBSP430cliConsoleDisplayHelp(const sBSP430cliCommand *cmd)
void(* callback)(struct sBSP430cliMatchCallback *self, const sBSP430cliCommand *cmd)
Definition: cli.h:501
int iBSP430cliHandlerStoreI(struct sBSP430cliCommandLink *chain, void *param, const char *argstr, size_t argstr_len)
const char ** returned_candidates
Definition: cli.h:1090
int iBSP430cliConsoleDiagnostic(sBSP430cliCommandLink *chain, enum eBSP430cliErrorType errtype, const char *argstr, size_t argstr_len)
int iBSP430cliConsoleBufferProcessInput(void)
int iBSP430cliStoreExtractedUI(const char **argstrp, size_t *argstr_lenp, unsigned int *destp)
int(* iBSP430cliHandlerFunction)(struct sBSP430cliCommandLink *chain, void *param, const char *argstr, size_t argstr_len)
Definition: cli.h:403
const char * append
Definition: cli.h:1103
const struct sBSP430cliCommand *const next
Definition: cli.h:465
struct sBSP430cliCompletionHelperStrings sBSP430cliCompletionHelperStrings
const sBSP430cliCompletionHelper * completion_helper
Definition: cli.h:448
int iBSP430cliStoreExtractedUL(const char **argstrp, size_t *argstr_lenp, unsigned long *destp)
struct sBSP430cliCommandLink sBSP430cliCommandLink
void vBSP430cliSetDiagnosticFunction(iBSP430cliDiagnosticFunction diagnostic_function)
void vBSP430cliConsoleBufferClear(void)
const char *const * strings
Definition: cli.h:330
int iBSP430cliExecuteCommand(const sBSP430cliCommand *cmds, void *param, const char *command)
int iBSP430cliHandlerStoreUI(struct sBSP430cliCommandLink *chain, void *param, const char *argstr, size_t argstr_len)
union sBSP430cliCommand::uParam param
const struct sBSP430cliCommand *const child
Definition: cli.h:459
struct sBSP430cliCompletionData sBSP430cliCompletionData
void *const ptr
Definition: cli.h:481
int iBSP430cliHandlerStoreUL(struct sBSP430cliCommandLink *chain, void *param, const char *argstr, size_t argstr_len)
int(* iBSP430cliDiagnosticFunction)(sBSP430cliCommandLink *chain, enum eBSP430cliErrorType errtype, const char *argstr, size_t argstr_len)
Definition: cli.h:870
const char * help
Definition: cli.h:440
const char * xBSP430cliNextToken(const char **commandp, size_t *remainingp, size_t *lenp)
int(* iBSP430cliSimpleHandler)(const char *argstr)
Definition: cli.h:418
int iBSP430cliConsoleBufferCompletion(const sBSP430cliCommand *command_set, const char **commandp)
int iBSP430cliCommandCompletion(sBSP430cliCompletionData *cdp)
struct sBSP430cliCommand sBSP430cliCommand
sBSP430cliCommandLink * xBSP430cliReverseChain(sBSP430cliCommandLink *chain)
void(* vBSP430cliCompletionHelper)(const struct sBSP430cliCompletionHelper *self, const char *argstr, size_t argstr_len, struct sBSP430cliCompletionData *cdp)
Definition: cli.h:285
int iBSP430cliConsoleBufferConsumeEscape(int flags)
const struct sBSP430cliCommand * cmd
Definition: cli.h:258
const sBSP430cliCommand * command_set
Definition: cli.h:1083
const char * key
Definition: cli.h:430
void vBSP430cliConsoleDisplayChain(struct sBSP430cliCommandLink *chain, const char *argstr)
int iBSP430cliMatchCommand(const sBSP430cliCommand *cmds, const char *command, size_t command_len, const sBSP430cliCommand **matchp, sBSP430cliMatchCallback *match_callback, const char **argstrp, size_t *argstr_lenp)
void vBSP430cliCompletionHelperStrings(const struct sBSP430cliCompletionHelper *self, const char *argstr, size_t argstr_len, struct sBSP430cliCompletionData *cdp)
size_t len
Definition: cli.h:333
const char * xBSP430cliConsoleBuffer(void)
const char *const * xBSP430cliHelperStringsExtract(const struct sBSP430cliCompletionHelperStrings *chsp, const char **argstrp, size_t *argstr_lenp)
const char * xBSP430cliNextQToken(const char **commandp, size_t *remainingp, size_t *lenp)
size_t max_returned_candidates
Definition: cli.h:1094