+ va_list ap;
+ int msec;
+
+ va_start(ap, n);
+ for (;;) {
+ if (0 == (msec = va_arg(ap, int)))
+ break;
+ if (msec != mdoc->meta.msec)
+ continue;
+ va_end(ap);
+ return(1);
+ }
+
+ va_end(ap);
+ return(mdoc_nwarn(mdoc, n, WARN_COMPAT,
+ "inappropriate manual section for macro"));
+}
+
+
+/*
+ * Check over an argument. When this has more stuff in it, make this
+ * into a table-driven function; until then, a switch is fine.
+ */
+static int
+check_argv(struct mdoc *mdoc,
+ const struct mdoc_node *node,
+ const struct mdoc_arg *argv)
+{
+
+
+ switch (argv->arg) {
+ case (MDOC_Std):
+ switch (node->tok) {
+ case (MDOC_Ex):
+ /*
+ * If the -std does not have an argument, then
+ * set it with the default name (if set). This
+ * only happens with MDOC_Ex.
+ */
+ if (1 == argv->sz)
+ return(1);
+ assert(0 == argv->sz);
+ if (mdoc->meta.name)
+ return(1);
+ return(mdoc_nerr(mdoc, node,
+ "default name not yet set"));
+ default:
+ break;
+ }
+ break;
+ default:
+ break;
+ }
+
+ return(1);
+}
+
+
+static int
+check_text(struct mdoc *mdoc, int line, int pos, const char *p)
+{
+ size_t c;
+
+ /* XXX - indicate deprecated escapes \*(xx and \*x. */
+
+ for ( ; *p; p++) {
+ if ( ! isprint((u_char)*p) && '\t' != *p)
+ return(mdoc_perr(mdoc, line, pos,
+ "invalid non-printing characters"));
+ if ('\\' != *p)
+ continue;
+ if ((c = mdoc_isescape(p))) {
+ p += (int)c - 1;
+ continue;
+ }
+ return(mdoc_perr(mdoc, line, pos,
+ "invalid escape sequence"));
+ }
+
+ return(1);
+}
+
+
+
+
+static int
+check_parent(PRE_ARGS, int tok, enum mdoc_type t)
+{
+
+ assert(n->parent);
+ if ((MDOC_ROOT == t || tok == n->parent->tok) &&
+ (t == n->parent->type))
+ return(1);
+
+ return(mdoc_nerr(mdoc, n, "require parent %s",
+ MDOC_ROOT == t ? "<root>" : mdoc_macronames[tok]));
+}
+
+
+
+static int
+pre_display(PRE_ARGS)
+{
+ struct mdoc_node *node;