MCPcopy Create free account
hub / github.com/F-Stack/f-stack / xo_name_lookup

Function xo_name_lookup

tools/libxo/libxo/libxo.c:2050–2075  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2048} xo_mapping_t;
2049
2050static xo_xff_flags_t
2051xo_name_lookup (xo_mapping_t *map, const char *value, ssize_t len)
2052{
2053 if (len == 0)
2054 return 0;
2055
2056 if (len < 0)
2057 len = strlen(value);
2058
2059 while (isspace((int) *value)) {
2060 value += 1;
2061 len -= 1;
2062 }
2063
2064 while (isspace((int) value[len]))
2065 len -= 1;
2066
2067 if (*value == '\0')
2068 return 0;
2069
2070 for ( ; map->xm_name; map++)
2071 if (strncmp(map->xm_name, value, len) == 0)
2072 return map->xm_value;
2073
2074 return 0;
2075}
2076
2077#ifdef NOT_NEEDED_YET
2078static const char *

Callers 3

xo_name_to_flagFunction · 0.85
xo_set_options_simpleFunction · 0.85
xo_parse_rolesFunction · 0.85

Calls 2

isspaceFunction · 0.85
strncmpFunction · 0.85

Tested by

no test coverage detected