| 2217 | }; |
| 2218 | |
| 2219 | static void few_scan(const char *key, void *value, void *ud) { |
| 2220 | (void)value; |
| 2221 | struct few_ctx *ctx = ud; |
| 2222 | size_t klen = strlen(key); |
| 2223 | if (klen >= ctx->target_len && strcmp(key + klen - ctx->target_len, ctx->target) == 0) { |
| 2224 | if (ctx->count >= ctx->cap) { |
| 2225 | ctx->cap = ctx->cap ? ctx->cap * PAIR_LEN : REG_INIT_CAP; |
| 2226 | ctx->results = safe_realloc(ctx->results, (size_t)ctx->cap * sizeof(char *)); |
| 2227 | } |
| 2228 | ctx->results[ctx->count++] = key; |
| 2229 | } |
| 2230 | } |
| 2231 | |
| 2232 | int cbm_registry_find_ending_with(const cbm_registry_t *r, const char *suffix, const char ***out) { |
| 2233 | if (!r || !suffix || !out) { |
nothing calls this directly
no test coverage detected