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

Function dg_links

tests/test_diagrams.c:793–806  ·  view source on GitHub ↗

The doc-link records of one syntax whose source ends in `src` and whose * reference is `raw`. */

Source from the content-addressed store, hash-verified

791/* The doc-link records of one syntax whose source ends in `src` and whose
792 * reference is `raw`. */
793static int dg_links(const CBMFileResult *r, int syntax, const char *src, const char *raw) {
794 int n = 0;
795 size_t sl = strlen(src);
796 for (int i = 0; i < r->doc_links.count; i++) {
797 const CBMDocLink *l = &r->doc_links.items[i];
798 size_t ql = strlen(l->source_qn);
799 n += l->syntax == syntax && ql >= sl && strcmp(l->source_qn + ql - sl, src) == 0 &&
800 strcmp(l->raw, raw) == 0;
801 }
802 if (n != 1) {
803 printf(" link %d %s -> %s: %d found\n", syntax, src, raw, n);
804 }
805 return n;
806}
807
808TEST(diagrams_links) {
809 CBMFileResult *r =

Callers 1

test_diagrams.cFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected