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

Function cbm_list_indexes

src/cli/cli.c:6320–6342  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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