+ if ( ! strcmp(arg, "utf-8")) {
+ *options |= MPARSE_UTF8;
+ *options &= ~MPARSE_LATIN1;
+ } else if ( ! strcmp(arg, "iso-8859-1")) {
+ *options |= MPARSE_LATIN1;
+ *options &= ~MPARSE_UTF8;
+ } else if ( ! strcmp(arg, "us-ascii")) {
+ *options &= ~(MPARSE_UTF8 | MPARSE_LATIN1);
+ } else {
+ warnx("-K %s: Bad argument", arg);
+ return 0;
+ }
+ return 1;
+}
+
+static int
+moptions(int *options, char *arg)
+{
+
+ if (arg == NULL)
+ /* nothing to do */;
+ else if (0 == strcmp(arg, "doc"))
+ *options |= MPARSE_MDOC;
+ else if (0 == strcmp(arg, "andoc"))
+ /* nothing to do */;
+ else if (0 == strcmp(arg, "an"))
+ *options |= MPARSE_MAN;
+ else {
+ warnx("-m %s: Bad argument", arg);
+ return 0;
+ }
+
+ return 1;
+}
+
+static int
+toptions(struct curparse *curp, char *arg)
+{
+
+ if (0 == strcmp(arg, "ascii"))
+ curp->outtype = OUTT_ASCII;
+ else if (0 == strcmp(arg, "lint")) {
+ curp->outtype = OUTT_LINT;
+ curp->wlevel = MANDOCLEVEL_WARNING;
+ } else if (0 == strcmp(arg, "tree"))
+ curp->outtype = OUTT_TREE;
+ else if (0 == strcmp(arg, "man"))
+ curp->outtype = OUTT_MAN;
+ else if (0 == strcmp(arg, "html"))
+ curp->outtype = OUTT_HTML;
+ else if (0 == strcmp(arg, "utf8"))
+ curp->outtype = OUTT_UTF8;
+ else if (0 == strcmp(arg, "locale"))
+ curp->outtype = OUTT_LOCALE;
+ else if (0 == strcmp(arg, "xhtml"))
+ curp->outtype = OUTT_HTML;
+ else if (0 == strcmp(arg, "ps"))
+ curp->outtype = OUTT_PS;
+ else if (0 == strcmp(arg, "pdf"))
+ curp->outtype = OUTT_PDF;
+ else {
+ warnx("-T %s: Bad argument", arg);
+ return 0;
+ }
+
+ return 1;
+}
+
+static int
+woptions(struct curparse *curp, char *arg)
+{
+ char *v, *o;
+ const char *toks[7];