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

Function try_include_flag

src/pipeline/pass_compile_commands.c:81–101  ·  view source on GitHub ↗

Try to consume a -I or -isystem include path flag. Returns true if consumed. */

Source from the content-addressed store, hash-verified

79
80/* Try to consume a -I or -isystem include path flag. Returns true if consumed. */
81static bool try_include_flag(cbm_compile_flags_t *f, const char **args, int argc, int *i,
82 const char *directory) {
83 const char *arg = args[*i];
84 if (arg[0] == '-' && arg[CC_FLAG_IDX] == 'I') {
85 const char *path = arg + CC_FLAG_SKIP;
86 if (*path == '\0' && *i + SKIP_ONE < argc) {
87 (*i)++;
88 path = args[*i];
89 }
90 if (path && *path) {
91 f->include_paths[f->include_count++] = resolve_path(path, directory);
92 }
93 return true;
94 }
95 if (strcmp(arg, "-isystem") == 0 && *i + SKIP_ONE < argc) {
96 (*i)++;
97 f->include_paths[f->include_count++] = resolve_path(args[*i], directory);
98 return true;
99 }
100 return false;
101}
102
103/* Try to consume a -D define flag. Returns true if consumed. */
104static bool try_define_flag(cbm_compile_flags_t *f, const char **args, int argc, int *i) {

Callers 1

cbm_extract_flagsFunction · 0.85

Calls 1

resolve_pathFunction · 0.70

Tested by

no test coverage detected