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

Function cbm_list_indexes

src/cli/cli.c:2629–2651  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2627}
2628
2629int cbm_list_indexes(const char *home_dir) {
2630 const char *cache_dir = get_cache_dir(home_dir);
2631 if (!cache_dir) {
2632 return 0;
2633 }
2634
2635 cbm_dir_t *d = cbm_opendir(cache_dir);
2636 if (!d) {
2637 return 0;
2638 }
2639
2640 int count = 0;
2641 cbm_dirent_t *ent;
2642 while ((ent = cbm_readdir(d)) != NULL) {
2643 size_t len = strlen(ent->name);
2644 if (len > DB_EXT_LEN && strcmp(ent->name + len - DB_EXT_LEN, ".db") == 0) {
2645 printf(" %s/%s\n", cache_dir, ent->name);
2646 count++;
2647 }
2648 }
2649 cbm_closedir(d);
2650 return count;
2651}
2652
2653int cbm_remove_indexes(const char *home_dir) {
2654 const char *cache_dir = get_cache_dir(home_dir);

Callers 3

cbm_cmd_uninstallFunction · 0.85
update_clear_indexesFunction · 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