- if (vol >= ROFF_ARCH_START) {
- switch (msec) {
- case(ROFF_MSEC_1):
- /* FALLTHROUGH */
- case(ROFF_MSEC_6):
- /* FALLTHROUGH */
- case(ROFF_MSEC_7):
- bvol = ROFF_VOL_URM;
- break;
- case(ROFF_MSEC_2):
- /* FALLTHROUGH */
- case(ROFF_MSEC_3):
- /* FALLTHROUGH */
- case(ROFF_MSEC_3p):
- /* FALLTHROUGH */
- case(ROFF_MSEC_4):
- /* FALLTHROUGH */
- case(ROFF_MSEC_5):
- bvol = ROFF_VOL_PRM;
- break;
- case(ROFF_MSEC_8):
- bvol = ROFF_VOL_PRM;
- break;
- case(ROFF_MSEC_9):
- bvol = ROFF_VOL_KM;
- break;
- case(ROFF_MSEC_UNASS):
- /* FALLTHROUGH */
- case(ROFF_MSEC_DRAFT):
- /* FALLTHROUGH */
- case(ROFF_MSEC_PAPER):
- bvol = ROFF_VOL_NONE;
- break;
- default:
- abort();
- /* NOTREACHED */
- }
-
- (void)snprintf(title, sizeof(title), "%s (%s)",
- roff_volname(bvol), roff_volname(vol));
- } else
- (void)snprintf(title, sizeof(title), "%s", roff_volname(vol));
-
-
- i = 0;
-
- if ( ! html_typeput(p->mbuf, HTML_TYPE_4_01_STRICT, NULL))
- return(0);
- if ( ! html_tputln(p->mbuf, ML_OPEN, i, HTML_TAG_HTML))
- return(0);
- if ( ! html_tputln(p->mbuf, ML_OPEN, i++, HTML_TAG_HEAD))
- return(0);
-
- attr[0].attr = HTML_ATTR_HTTP_EQUIV;
- attr[0].val = "content-type";
- attr[1].attr = HTML_ATTR_CONTENT;
- attr[1].val = "text/html;charset=utf-8";
-
- if ( ! html_aputln(p->mbuf, ML_OPEN, i, HTML_TAG_META, 2, attr))
- return(0);
-
- attr[0].attr = HTML_ATTR_NAME;
- attr[0].val = "resource-type";
- attr[1].attr = HTML_ATTR_CONTENT;
- attr[1].val = "document";
-
- if ( ! html_aputln(p->mbuf, ML_OPEN, i, HTML_TAG_META, 2, attr))
- return(0);
-
- if ( ! html_tputln(p->mbuf, ML_OPEN, i, HTML_TAG_TITLE))
- return(0);
- if ( ! ml_putstring(p->mbuf, ts, NULL))
- return(0);
- if ( ! html_tputln(p->mbuf, ML_CLOSE, i, HTML_TAG_TITLE))
- return(0);
-
- if (HTML_CSS_EMBED & p->args->params.html.flags) {
- attr[0].attr = HTML_ATTR_TYPE;
- attr[0].val = "text/css";
-
- if ( ! html_aputln(p->mbuf, ML_OPEN, i,
- HTML_TAG_STYLE, 1, attr))
- return(0);
- if ( ! html_commentput(p->mbuf, ML_OPEN, NULL))
- return(0);
-
- if ( ! html_loadcss(p->mbuf, p->args->params.html.css))
- return(0);
-
- if ( ! html_commentput(p->mbuf, ML_CLOSE, NULL))
- return(0);
- if ( ! html_tputln(p->mbuf, ML_CLOSE, i, HTML_TAG_STYLE))
- return(0);
- } else {
- attr[0].attr = HTML_ATTR_REL;
- attr[0].val = "stylesheet";
- attr[1].attr = HTML_ATTR_TYPE;
- attr[1].val = "text/css";
- attr[2].attr = HTML_ATTR_HREF;
- attr[2].val = p->args->params.html.css;
-
- if ( ! html_aputln(p->mbuf, ML_OPEN, i,
- HTML_TAG_LINK, 3, attr))
- return(0);
- }
-
- if ( ! html_tputln(p->mbuf, ML_CLOSE, --i, HTML_TAG_HEAD))
- return(0);
- if ( ! html_tputln(p->mbuf, ML_OPEN, i, HTML_TAG_BODY))
- return(0);
-
- attr[0].attr = HTML_ATTR_CLASS;
- attr[0].val = "mdoc";
-
- if ( ! html_aputln(p->mbuf, ML_OPEN, i, HTML_TAG_DIV, 1, attr))
- return(0);
-
- attr[0].attr = HTML_ATTR_WIDTH;
- attr[0].val = "100%";
- attr[1].attr = HTML_ATTR_CLASS;
- attr[1].val = "header-table";
-
- if ( ! html_aputln(p->mbuf, ML_OPEN, i++, HTML_TAG_TABLE, 2, attr))
- return(0);
- if ( ! html_tputln(p->mbuf, ML_OPEN, i++, HTML_TAG_TR))
- return(0);
-
- attr[0].attr = HTML_ATTR_ALIGN;
- attr[0].val = "left";
- attr[1].attr = HTML_ATTR_CLASS;
- attr[1].val = "header-section";
-
- if ( ! html_aputln(p->mbuf, ML_OPEN, i, HTML_TAG_TD, 2, attr))
- return(0);
- if ( ! ml_putstring(p->mbuf, ts, NULL))
- return(0);
- if ( ! html_tputln(p->mbuf, ML_CLOSE, i, HTML_TAG_TD))
- return(0);
-
- attr[0].attr = HTML_ATTR_ALIGN;
- attr[0].val = "center";
- attr[1].attr = HTML_ATTR_CLASS;
- attr[1].val = "header-volume";
-
- if ( ! html_aputln(p->mbuf, ML_OPEN, i, HTML_TAG_TD, 2, attr))
- return(0);
- if ( ! ml_putstring(p->mbuf, title, NULL))
- return(0);
- if ( ! html_tputln(p->mbuf, ML_CLOSE, i, HTML_TAG_TD))
- return(0);
-
- attr[0].attr = HTML_ATTR_ALIGN;
- attr[0].val = "right";
- attr[1].attr = HTML_ATTR_CLASS;
- attr[1].val = "header-section";
-
- if ( ! html_aputln(p->mbuf, ML_OPEN, i, HTML_TAG_TD, 2, attr))
- return(0);
- if ( ! ml_putstring(p->mbuf, ts, NULL))
- return(0);
- if ( ! html_tputln(p->mbuf, ML_CLOSE, i, HTML_TAG_TD))
- return(0);
-
- if ( ! html_tputln(p->mbuf, ML_CLOSE, --i, HTML_TAG_TR))
- return(0);
- return(html_tputln(p->mbuf, ML_CLOSE, --i, HTML_TAG_TABLE));