| 157 | } |
| 158 | |
| 159 | static const char *pr_lower(pr_index_t *ix, const char *s, size_t n) { |
| 160 | char *c = cbm_arena_strndup(&ix->arena, s, n); |
| 161 | if (!c) { |
| 162 | ix->oom = true; |
| 163 | return NULL; |
| 164 | } |
| 165 | for (size_t i = 0; i < n; i++) { |
| 166 | c[i] = (char)tolower((unsigned char)c[i]); |
| 167 | } |
| 168 | return c; |
| 169 | } |
| 170 | |
| 171 | /* Room for one more item in a growing arena array. */ |
| 172 | static bool pr_grow(pr_index_t *ix, void **items, int count, int *cap, size_t size) { |
no test coverage detected