+static int
+post_check_children_count(struct mdoc *mdoc)
+{
+ struct mdoc_node *n;
+ int i;
+
+ for (i = 0, n = mdoc->last->child; n; n = n->next, i++)
+ /* Do nothing */ ;
+ return(i);
+}
+
+
+static int
+post_check_children_wgt(struct mdoc *mdoc, const char *p, int sz)
+{
+ int i;
+
+ if ((i = post_check_children_count(mdoc)) > sz)
+ return(1);
+ return(mdoc_warn(mdoc, WARN_SYNTAX, "macro suggests more "
+ "than %d %s (has %d)", sz, p, i));
+}
+
+
+static int
+post_check_children_gt(struct mdoc *mdoc, const char *p, int sz)
+{
+ int i;
+
+ if ((i = post_check_children_count(mdoc)) > sz)
+ return(1);
+ return(mdoc_err(mdoc, "macro requires more than %d "
+ "%s (has %d)", sz, p, i));
+}
+
+
+static int
+post_check_children_weq(struct mdoc *mdoc, const char *p, int sz)
+{
+ int i;
+
+ if ((i = post_check_children_count(mdoc)) == sz)
+ return(1);
+ return(mdoc_warn(mdoc, WARN_SYNTAX, "macro suggests %d "
+ "%s (has %d)", sz, p, i));
+}
+
+
+static int
+post_check_children_eq(struct mdoc *mdoc, const char *p, int sz)
+{
+ int i;
+
+ if ((i = post_check_children_count(mdoc)) == sz)
+ return(1);
+ return(mdoc_err(mdoc, "macro requires %d %s "
+ "(have %d)", sz, p, i));
+}
+
+
+static int
+post_check_children_lt(struct mdoc *mdoc, const char *p, int sz)
+{
+ int i;
+
+ if ((i = post_check_children_count(mdoc)) < sz)
+ return(1);
+ return(mdoc_err(mdoc, "macro requires less than %d "
+ "%s (have %d)", sz, p, i));
+}
+
+
+static int
+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]));
+}
+
+