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

Function find_call_args

tests/test_extraction.c:10437–10453  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10435 * ═══════════════════════════════════════════════════════════════════ */
10436
10437static int find_call_args(const CBMFileResult *r, const char *callee, const char **out_arg0,
10438 const char **out_arg1) {
10439 if (out_arg0)
10440 *out_arg0 = NULL;
10441 if (out_arg1)
10442 *out_arg1 = NULL;
10443 for (int i = 0; i < r->calls.count; i++) {
10444 if (strstr(r->calls.items[i].callee_name, callee)) {
10445 if (out_arg0 && r->calls.items[i].arg_count > 0)
10446 *out_arg0 = r->calls.items[i].args[0].expr;
10447 if (out_arg1 && r->calls.items[i].arg_count > 1)
10448 *out_arg1 = r->calls.items[i].args[1].expr;
10449 return r->calls.items[i].arg_count;
10450 }
10451 }
10452 return -1;
10453}
10454
10455/* tree-sitter lists a comment inside an argument list as a named child; it is
10456 * not an argument. A Java constructor call whose argument list opened with a

Callers 1

test_extraction.cFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected