COMMAND_PARSE_ADDITIONAL_NUMBER is only used within OpenOCD.
 
Symbols
loading...
Files
loading...
CodeScopeDevelopment ToolsOpenOCDCOMMAND_PARSE_ADDITIONAL_NUMBER

COMMAND_PARSE_ADDITIONAL_NUMBER macro

parses the command argument at position @a argn into @a out as a @a type, or prints a command error referring to @a name_str and passes the error code to the caller. @a argn will be incremented if no error occurred. Otherwise the calling function will return the error code produced by the parsing function. This function may cause the calling function to return immediately, so it should be used carefully to avoid leaking resources. In most situations, parsing should be completed in full before proceeding to allocate resources, and this strategy will most prevents leaks.

Syntax

#define COMMAND_PARSE_ADDITIONAL_NUMBER(type, argn, out, name_str) \     do { \     if (argn+1 >= CMD_ARGC || CMD_ARGV[argn+1][0] == '-') { \     command_print(CMD, "no " name_str " given"); \     return ERROR_FAIL; \     } \     ++argn; \     COMMAND_PARSE_NUMBER(type, CMD_ARGV[argn], out); \     } while (0)

Arguments

type

argn

out

name_str

References

LocationText
command.h:467
#define COMMAND_PARSE_ADDITIONAL_NUMBER(type, argn, out, name_str) \
ipdbg.c:840
COMMAND_PARSE_ADDITIONAL_NUMBER(u16, i, port, "port number");
ipdbg.c:842
COMMAND_PARSE_ADDITIONAL_NUMBER(u8, i, tool, "tool");
ipdbg.c:878
COMMAND_PARSE_ADDITIONAL_NUMBER(u8, i, tool, "tool");
ipdbg.c:935
COMMAND_PARSE_ADDITIONAL_NUMBER(uint, i, size, "size");
ipdbg.c:1050
COMMAND_PARSE_ADDITIONAL_NUMBER(u32, i, user_instruction, "ir_value to select hub");