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

Function cbm_adoc_extract_document

internal/cbm/doc_adoc.c:721–741  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

719}
720
721void cbm_adoc_extract_document(CBMExtractCtx *ctx) {
722 if (!ctx || !ctx->result || !ctx->source || ctx->source_len <= 0) {
723 return;
724 }
725 ad_doc_t d = {.ctx = ctx, .scratch = ctx->scratch ? ctx->scratch : ctx->arena};
726 d.span_buf = (char *)cbm_arena_alloc(d.scratch, (size_t)(AD_SPAN_MAX + 1) * 2);
727 if (!d.span_buf || !ad_lines(&d, ctx->source, ctx->source_len)) {
728 ctx->result->doc_links.failed = true;
729 return;
730 }
731 ad_structure(&d);
732 if (!d.failed) {
733 ad_sections(&d);
734 }
735 if (!d.failed) {
736 ad_tokens(&d);
737 }
738 if (d.failed) {
739 ctx->result->doc_links.failed = true;
740 }
741}
742
743/* ── The Antora scope (antora.yml, antora-playbook*.yml) ─────────── */
744

Callers 1

extract_file_ex_bodyFunction · 0.85

Calls 5

ad_linesFunction · 0.85
ad_structureFunction · 0.85
ad_sectionsFunction · 0.85
ad_tokensFunction · 0.85
cbm_arena_allocFunction · 0.70

Tested by

no test coverage detected