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

Function pr_out

src/pipeline/doc_links_php.c:882–912  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

880/* ── Outcomes ────────────────────────────────────────────────────── */
881
882static void pr_out(const pr_ctx_t *c, pr_res_t r, cbm_doclink_outcome_t *out) {
883 switch (r.kind) {
884 case PR_NODE: {
885 const pr_file_t *src = &c->ix->files[c->src];
886 void *v = r.node->file_path ? cbm_ht_get(c->ix->by_path, r.node->file_path) : NULL;
887 int tf = v ? (int)((uintptr_t)v - SKIP_ONE) : CBM_NOT_FOUND;
888 if (tf >= 0 && c->ix->files[tf].test && !src->test) {
889 out->kind = CBM_DOCLINK_UNRESOLVED;
890 out->reason = CBM_DOCLINK_REASON_TEST_ONLY;
891 return;
892 }
893 out->kind = CBM_DOCLINK_EDGE;
894 out->target = r.node;
895 out->exact = r.exact;
896 return;
897 }
898 case PR_EXTERNAL:
899 out->reason = CBM_DOCLINK_REASON_EXTERNAL;
900 break;
901 case PR_AMBIGUOUS:
902 out->reason = CBM_DOCLINK_REASON_AMBIGUOUS;
903 break;
904 case PR_GAP:
905 out->reason = CBM_DOCLINK_REASON_GRAPH_GAP;
906 break;
907 default:
908 out->reason = CBM_DOCLINK_REASON_MISSING;
909 break;
910 }
911 out->kind = CBM_DOCLINK_UNRESOLVED;
912}
913
914static void pr_resolve(const void *index, void *state, int run_file, const CBMDocLink *link,
915 const cbm_gbuf_t *graph, cbm_doclink_outcome_t *out) {

Callers 1

pr_resolveFunction · 0.85

Calls 1

cbm_ht_getFunction · 0.85

Tested by

no test coverage detected