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

Function cbm_list_indexes

src/cli/cli.c:6376–6398  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6374}
6375
6376int cbm_list_indexes(const char *home_dir) {
6377 const char *cache_dir = get_cache_dir(home_dir);
6378 if (!cache_dir) {
6379 return 0;
6380 }
6381
6382 cbm_dir_t *d = cbm_opendir(cache_dir);
6383 if (!d) {
6384 return 0;
6385 }
6386
6387 int count = 0;
6388 cbm_dirent_t *ent;
6389 while ((ent = cbm_readdir(d)) != NULL) {
6390 size_t len = strlen(ent->name);
6391 if (len > DB_EXT_LEN && strcmp(ent->name + len - DB_EXT_LEN, ".db") == 0) {
6392 printf(" %s/%s\n", cache_dir, ent->name);
6393 count++;
6394 }
6395 }
6396 cbm_closedir(d);
6397 return count;
6398}
6399
6400int cbm_remove_indexes(const char *home_dir) {
6401 const char *cache_dir = get_cache_dir(home_dir);

Callers 3

cbm_cmd_uninstallFunction · 0.85

Calls 4

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

Tested by

no test coverage detected