- fclose(stream);
- return;
-
-fail:
- free(line);
- warn("%s: SYSERR: %s", file, syscall);
- if (rc < MANDOCLEVEL_SYSERR)
- rc = MANDOCLEVEL_SYSERR;
-}
-
-static int
-koptions(int *options, char *arg)
-{
-
- 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 void
-moptions(int *options, char *arg)
-{
-
- if (arg == NULL)
- return;
- if (strcmp(arg, "doc") == 0)
- *options |= MPARSE_MDOC;
- else if (strcmp(arg, "an") == 0)
- *options |= MPARSE_MAN;
-}
-
-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->mmin = MANDOCERR_BASE;
- } 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, "markdown"))
- curp->outtype = OUTT_MARKDOWN;
- 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, "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;