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

Function cbm_list_indexes

src/cli/cli.c:6314–6336  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6312}
6313
6314int cbm_list_indexes(const char *home_dir) {
6315 const char *cache_dir = get_cache_dir(home_dir);
6316 if (!cache_dir) {
6317 return 0;
6318 }
6319
6320 cbm_dir_t *d = cbm_opendir(cache_dir);
6321 if (!d) {
6322 return 0;
6323 }
6324
6325 int count = 0;
6326 cbm_dirent_t *ent;
6327 while ((ent = cbm_readdir(d)) != NULL) {
6328 size_t len = strlen(ent->name);
6329 if (len > DB_EXT_LEN && strcmp(ent->name + len - DB_EXT_LEN, ".db") == 0) {
6330 printf(" %s/%s\n", cache_dir, ent->name);
6331 count++;
6332 }
6333 }
6334 cbm_closedir(d);
6335 return count;
6336}
6337
6338int cbm_remove_indexes(const char *home_dir) {
6339 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