DEFINE_PARSE_LONG(_s16, int16_t, n < INT16_MIN, INT16_MAX)
DEFINE_PARSE_LONG(_s8, int8_t, n < INT8_MIN, INT8_MAX)
-int command_parse_bool(const char *in, bool *out,
+static int command_parse_bool(const char *in, bool *out,
const char *on, const char *off)
{
if (strcasecmp(in, on) == 0)
return ERROR_OK;
}
-int command_parse_bool_any(const char *in, bool *out)
+int command_parse_bool_arg(const char *in, bool *out)
{
if (command_parse_bool(in, out, "on", "off") == ERROR_OK)
return ERROR_OK;
switch (CMD_ARGC) {
case 1: {
const char *in = CMD_ARGV[0];
- if (command_parse_bool_any(in, out) != ERROR_OK)
+ if (command_parse_bool_arg(in, out) != ERROR_OK)
{
LOG_ERROR("%s: argument '%s' is not valid", CMD_NAME, in);
return ERROR_INVALID_ARGUMENTS;
#define COMMAND_PARSE_BOOL(in, out, on, off) \
do { \
bool value; \
- int retval = command_parse_bool(in, &value, on, off); \
+ int retval = command_parse_bool_arg(in, &value); \
if (ERROR_OK != retval) { \
command_print(CMD_CTX, stringify(out) \
" option value ('%s') is not valid", in); \
out = value; \
} while (0)
-int command_parse_bool(const char *in, bool *out,
- const char *on, const char *off);
+int command_parse_bool_arg(const char *in, bool *out);
COMMAND_HELPER(handle_command_parse_bool, bool *out, const char *label);
/// parses an on/off command argument