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

Function handler_candidate_site

tests/test_extraction.c:11592–11623  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11590enum { LABELED_WRAPPERS = 2000 };
11591
11592static int handler_candidate_site(const CBMFileResult *r, uint32_t expect_start,
11593 uint32_t expect_end, const char *form) {
11594 int seen = 0;
11595 int rc = 0;
11596 for (int i = 0; i < r->usages.count; i++) {
11597 const CBMUsage *u = &r->usages.items[i];
11598 if (!u->ref_name) {
11599 continue;
11600 }
11601 if (strcmp(u->ref_name, "cb") == 0) {
11602 printf(" %s argument: the keyword label became a usage\n", form);
11603 rc = 1;
11604 }
11605 if (strcmp(u->ref_name, "handler") != 0) {
11606 continue;
11607 }
11608 seen++;
11609 if (!u->may_be_call_reference || u->site_start_byte != expect_start ||
11610 u->site_end_byte != expect_end) {
11611 printf(" %s argument: handler candidate=%d site %u-%u, expected candidate site "
11612 "%u-%u\n",
11613 form, u->may_be_call_reference ? 1 : 0, u->site_start_byte, u->site_end_byte,
11614 expect_start, expect_end);
11615 rc = 1;
11616 }
11617 }
11618 if (seen != 1) {
11619 printf(" %s argument: %d usages of handler, expected 1\n", form, seen);
11620 rc = 1;
11621 }
11622 return rc;
11623}
11624
11625static int deep_argument_nesting_probe(void) {
11626 const uint32_t attribute_len = (uint32_t)strlen("obj.handler");

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected