+pre_check_stdarg(struct mdoc *mdoc, struct mdoc_node *node)
+{
+
+ if (1 == node->data.elem.argc &&
+ MDOC_Std == node->data.elem.argv[0].arg)
+ return(1);
+ return(mdoc_nwarn(mdoc, node, WARN_COMPAT,
+ "macro suggests single `%s' argument",
+ mdoc_argnames[MDOC_Std]));
+}
+
+
+static int
+pre_check_msecs(struct mdoc *mdoc, struct mdoc_node *node,
+ int sz, enum mdoc_msec *msecs)
+{
+ int i;
+
+ for (i = 0; i < sz; i++)
+ if (msecs[i] == mdoc->meta.msec)
+ return(1);
+ return(mdoc_nwarn(mdoc, node, WARN_COMPAT, "macro not "
+ "appropriate for manual section"));
+}
+
+
+static int
+pre_check_parent(struct mdoc *mdoc, struct mdoc_node *node,
+ int tok, enum mdoc_type type)
+{
+
+ if (type != node->parent->type)
+ return(mdoc_nerr(mdoc, node, "invalid macro parent class %s, expected %s",
+ mdoc_type2a(node->parent->type),
+ mdoc_type2a(type)));
+ if (MDOC_ROOT != type && tok != node->parent->tok)
+ return(mdoc_nerr(mdoc, node, "invalid macro parent `%s', expected `%s'",
+ mdoc_macronames[node->parent->tok],
+ mdoc_macronames[tok]));
+ return(1);
+}
+
+
+static int
+bwarn_ge1(struct mdoc *mdoc)
+{
+
+ if (MDOC_BODY != mdoc->last->type)
+ return(1);
+ return(post_check_children_wgt(mdoc, "body children", 0));
+}
+
+
+static int
+ewarn_eq1(struct mdoc *mdoc)
+{
+
+ assert(MDOC_ELEM == mdoc->last->type);
+ return(post_check_children_weq(mdoc, "parameters", 1));
+}
+
+
+static int
+ewarn_eq0(struct mdoc *mdoc)
+{
+
+ assert(MDOC_ELEM == mdoc->last->type);
+ return(post_check_children_weq(mdoc, "parameters", 0));
+}
+
+
+static int
+ewarn_ge1(struct mdoc *mdoc)
+{
+
+ assert(MDOC_ELEM == mdoc->last->type);
+ return(post_check_children_wgt(mdoc, "parameters", 0));
+}
+
+
+static int
+eerr_eq1(struct mdoc *mdoc)
+{
+
+ assert(MDOC_ELEM == mdoc->last->type);
+ return(post_check_children_eq(mdoc, "parameters", 1));
+}
+
+
+static int
+eerr_le2(struct mdoc *mdoc)
+{
+
+ assert(MDOC_ELEM == mdoc->last->type);
+ return(post_check_children_lt(mdoc, "parameters", 3));
+}
+
+
+static int
+eerr_le1(struct mdoc *mdoc)
+{
+
+ assert(MDOC_ELEM == mdoc->last->type);
+ return(post_check_children_lt(mdoc, "parameters", 2));
+}
+
+
+static int
+eerr_eq0(struct mdoc *mdoc)
+{
+
+ assert(MDOC_ELEM == mdoc->last->type);
+ return(post_check_children_eq(mdoc, "parameters", 0));
+}
+
+
+static int
+eerr_ge1(struct mdoc *mdoc)
+{
+
+ assert(MDOC_ELEM == mdoc->last->type);
+ return(post_check_children_gt(mdoc, "parameters", 0));
+}
+
+
+static int
+herr_eq0(struct mdoc *mdoc)