MCPcopy Create free account
hub / github.com/1a1a11a/libCacheSim / is_true

Function is_true

libCacheSim/bin/cli_reader_utils.c:60–71  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

58}
59
60bool is_true(const char *arg) {
61 if (strcasecmp(arg, "true") == 0 || strcasecmp(arg, "1") == 0 ||
62 strcasecmp(arg, "yes") == 0 || strcasecmp(arg, "y") == 0) {
63 return true;
64 } else if (strcasecmp(arg, "false") == 0 || strcasecmp(arg, "0") == 0 ||
65 strcasecmp(arg, "no") == 0 || strcasecmp(arg, "n") == 0) {
66 return false;
67 } else {
68 ERROR("Invalid value: %s, expect true/false", arg);
69 abort();
70 }
71}
72
73static void _check_parsed_result(char *end, int col_idx) {
74 if (strlen(end) > 2) {

Callers 10

parse_reader_paramsFunction · 0.85
parse_optFunction · 0.85
parse_optFunction · 0.85
parse_optFunction · 0.85
parse_optFunction · 0.85
parse_optFunction · 0.85
parse_optFunction · 0.85
parse_optFunction · 0.85
parse_optFunction · 0.85
parse_optFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected