| 719 | } |
| 720 | |
| 721 | void 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 |
no test coverage detected