=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/mandoc/html.c,v retrieving revision 1.55 retrieving revision 1.56 diff -c -r1.55 -r1.56 *** src/usr.bin/mandoc/html.c 2015/01/21 20:20:49 1.55 --- src/usr.bin/mandoc/html.c 2015/03/27 21:17:16 1.56 *************** *** 1,4 **** ! /* $OpenBSD: html.c,v 1.55 2015/01/21 20:20:49 schwarze Exp $ */ /* * Copyright (c) 2008-2011, 2014 Kristaps Dzonsons * Copyright (c) 2011-2015 Ingo Schwarze --- 1,4 ---- ! /* $OpenBSD: html.c,v 1.56 2015/03/27 21:17:16 schwarze Exp $ */ /* * Copyright (c) 2008-2011, 2014 Kristaps Dzonsons * Copyright (c) 2011-2015 Ingo Schwarze *************** *** 7,15 **** * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * ! * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF ! * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF --- 7,15 ---- * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * ! * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHORS DISCLAIM ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF ! * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF *************** *** 30,35 **** --- 30,36 ---- #include "mandoc_aux.h" #include "out.h" #include "html.h" + #include "manconf.h" #include "main.h" struct htmldata { *************** *** 127,166 **** void * ! html_alloc(const struct mchars *mchars, char *outopts) { struct html *h; - const char *toks[5]; - char *v; - toks[0] = "style"; - toks[1] = "man"; - toks[2] = "includes"; - toks[3] = "fragment"; - toks[4] = NULL; - h = mandoc_calloc(1, sizeof(struct html)); h->tags.head = NULL; h->symtab = mchars; ! while (outopts && *outopts) ! switch (getsubopt(&outopts, UNCONST(toks), &v)) { ! case 0: ! h->style = v; ! break; ! case 1: ! h->base_man = v; ! break; ! case 2: ! h->base_includes = v; ! break; ! case 3: ! h->oflags |= HTML_FRAGMENT; ! break; ! default: ! break; ! } return(h); } --- 128,147 ---- void * ! html_alloc(const struct mchars *mchars, const struct manoutput *outopts) { struct html *h; h = mandoc_calloc(1, sizeof(struct html)); h->tags.head = NULL; h->symtab = mchars; ! h->style = outopts->style; ! h->base_man = outopts->man; ! h->base_includes = outopts->includes; ! if (outopts->fragment) ! h->oflags |= HTML_FRAGMENT; return(h); }