The section a 0-based line is written in (by its title block's first line). */
| 1724 | |
| 1725 | /* The section a 0-based line is written in (by its title block's first line). */ |
| 1726 | static const rst_title_t *rst_section_of(const rst_doc_t *d, int line) { |
| 1727 | int lo = 0; |
| 1728 | int hi = d->ntitles; |
| 1729 | while (lo < hi) { |
| 1730 | int mid = lo + ((hi - lo) / 2); |
| 1731 | if (d->titles[mid].first <= line) { |
| 1732 | lo = mid + 1; |
| 1733 | } else { |
| 1734 | hi = mid; |
| 1735 | } |
| 1736 | } |
| 1737 | return lo > 0 ? &d->titles[lo - 1] : NULL; |
| 1738 | } |
| 1739 | |
| 1740 | void cbm_doclink_rst_scan_file(CBMExtractCtx *ctx) { |
| 1741 | if (!ctx || !ctx->result || !ctx->source || ctx->source_len <= 0) { |
no outgoing calls
no test coverage detected