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

Function cbm_list_indexes

src/cli/cli.c:6540–6562  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6538}
6539
6540int cbm_list_indexes(const char *home_dir) {
6541 const char *cache_dir = get_cache_dir(home_dir);
6542 if (!cache_dir) {
6543 return 0;
6544 }
6545
6546 cbm_dir_t *d = cbm_opendir(cache_dir);
6547 if (!d) {
6548 return 0;
6549 }
6550
6551 int count = 0;
6552 cbm_dirent_t *ent;
6553 while ((ent = cbm_readdir(d)) != NULL) {
6554 size_t len = strlen(ent->name);
6555 if (len > DB_EXT_LEN && strcmp(ent->name + len - DB_EXT_LEN, ".db") == 0) {
6556 printf(" %s/%s\n", cache_dir, ent->name);
6557 count++;
6558 }
6559 }
6560 cbm_closedir(d);
6561 return count;
6562}
6563
6564int cbm_remove_indexes(const char *home_dir) {
6565 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