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

Function c_push

internal/cbm/doclink_c.c:170–192  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

168}
169
170static void c_push(const c_emit_t *em, const char *ref, size_t n, int syntax, uint32_t line) {
171 if (n == 0) {
172 return;
173 }
174 if (n > CBM_DOCLINK_C_REF_MAX) {
175 n = CBM_DOCLINK_C_REF_MAX + SKIP_ONE; /* clipped: the resolver calls it unparseable */
176 }
177 if (c_is_url(ref, n)) {
178 syntax = CBM_DOCLINK_HREF;
179 }
180 char *copy = cbm_arena_strndup(em->ctx->arena, ref, n);
181 if (!copy) {
182 return;
183 }
184 CBMDocLink link = {
185 .source_qn = em->def->qualified_name,
186 .raw = copy,
187 .line = line,
188 .def_line = em->def->start_line,
189 .syntax = (uint16_t)syntax,
190 };
191 cbm_doclinks_push(&em->ctx->result->doc_links, em->ctx->arena, link);
192}
193
194/* Mark the bytes of a line that sit in a code span or a quoted label. */
195static void c_mask(const c_line_t *ln, bool *mask) {

Callers 2

c_refFunction · 0.85
c_see_wordFunction · 0.85

Calls 3

c_is_urlFunction · 0.85
cbm_doclinks_pushFunction · 0.85
cbm_arena_strndupFunction · 0.70

Tested by

no test coverage detected