summaryrefslogtreecommitdiffstats
path: root/mdoc_html.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2010-12-24 14:00:40 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2010-12-24 14:00:40 +0000
commit8d5ca2330a9d86880ee07d6fecf0befff8d445f4 (patch)
treeab6a339e99d6fcdd827aaecfee738abc32150be5 /mdoc_html.c
parent390e9bb2eebe070ac0a97222e307f0c172517e47 (diff)
downloadmandoc-8d5ca2330a9d86880ee07d6fecf0befff8d445f4.tar.gz
As per schwarze@'s suggestions, roll back the refcount structure in
favour of a simpler shim for normalised data in the node allocation and free routines. This removes the need to bump and copy references within validator handlers, removes a pointer redirect, and also kills the refcount structure itself. Data is assumed to "live" either in a MDOC_BLOCK or MDOC_ELEM and is copied accordingly.
Diffstat (limited to 'mdoc_html.c')
-rw-r--r--mdoc_html.c48
1 files changed, 24 insertions, 24 deletions
diff --git a/mdoc_html.c b/mdoc_html.c
index f9ca7269..fcbcf550 100644
--- a/mdoc_html.c
+++ b/mdoc_html.c
@@ -839,7 +839,7 @@ mdoc_it_pre(MDOC_ARGS)
assert(bl);
- type = bl->norm->d.Bl.type;
+ type = bl->norm->Bl.type;
assert(lists[type]);
PAIR_CLASS_INIT(&tag[0], lists[type]);
@@ -865,7 +865,7 @@ mdoc_it_pre(MDOC_ARGS)
case(LIST_ohang):
/* FALLTHROUGH */
case(LIST_tag):
- SCALE_VS_INIT(&su, ! bl->norm->d.Bl.comp);
+ SCALE_VS_INIT(&su, ! bl->norm->Bl.comp);
bufcat_su(h, "margin-top", &su);
PAIR_STYLE_INIT(&tag[1], h);
print_otag(h, TAG_DT, 2, tag);
@@ -890,7 +890,7 @@ mdoc_it_pre(MDOC_ARGS)
case(LIST_enum):
/* FALLTHROUGH */
case(LIST_item):
- SCALE_VS_INIT(&su, ! bl->norm->d.Bl.comp);
+ SCALE_VS_INIT(&su, ! bl->norm->Bl.comp);
bufcat_su(h, "margin-top", &su);
PAIR_STYLE_INIT(&tag[1], h);
print_otag(h, TAG_LI, 2, tag);
@@ -904,17 +904,17 @@ mdoc_it_pre(MDOC_ARGS)
case(LIST_ohang):
/* FALLTHROUGH */
case(LIST_tag):
- if (NULL == bl->norm->d.Bl.width) {
+ if (NULL == bl->norm->Bl.width) {
print_otag(h, TAG_DD, 1, tag);
break;
}
- a2width(bl->norm->d.Bl.width, &su);
+ a2width(bl->norm->Bl.width, &su);
bufcat_su(h, "margin-left", &su);
PAIR_STYLE_INIT(&tag[1], h);
print_otag(h, TAG_DD, 2, tag);
break;
case(LIST_column):
- SCALE_VS_INIT(&su, ! bl->norm->d.Bl.comp);
+ SCALE_VS_INIT(&su, ! bl->norm->Bl.comp);
bufcat_su(h, "margin-top", &su);
PAIR_STYLE_INIT(&tag[1], h);
print_otag(h, TAG_TD, 2, tag);
@@ -945,13 +945,13 @@ mdoc_bl_pre(MDOC_ARGS)
char buf[BUFSIZ];
if (MDOC_BODY == n->type) {
- if (LIST_column == n->norm->d.Bl.type)
+ if (LIST_column == n->norm->Bl.type)
print_otag(h, TAG_TBODY, 0, NULL);
return(1);
}
if (MDOC_HEAD == n->type) {
- if (LIST_column != n->norm->d.Bl.type)
+ if (LIST_column != n->norm->Bl.type)
return(0);
/*
@@ -961,10 +961,10 @@ mdoc_bl_pre(MDOC_ARGS)
* screen and we want to preserve that behaviour.
*/
- for (i = 0; i < n->norm->d.Bl.ncols; i++) {
- a2width(n->norm->d.Bl.cols[i], &su);
+ for (i = 0; i < n->norm->Bl.ncols; i++) {
+ a2width(n->norm->Bl.cols[i], &su);
bufinit(h);
- if (i < n->norm->d.Bl.ncols - 1)
+ if (i < n->norm->Bl.ncols - 1)
bufcat_su(h, "width", &su);
else
bufcat_su(h, "min-width", &su);
@@ -980,19 +980,19 @@ mdoc_bl_pre(MDOC_ARGS)
bufcat_su(h, "margin-bottom", &su);
PAIR_STYLE_INIT(&tag[0], h);
- assert(lists[n->norm->d.Bl.type]);
+ assert(lists[n->norm->Bl.type]);
strlcpy(buf, "list ", BUFSIZ);
- strlcat(buf, lists[n->norm->d.Bl.type], BUFSIZ);
+ strlcat(buf, lists[n->norm->Bl.type], BUFSIZ);
PAIR_INIT(&tag[1], ATTR_CLASS, buf);
/* Set the block's left-hand margin. */
- if (n->norm->d.Bl.offs) {
- a2offs(n->norm->d.Bl.offs, &su);
+ if (n->norm->Bl.offs) {
+ a2offs(n->norm->Bl.offs, &su);
bufcat_su(h, "margin-left", &su);
}
- switch (n->norm->d.Bl.type) {
+ switch (n->norm->Bl.type) {
case(LIST_bullet):
/* FALLTHROUGH */
case(LIST_dash):
@@ -1145,7 +1145,7 @@ mdoc_bd_pre(MDOC_ARGS)
return(0);
if (MDOC_BLOCK == n->type) {
- comp = n->norm->d.Bd.comp;
+ comp = n->norm->Bd.comp;
for (nn = n; nn && ! comp; nn = nn->parent) {
if (MDOC_BLOCK != nn->type)
continue;
@@ -1160,14 +1160,14 @@ mdoc_bd_pre(MDOC_ARGS)
}
SCALE_HS_INIT(&su, 0);
- if (n->norm->d.Bd.offs)
- a2offs(n->norm->d.Bd.offs, &su);
+ if (n->norm->Bd.offs)
+ a2offs(n->norm->Bd.offs, &su);
bufcat_su(h, "margin-left", &su);
PAIR_STYLE_INIT(&tag[0], h);
- if (DISP_unfilled != n->norm->d.Bd.type &&
- DISP_literal != n->norm->d.Bd.type) {
+ if (DISP_unfilled != n->norm->Bd.type &&
+ DISP_literal != n->norm->Bd.type) {
PAIR_CLASS_INIT(&tag[1], "display");
print_otag(h, TAG_DIV, 2, tag);
return(1);
@@ -1750,11 +1750,11 @@ mdoc_bf_pre(MDOC_ARGS)
else if (MDOC_BODY != n->type)
return(1);
- if (FONT_Em == n->norm->d.Bf.font)
+ if (FONT_Em == n->norm->Bf.font)
PAIR_CLASS_INIT(&tag[0], "emph");
- else if (FONT_Sy == n->norm->d.Bf.font)
+ else if (FONT_Sy == n->norm->Bf.font)
PAIR_CLASS_INIT(&tag[0], "symb");
- else if (FONT_Li == n->norm->d.Bf.font)
+ else if (FONT_Li == n->norm->Bf.font)
PAIR_CLASS_INIT(&tag[0], "lit");
else
PAIR_CLASS_INIT(&tag[0], "none");