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

Function cbm_list_indexes

src/cli/cli.c:7328–7349  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7326}
7327
7328int cbm_list_indexes(const char *home_dir) {
7329 const char *cache_dir = get_cache_dir(home_dir);
7330 if (!cache_dir) {
7331 return 0;
7332 }
7333
7334 cbm_dir_t *d = cbm_opendir(cache_dir);
7335 if (!d) {
7336 return 0;
7337 }
7338
7339 int count = 0;
7340 cbm_dirent_t *ent;
7341 while ((ent = cbm_readdir(d)) != NULL) {
7342 if (cbm_is_project_index_db(ent->name)) {
7343 printf(" %s/%s\n", cache_dir, ent->name);
7344 count++;
7345 }
7346 }
7347 cbm_closedir(d);
7348 return count;
7349}
7350
7351int cbm_remove_indexes(const char *home_dir) {
7352 const char *cache_dir = get_cache_dir(home_dir);

Calls 5

get_cache_dirFunction · 0.85
cbm_opendirFunction · 0.85
cbm_readdirFunction · 0.85
cbm_is_project_index_dbFunction · 0.85
cbm_closedirFunction · 0.85

Tested by

no test coverage detected