From 224d010444ff10359e8d1c19e8739476b1e8f0f9 Mon Sep 17 00:00:00 2001 From: Kristaps Dzonsons Date: Sat, 3 Oct 2009 15:08:09 +0000 Subject: Element tag buffer is now part of struct html. buffmt() can be called in sequence. Noted BUFSIZ-sized buffer in CAVEATS (attribute length for link formats). Added -oman=FMT -Thtml option for `Xr' manual links. Removed -obase=URI -Thtml option (obsolete). --- html.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'html.c') diff --git a/html.c b/html.c index 426624a4..ae7c50b8 100644 --- a/html.c +++ b/html.c @@ -1,4 +1,4 @@ -/* $Id: html.c,v 1.52 2009/09/24 09:50:31 kristaps Exp $ */ +/* $Id: html.c,v 1.53 2009/10/03 15:08:09 kristaps Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons * @@ -83,10 +83,10 @@ void * html_alloc(char *outopts) { struct html *h; - char *toks[3], *v; + char *toks[4], *v; toks[0] = "style"; - toks[1] = "base"; + toks[1] = "man"; toks[2] = NULL; if (NULL == (h = calloc(1, sizeof(struct html)))) @@ -100,13 +100,15 @@ html_alloc(char *outopts) return(NULL); } + h->base_man = "%N.%S.html"; + while (outopts && *outopts) switch (getsubopt(&outopts, toks, &v)) { case (0): h->style = v; break; case (1): - h->base = v; + h->base_man = v; break; default: break; @@ -137,8 +139,11 @@ html_free(void *p) free(tag); } + if (h->buf) + free(h->buf); if (h->symtab) chars_free(h->symtab); + free(h); } @@ -171,12 +176,6 @@ print_gen_head(struct html *h) tag[3].val = "all"; print_otag(h, TAG_LINK, 4, tag); } - - if (h->base) { - tag[0].key = ATTR_HREF; - tag[1].val = h->base; - print_otag(h, TAG_BASE, 1, tag); - } } -- cgit v1.2.3-56-ge451