enum debug_level debug_level_from_string(const char *log_string) { bool found; enum debug_level log_level; found = debug_level_parse(log_string, &log_level); if (found) { return log_level; } /* Default debug level */ return DEBUG_ERR; }
static bool verify_options_basic(struct test_options *opts) { enum debug_level log_level; bool status; status = debug_level_parse(opts->debugstr, &log_level); if (! status) { fprintf(stderr, "Error: Invalid debug string '%s'\n", opts->debugstr); return false; } DEBUGLEVEL = debug_level_to_int(log_level); return true; }