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

Function mref_range

src/pipeline/doc_links_cs.c:2448–2472  ·  view source on GitHub ↗

[return, *hi): the entity's members named `name`; with `group` >= 0 only * those of that group with exactly the signature `sig`. */

Source from the content-addressed store, hash-verified

2446/* [return, *hi): the entity's members named `name`; with `group` >= 0 only
2447 * those of that group with exactly the signature `sig`. */
2448static int mref_range(const cs_index_t *ix, int ent, const char *name, int group, const char *sig,
2449 int *hi) {
2450 int lo = 0;
2451 int end = ix->nmrefs;
2452 while (lo < end) {
2453 int mid = lo + ((end - lo) / PAIR_LEN);
2454 if (mref_key_cmp(ix, &ix->mrefs[mid], ent, name, group, sig) < 0) {
2455 lo = mid + SKIP_ONE;
2456 } else {
2457 end = mid;
2458 }
2459 }
2460 int a = lo;
2461 end = ix->nmrefs;
2462 while (a < end) {
2463 int mid = a + ((end - a) / PAIR_LEN);
2464 if (mref_key_cmp(ix, &ix->mrefs[mid], ent, name, group, sig) <= 0) {
2465 a = mid + SKIP_ONE;
2466 } else {
2467 end = mid;
2468 }
2469 }
2470 *hi = a;
2471 return lo;
2472}
2473
2474/* ── What an assembly's own parts add to a shared declaration ────── */
2475

Callers 1

mref_spansFunction · 0.85

Calls 1

mref_key_cmpFunction · 0.85

Tested by

no test coverage detected