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

Function cbm_list_indexes

src/cli/cli.c:7196–7218  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7194}
7195
7196int cbm_list_indexes(const char *home_dir) {
7197 const char *cache_dir = get_cache_dir(home_dir);
7198 if (!cache_dir) {
7199 return 0;
7200 }
7201
7202 cbm_dir_t *d = cbm_opendir(cache_dir);
7203 if (!d) {
7204 return 0;
7205 }
7206
7207 int count = 0;
7208 cbm_dirent_t *ent;
7209 while ((ent = cbm_readdir(d)) != NULL) {
7210 size_t len = strlen(ent->name);
7211 if (len > DB_EXT_LEN && strcmp(ent->name + len - DB_EXT_LEN, ".db") == 0) {
7212 printf(" %s/%s\n", cache_dir, ent->name);
7213 count++;
7214 }
7215 }
7216 cbm_closedir(d);
7217 return count;
7218}
7219
7220int cbm_remove_indexes(const char *home_dir) {
7221 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