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

Function find_call_in_func

tests/test_extraction.c:5855–5869  ·  view source on GitHub ↗

The call `callee` made inside function `func` (its enclosing QN ends in * ".func"), so one file can hold several calls to the same client. */

Source from the content-addressed store, hash-verified

5853/* The call `callee` made inside function `func` (its enclosing QN ends in
5854 * ".func"), so one file can hold several calls to the same client. */
5855static const CBMCall *find_call_in_func(CBMFileResult *r, const char *callee, const char *func) {
5856 size_t fl = strlen(func);
5857 for (int i = 0; i < r->calls.count; i++) {
5858 const CBMCall *c = &r->calls.items[i];
5859 const char *q = c->enclosing_func_qn;
5860 if (!c->callee_name || strcmp(c->callee_name, callee) != 0 || !q) {
5861 continue;
5862 }
5863 size_t ql = strlen(q);
5864 if (ql > fl && q[ql - fl - 1] == '.' && strcmp(q + ql - fl, func) == 0) {
5865 return c;
5866 }
5867 }
5868 return NULL;
5869}
5870
5871/* The URL a call hands to its client: first_string_arg, or "" when none. */
5872static const char *url_in(CBMFileResult *r, const char *callee, const char *func) {

Callers 3

url_inFunction · 0.85
url_not_claimedFunction · 0.85
test_extraction.cFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected