| 2048 | } xo_mapping_t; |
| 2049 | |
| 2050 | static xo_xff_flags_t |
| 2051 | xo_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 |
| 2078 | static const char * |
no test coverage detected