- if ( ! man_valid_post(m))
- return(0);
- if ( ! man_action_post(m))
- return(0);
-
- m->next = MAN_ROOT == m->last->type ?
- MAN_NEXT_CHILD : MAN_NEXT_SIBLING;
-
- return(1);
-}
-
-
-static enum rew
-rew_block(enum mant ntok, enum man_type type, const struct man_node *n)
-{
-
- if (MAN_BLOCK == type && ntok == n->parent->tok &&
- MAN_BODY == n->parent->type)
- return(REW_REWIND);
- return(ntok == n->tok ? REW_HALT : REW_NOHALT);
-}
-
-
-/*
- * There are three scope levels: scoped to the root (all), scoped to the
- * section (all less sections), and scoped to subsections (all less
- * sections and subsections).
- */
-static enum rew
-rew_dohalt(enum mant tok, enum man_type type, const struct man_node *n)
-{
- enum rew c;
-
- if (MAN_ROOT == n->type)
- return(REW_HALT);
- assert(n->parent);
- if (MAN_ROOT == n->parent->type)
- return(REW_REWIND);
- if (MAN_VALID & n->flags)
- return(REW_NOHALT);
-
- /* Rewind to ourselves, first. */
- if (type == n->type && tok == n->tok)
- return(REW_REWIND);
-
- switch (tok) {
- case (MAN_SH):
- break;
- case (MAN_SS):
- /* Rewind to a section, if a block. */
- if (REW_NOHALT != (c = rew_block(MAN_SH, type, n)))
- return(c);
- break;
- case (MAN_RS):
- /* Rewind to a subsection, if a block. */
- if (REW_NOHALT != (c = rew_block(MAN_SS, type, n)))
- return(c);
- /* Rewind to a section, if a block. */
- if (REW_NOHALT != (c = rew_block(MAN_SH, type, n)))
- return(c);
- break;
- default:
- /* Rewind to an offsetter, if a block. */
- if (REW_NOHALT != (c = rew_block(MAN_RS, type, n)))
- return(c);
- /* Rewind to a subsection, if a block. */
- if (REW_NOHALT != (c = rew_block(MAN_SS, type, n)))
- return(c);
- /* Rewind to a section, if a block. */
- if (REW_NOHALT != (c = rew_block(MAN_SH, type, n)))
- return(c);
- break;
- }