-#define CHECK_CHILD_DEFN(lvl, name, ineq) \
-static int \
-lvl##_child_##name(struct mdoc *mdoc, const char *p, int sz) \
-{ \
- if (mdoc->last->nchild ineq sz) \
- return(1); \
- return(lvl##_count(mdoc, #ineq, sz, p, mdoc->last->nchild)); \
-}
-
-#define CHECK_BODY_DEFN(name, lvl, func, num) \
-static int \
-b##lvl##_##name(POST_ARGS) \
-{ \
- if (MDOC_BODY != mdoc->last->type) \
- return(1); \
- return(func(mdoc, "multi-line arguments", (num))); \
-}
-
-#define CHECK_ELEM_DEFN(name, lvl, func, num) \
-static int \
-e##lvl##_##name(POST_ARGS) \
-{ \
- assert(MDOC_ELEM == mdoc->last->type); \
- return(func(mdoc, "line arguments", (num))); \
-}
-
-#define CHECK_HEAD_DEFN(name, lvl, func, num) \
-static int \
-h##lvl##_##name(POST_ARGS) \
-{ \
- if (MDOC_HEAD != mdoc->last->type) \
- return(1); \
- return(func(mdoc, "line arguments", (num))); \
-}
-
-
-CHECK_CHILD_DEFN(warn, gt, >) /* warn_child_gt() */
-CHECK_CHILD_DEFN(err, gt, >) /* err_child_gt() */
-CHECK_CHILD_DEFN(warn, eq, ==) /* warn_child_eq() */
-CHECK_CHILD_DEFN(err, eq, ==) /* err_child_eq() */
-CHECK_CHILD_DEFN(err, lt, <) /* err_child_lt() */
-CHECK_CHILD_DEFN(warn, lt, <) /* warn_child_lt() */
-CHECK_BODY_DEFN(ge1, warn, warn_child_gt, 0) /* bwarn_ge1() */
-CHECK_BODY_DEFN(ge1, err, err_child_gt, 0) /* berr_ge1() */
-CHECK_ELEM_DEFN(eq0, warn, warn_child_eq, 0) /* ewarn_eq0() */
-CHECK_ELEM_DEFN(ge1, warn, warn_child_gt, 0) /* ewarn_ge1() */
-CHECK_ELEM_DEFN(eq1, err, err_child_eq, 1) /* eerr_eq1() */
-CHECK_ELEM_DEFN(le1, err, err_child_lt, 2) /* eerr_le1() */
-CHECK_ELEM_DEFN(ge1, err, err_child_gt, 0) /* eerr_ge1() */
-CHECK_HEAD_DEFN(eq0, err, err_child_eq, 0) /* herr_eq0() */
-CHECK_HEAD_DEFN(le1, warn, warn_child_lt, 2) /* hwarn_le1() */
-CHECK_HEAD_DEFN(ge1, err, err_child_gt, 0) /* herr_ge1() */
-CHECK_HEAD_DEFN(eq1, warn, warn_child_eq, 1) /* hwarn_eq1() */
-CHECK_HEAD_DEFN(eq0, warn, warn_child_eq, 0) /* hwarn_eq0() */