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

Function pod_section_end

internal/cbm/extract_defs.c:2450–2466  ·  view source on GitHub ↗

End byte of the section that cmds[ci] (a =head or =item) opens. */

Source from the content-addressed store, hash-verified

2448
2449/* End byte of the section that cmds[ci] (a =head or =item) opens. */
2450static uint32_t pod_section_end(const pod_cmd_t *cmds, int n, int ci, uint32_t pe) {
2451 const pod_cmd_t *c = &cmds[ci];
2452 for (int j = ci + SKIP_ONE; j < n; j++) {
2453 const pod_cmd_t *d = &cmds[j];
2454 if (d->type == POD_CUT) {
2455 return d->sb;
2456 }
2457 if (d->type == POD_HEAD && (c->type == POD_ITEM || d->level <= c->level)) {
2458 return d->sb;
2459 }
2460 if (c->type == POD_ITEM && (d->type == POD_ITEM || d->type == POD_BACK) &&
2461 d->level == c->level) {
2462 return d->sb;
2463 }
2464 }
2465 return pe;
2466}
2467
2468/* A heading's text with POD formatting codes (X<..>, X<< .. >>) removed and
2469 * newlines and tabs as spaces. */

Callers 1

pod_index_blockFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected