- fclose(stream);
- return(MANDOCLEVEL_OK);
-
-fail:
- fprintf(stderr, "%s: %s: SYSERR: %s: %s",
- progname, file, syscall, strerror(errno));
- return(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 {
- fprintf(stderr, "%s: -K %s: Bad argument\n",
- progname, 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 {
- fprintf(stderr, "%s: -m %s: Bad argument\n",
- progname, 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 {
- fprintf(stderr, "%s: -T %s: Bad argument\n",
- progname, arg);
- return(0);
- }
-
- return(1);