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

Function fl_add

src/discover/discover.c:442–459  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

440}
441
442static void fl_add(file_list_t *fl, const char *abs_path, const char *rel_path, CBMLanguage lang,
443 int64_t size) {
444 if (fl->count >= fl->capacity) {
445 int new_cap = fl->capacity ? fl->capacity * PAIR_LEN : CBM_SZ_256;
446 cbm_file_info_t *new_files = realloc(fl->files, new_cap * sizeof(cbm_file_info_t));
447 if (!new_files) {
448 return;
449 }
450 fl->files = new_files;
451 fl->capacity = new_cap;
452 }
453
454 cbm_file_info_t *fi = &fl->files[fl->count++];
455 fi->path = strdup(abs_path);
456 fi->rel_path = strdup(rel_path);
457 fi->language = lang;
458 fi->size = size;
459}
460
461/* ── Recursive walk ─────────────────────────────── */
462

Callers 1

walk_dir_process_fileFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected