MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / few_scan

Function few_scan

src/pipeline/registry.c:2219–2230  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2217};
2218
2219static 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
2232int cbm_registry_find_ending_with(const cbm_registry_t *r, const char *suffix, const char ***out) {
2233 if (!r || !suffix || !out) {

Callers

nothing calls this directly

Calls 1

safe_reallocFunction · 0.85

Tested by

no test coverage detected