version 1.76, 2011/07/03 22:57:32 |
version 1.77, 2011/07/07 13:26:25 |
Line 403 man_root_post(MAN_ARGS) |
|
Line 403 man_root_post(MAN_ARGS) |
|
} |
} |
|
|
|
|
|
|
/* ARGSUSED */ |
/* ARGSUSED */ |
static int |
static int |
man_br_pre(MAN_ARGS) |
man_br_pre(MAN_ARGS) |
Line 431 man_br_pre(MAN_ARGS) |
|
Line 430 man_br_pre(MAN_ARGS) |
|
return(0); |
return(0); |
} |
} |
|
|
|
|
/* ARGSUSED */ |
/* ARGSUSED */ |
static int |
static int |
man_SH_pre(MAN_ARGS) |
man_SH_pre(MAN_ARGS) |
Line 450 man_SH_pre(MAN_ARGS) |
|
Line 448 man_SH_pre(MAN_ARGS) |
|
return(1); |
return(1); |
} |
} |
|
|
|
|
/* ARGSUSED */ |
/* ARGSUSED */ |
static int |
static int |
man_alt_pre(MAN_ARGS) |
man_alt_pre(MAN_ARGS) |
Line 501 man_alt_pre(MAN_ARGS) |
|
Line 498 man_alt_pre(MAN_ARGS) |
|
return(0); |
return(0); |
} |
} |
|
|
|
|
/* ARGSUSED */ |
/* ARGSUSED */ |
static int |
static int |
man_SM_pre(MAN_ARGS) |
man_SM_pre(MAN_ARGS) |
Line 513 man_SM_pre(MAN_ARGS) |
|
Line 509 man_SM_pre(MAN_ARGS) |
|
return(1); |
return(1); |
} |
} |
|
|
|
|
/* ARGSUSED */ |
/* ARGSUSED */ |
static int |
static int |
man_SS_pre(MAN_ARGS) |
man_SS_pre(MAN_ARGS) |
Line 532 man_SS_pre(MAN_ARGS) |
|
Line 527 man_SS_pre(MAN_ARGS) |
|
return(1); |
return(1); |
} |
} |
|
|
|
|
/* ARGSUSED */ |
/* ARGSUSED */ |
static int |
static int |
man_PP_pre(MAN_ARGS) |
man_PP_pre(MAN_ARGS) |
Line 546 man_PP_pre(MAN_ARGS) |
|
Line 540 man_PP_pre(MAN_ARGS) |
|
return(1); |
return(1); |
} |
} |
|
|
|
|
/* ARGSUSED */ |
/* ARGSUSED */ |
static int |
static int |
man_IP_pre(MAN_ARGS) |
man_IP_pre(MAN_ARGS) |
{ |
{ |
struct roffsu su; |
|
struct htmlpair tag; |
|
const struct man_node *nn; |
const struct man_node *nn; |
|
|
/* |
|
* This scattering of 1-BU margins and pads is to make sure that |
|
* when text overruns its box, the subsequent text isn't flush |
|
* up against it. However, the rest of the right-hand box must |
|
* also be adjusted in consideration of this 1-BU space. |
|
*/ |
|
|
|
if (MAN_BODY == n->type) { |
if (MAN_BODY == n->type) { |
print_otag(h, TAG_TD, 0, NULL); |
print_otag(h, TAG_DD, 0, NULL); |
return(1); |
return(1); |
|
} else if (MAN_HEAD != n->type) { |
|
print_otag(h, TAG_DL, 0, NULL); |
|
return(1); |
} |
} |
|
|
nn = MAN_BLOCK == n->type ? |
print_otag(h, TAG_DT, 0, NULL); |
n->head->child : n->parent->head->child; |
|
|
|
SCALE_HS_INIT(&su, INDENT); |
|
|
|
/* Width is the second token. */ |
|
|
|
if (MAN_IP == n->tok && NULL != nn) |
|
if (NULL != (nn = nn->next)) |
|
a2width(nn, &su); |
|
|
|
/* Width is the first token. */ |
|
|
|
if (MAN_TP == n->tok && NULL != nn) { |
|
/* Skip past non-text children. */ |
|
while (nn && MAN_TEXT != nn->type) |
|
nn = nn->next; |
|
if (nn) |
|
a2width(nn, &su); |
|
} |
|
|
|
if (MAN_BLOCK == n->type) { |
|
print_bvspace(h, n); |
|
print_otag(h, TAG_TABLE, 0, NULL); |
|
bufinit(h); |
|
bufcat_su(h, "width", &su); |
|
PAIR_STYLE_INIT(&tag, h); |
|
print_otag(h, TAG_COL, 1, &tag); |
|
print_otag(h, TAG_COL, 0, NULL); |
|
print_otag(h, TAG_TBODY, 0, NULL); |
|
print_otag(h, TAG_TR, 0, NULL); |
|
return(1); |
|
} |
|
|
|
print_otag(h, TAG_TD, 0, NULL); |
|
|
|
/* For IP, only print the first header element. */ |
/* For IP, only print the first header element. */ |
|
|
if (MAN_IP == n->tok && n->child) |
if (MAN_IP == n->tok && n->child) |
Line 618 man_IP_pre(MAN_ARGS) |
|
Line 571 man_IP_pre(MAN_ARGS) |
|
return(0); |
return(0); |
} |
} |
|
|
|
|
/* ARGSUSED */ |
/* ARGSUSED */ |
static int |
static int |
man_HP_pre(MAN_ARGS) |
man_HP_pre(MAN_ARGS) |
Line 627 man_HP_pre(MAN_ARGS) |
|
Line 579 man_HP_pre(MAN_ARGS) |
|
struct roffsu su; |
struct roffsu su; |
const struct man_node *np; |
const struct man_node *np; |
|
|
bufinit(h); |
if (MAN_HEAD == n->type) |
|
return(0); |
|
else if (MAN_BLOCK != n->type) |
|
return(1); |
|
|
np = MAN_BLOCK == n->type ? |
np = n->head->child; |
n->head->child : |
|
n->parent->head->child; |
|
|
|
if (NULL == np || ! a2width(np, &su)) |
if (NULL == np || ! a2width(np, &su)) |
SCALE_HS_INIT(&su, INDENT); |
SCALE_HS_INIT(&su, INDENT); |
|
|
if (MAN_HEAD == n->type) { |
bufinit(h); |
print_otag(h, TAG_TD, 0, NULL); |
|
return(0); |
|
} else if (MAN_BLOCK == n->type) { |
|
print_bvspace(h, n); |
|
print_otag(h, TAG_TABLE, 0, NULL); |
|
bufcat_su(h, "width", &su); |
|
PAIR_STYLE_INIT(&tag, h); |
|
print_otag(h, TAG_COL, 1, &tag); |
|
print_otag(h, TAG_COL, 0, NULL); |
|
print_otag(h, TAG_TBODY, 0, NULL); |
|
print_otag(h, TAG_TR, 0, NULL); |
|
return(1); |
|
} |
|
|
|
|
print_bvspace(h, n); |
|
bufcat_su(h, "margin-left", &su); |
su.scale = -su.scale; |
su.scale = -su.scale; |
bufcat_su(h, "text-indent", &su); |
bufcat_su(h, "text-indent", &su); |
PAIR_STYLE_INIT(&tag, h); |
PAIR_STYLE_INIT(&tag, h); |
print_otag(h, TAG_TD, 1, &tag); |
print_otag(h, TAG_P, 1, &tag); |
return(1); |
return(1); |
} |
} |
|
|
|
|
/* ARGSUSED */ |
/* ARGSUSED */ |
static int |
static int |
man_B_pre(MAN_ARGS) |
man_B_pre(MAN_ARGS) |
Line 668 man_B_pre(MAN_ARGS) |
|
Line 609 man_B_pre(MAN_ARGS) |
|
return(1); |
return(1); |
} |
} |
|
|
|
|
/* ARGSUSED */ |
/* ARGSUSED */ |
static int |
static int |
man_I_pre(MAN_ARGS) |
man_I_pre(MAN_ARGS) |
Line 678 man_I_pre(MAN_ARGS) |
|
Line 618 man_I_pre(MAN_ARGS) |
|
return(1); |
return(1); |
} |
} |
|
|
|
|
/* ARGSUSED */ |
/* ARGSUSED */ |
static int |
static int |
man_literal_pre(MAN_ARGS) |
man_literal_pre(MAN_ARGS) |
Line 693 man_literal_pre(MAN_ARGS) |
|
Line 632 man_literal_pre(MAN_ARGS) |
|
return(0); |
return(0); |
} |
} |
|
|
|
|
/* ARGSUSED */ |
/* ARGSUSED */ |
static int |
static int |
man_in_pre(MAN_ARGS) |
man_in_pre(MAN_ARGS) |
Line 703 man_in_pre(MAN_ARGS) |
|
Line 641 man_in_pre(MAN_ARGS) |
|
return(0); |
return(0); |
} |
} |
|
|
|
|
/* ARGSUSED */ |
/* ARGSUSED */ |
static int |
static int |
man_ign_pre(MAN_ARGS) |
man_ign_pre(MAN_ARGS) |
Line 711 man_ign_pre(MAN_ARGS) |
|
Line 648 man_ign_pre(MAN_ARGS) |
|
|
|
return(0); |
return(0); |
} |
} |
|
|
|
|
/* ARGSUSED */ |
/* ARGSUSED */ |
static int |
static int |