-extern char *__progname;
-
-extern void *ascii_alloc(void);
-extern void *latin1_alloc(void);
-extern void *utf8_alloc(void);
-extern int terminal_run(void *, const struct mdoc *);
-extern int tree_run(void *, const struct mdoc *);
-extern void terminal_free(void *);
-
-__dead static void version(void);
-__dead static void usage(void);
-static int foptions(int *, char *);
-static int toptions(enum outt *, char *);
-static int woptions(int *, char *);
-static int merr(void *, int, int, const char *);
-static int mwarn(void *, int, int,
- enum mdoc_warn, const char *);
-static int file(char **, size_t *, char **, size_t *,
- const char *, struct mdoc *);
-static int fdesc(char **, size_t *, char **, size_t *,
- const char *, int, struct mdoc *);
+static const char * const mandocerrs[MANDOCERR_MAX] = {
+ "ok",
+
+ "generic warning",
+
+ ".so is fragile, better use ln(1)",
+ "text should be uppercase",
+ "sections out of conventional order",
+ "section name repeats",
+ "out of order prologue",
+ "repeated prologue entry",
+ "list type must come first",
+ "tab in non-literal context",
+ "bad escape sequence",
+ "unterminated quoted string",
+ "argument requires the width argument",
+ "superfluous width argument",
+ "bad date argument",
+ "bad width argument",
+ "unknown manual section",
+ "section not in conventional manual section",
+ "end of line whitespace",
+ "blocks badly nested",
+
+ "generic error",
+
+ "NAME section must come first",
+ "bad Boolean value",
+ "child violates parent syntax",
+ "bad AT&T symbol",
+ "bad standard",
+ "list type repeated",
+ "display type repeated",
+ "argument repeated",
+ "ignoring argument",
+ "manual name not yet set",
+ "obsolete macro ignored",
+ "empty macro ignored",
+ "macro not allowed in body",
+ "macro not allowed in prologue",
+ "bad character",
+ "bad NAME section contents",
+ "no blank lines",
+ "no text in this context",
+ "bad comment style",
+ "unknown macro will be lost",
+ "NOT IMPLEMENTED: skipping request",
+ "line scope broken",
+ "argument count wrong",
+ "request scope close w/none open",
+ "scope already open",
+ "scope open on exit",
+ "macro requires line argument(s)",
+ "macro requires body argument(s)",
+ "macro requires argument(s)",
+ "no title in document",
+ "missing list type",
+ "missing display type",
+ "missing font type",
+ "line argument(s) will be lost",
+ "body argument(s) will be lost",
+ "paragraph macro ignored",
+
+ "generic fatal error",
+
+ "column syntax is inconsistent",
+ "displays may not be nested",
+ "unsupported display type",
+ "blocks badly nested",
+ "no such block is open",
+ "line scope broken, syntax violated",
+ "argument count wrong, violates syntax",
+ "child violates parent syntax",
+ "argument count wrong, violates syntax",
+ "NOT IMPLEMENTED: .so with absolute path or \"..\"",
+ "no document body",
+ "no document prologue",
+ "utsname system call failed",
+ "static buffer exhausted",
+};