Lines Matching refs:curp
119 struct curparse curp; in main() local
172 memset(&curp, 0, sizeof(struct curparse)); in main()
173 curp.outtype = OUTT_LOCALE; in main()
174 curp.wlevel = MANDOCLEVEL_BADARG; in main()
199 (void)strlcat(curp.outopts, "synopsis,", BUFSIZ); in main()
241 (void)strlcat(curp.outopts, optarg, BUFSIZ); in main()
242 (void)strlcat(curp.outopts, ",", BUFSIZ); in main()
251 if ( ! toptions(&curp, optarg)) in main()
255 if ( ! woptions(&curp, optarg)) in main()
410 curp.mchars = mchars_alloc(); in main()
411 curp.mp = mparse_alloc(options, curp.wlevel, mmsg, in main()
412 curp.mchars, defos); in main()
417 if (OUTT_MAN == curp.outtype) in main()
418 mparse_keep(curp.mp); in main()
423 parse(&curp, STDIN_FILENO, "<stdin>", &rc); in main()
427 rctmp = mparse_open(curp.mp, &fd, in main()
437 parse(&curp, fd, *argv, &rc); in main()
441 parse(&curp, fd, resp->file, &rc); in main()
449 rctmp = mparse_wait(curp.mp); in main()
453 if (argc > 1 && curp.outtype <= OUTT_UTF8) in main()
454 ascii_sepline(curp.outdata); in main()
457 if (MANDOCLEVEL_OK != rc && curp.wstop) in main()
465 mparse_reset(curp.mp); in main()
468 if (curp.outfree) in main()
469 (*curp.outfree)(curp.outdata); in main()
470 mparse_free(curp.mp); in main()
471 mchars_free(curp.mchars); in main()
632 parse(struct curparse *curp, int fd, const char *file, in parse() argument
644 rc = mparse_readfd(curp->mp, fd, file); in parse()
651 if (MANDOCLEVEL_OK != rc && curp->wstop) in parse()
656 if ( ! (curp->outman && curp->outmdoc)) { in parse()
657 switch (curp->outtype) { in parse()
659 curp->outdata = html_alloc(curp->mchars, in parse()
660 curp->outopts); in parse()
661 curp->outfree = html_free; in parse()
664 curp->outdata = utf8_alloc(curp->mchars, in parse()
665 curp->outopts); in parse()
666 curp->outfree = ascii_free; in parse()
669 curp->outdata = locale_alloc(curp->mchars, in parse()
670 curp->outopts); in parse()
671 curp->outfree = ascii_free; in parse()
674 curp->outdata = ascii_alloc(curp->mchars, in parse()
675 curp->outopts); in parse()
676 curp->outfree = ascii_free; in parse()
679 curp->outdata = pdf_alloc(curp->mchars, in parse()
680 curp->outopts); in parse()
681 curp->outfree = pspdf_free; in parse()
684 curp->outdata = ps_alloc(curp->mchars, in parse()
685 curp->outopts); in parse()
686 curp->outfree = pspdf_free; in parse()
692 switch (curp->outtype) { in parse()
694 curp->outman = html_man; in parse()
695 curp->outmdoc = html_mdoc; in parse()
698 curp->outman = tree_man; in parse()
699 curp->outmdoc = tree_mdoc; in parse()
702 curp->outmdoc = man_mdoc; in parse()
703 curp->outman = man_man; in parse()
714 curp->outman = terminal_man; in parse()
715 curp->outmdoc = terminal_mdoc; in parse()
722 mparse_result(curp->mp, &mdoc, &man, NULL); in parse()
726 if (man && curp->outman) in parse()
727 (*curp->outman)(curp->outdata, man); in parse()
728 if (mdoc && curp->outmdoc) in parse()
729 (*curp->outmdoc)(curp->outdata, mdoc); in parse()
844 toptions(struct curparse *curp, char *arg) in toptions() argument
848 curp->outtype = OUTT_ASCII; in toptions()
850 curp->outtype = OUTT_LINT; in toptions()
851 curp->wlevel = MANDOCLEVEL_WARNING; in toptions()
853 curp->outtype = OUTT_TREE; in toptions()
855 curp->outtype = OUTT_MAN; in toptions()
857 curp->outtype = OUTT_HTML; in toptions()
859 curp->outtype = OUTT_UTF8; in toptions()
861 curp->outtype = OUTT_LOCALE; in toptions()
863 curp->outtype = OUTT_HTML; in toptions()
865 curp->outtype = OUTT_PS; in toptions()
867 curp->outtype = OUTT_PDF; in toptions()
878 woptions(struct curparse *curp, char *arg) in woptions() argument
895 curp->wstop = 1; in woptions()
900 curp->wlevel = MANDOCLEVEL_WARNING; in woptions()
903 curp->wlevel = MANDOCLEVEL_ERROR; in woptions()
906 curp->wlevel = MANDOCLEVEL_UNSUPP; in woptions()
909 curp->wlevel = MANDOCLEVEL_BADARG; in woptions()