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

Function walk_dir_process_file

src/discover/discover.c:636–650  ·  view source on GitHub ↗

Process a single regular file entry during directory walk. */

Source from the content-addressed store, hash-verified

634
635/* Process a single regular file entry during directory walk. */
636static void walk_dir_process_file(const char *abs_path, const char *rel_path, const char *name,
637 const cbm_discover_opts_t *opts, const cbm_gitignore_t *gitignore,
638 const cbm_gitignore_t *global_gi,
639 const cbm_gitignore_t *cbmignore, const cbm_gitignore_t *local_gi,
640 const char *local_gi_prefix, off_t size, file_list_t *out) {
641 if (should_skip_file(name, rel_path, opts, gitignore, global_gi, cbmignore, local_gi,
642 local_gi_prefix, size)) {
643 return;
644 }
645 CBMLanguage lang = detect_file_language(name, abs_path);
646 if (lang == CBM_LANG_COUNT) {
647 return;
648 }
649 fl_add(out, abs_path, rel_path, lang, size);
650}
651
652typedef struct {
653 char dir[CBM_SZ_4K];

Callers 1

walk_dir_process_entryFunction · 0.85

Calls 3

should_skip_fileFunction · 0.85
detect_file_languageFunction · 0.85
fl_addFunction · 0.85

Tested by

no test coverage detected