version 1.224, 2011/04/04 16:15:58 |
version 1.231, 2011/06/29 15:38:09 |
Line 264 terminal_mdoc(void *arg, const struct mdoc *mdoc) |
|
Line 264 terminal_mdoc(void *arg, const struct mdoc *mdoc) |
|
p->tabwidth = term_len(p, 5); |
p->tabwidth = term_len(p, 5); |
|
|
if (NULL == p->symtab) |
if (NULL == p->symtab) |
switch (p->enc) { |
p->symtab = mchars_alloc(); |
case (TERMENC_ASCII): |
|
p->symtab = chars_init(CHARS_ASCII); |
|
break; |
|
default: |
|
abort(); |
|
/* NOTREACHED */ |
|
} |
|
|
|
n = mdoc_node(mdoc); |
n = mdoc_node(mdoc); |
m = mdoc_meta(mdoc); |
m = mdoc_meta(mdoc); |
Line 530 a2height(const struct termp *p, const char *v) |
|
Line 523 a2height(const struct termp *p, const char *v) |
|
{ |
{ |
struct roffsu su; |
struct roffsu su; |
|
|
|
|
assert(v); |
assert(v); |
if ( ! a2roffsu(v, &su, SCALE_VS)) |
if ( ! a2roffsu(v, &su, SCALE_VS)) |
SCALE_VS_INIT(&su, term_len(p, 1)); |
SCALE_VS_INIT(&su, atoi(v)); |
|
|
return(term_vspan(p, &su)); |
return(term_vspan(p, &su)); |
} |
} |
Line 1296 termp_bl_post(DECL_ARGS) |
|
Line 1290 termp_bl_post(DECL_ARGS) |
|
term_newln(p); |
term_newln(p); |
} |
} |
|
|
|
|
/* ARGSUSED */ |
/* ARGSUSED */ |
static int |
static int |
termp_xr_pre(DECL_ARGS) |
termp_xr_pre(DECL_ARGS) |
{ |
{ |
const struct mdoc_node *nn; |
|
|
|
if (NULL == n->child) |
if (NULL == (n = n->child)) |
return(0); |
return(0); |
|
|
assert(MDOC_TEXT == n->child->type); |
assert(MDOC_TEXT == n->type); |
nn = n->child; |
term_word(p, n->string); |
|
|
term_word(p, nn->string); |
if (NULL == (n = n->next)) |
if (NULL == (nn = nn->next)) |
|
return(0); |
return(0); |
|
|
p->flags |= TERMP_NOSPACE; |
p->flags |= TERMP_NOSPACE; |
term_word(p, "("); |
term_word(p, "("); |
p->flags |= TERMP_NOSPACE; |
p->flags |= TERMP_NOSPACE; |
term_word(p, nn->string); |
|
|
assert(MDOC_TEXT == n->type); |
|
term_word(p, n->string); |
|
|
p->flags |= TERMP_NOSPACE; |
p->flags |= TERMP_NOSPACE; |
term_word(p, ")"); |
term_word(p, ")"); |
|
|
return(0); |
return(0); |
} |
} |
|
|
|
|
/* |
/* |
* This decides how to assert whitespace before any of the SYNOPSIS set |
* This decides how to assert whitespace before any of the SYNOPSIS set |
* of macros (which, as in the case of Ft/Fo and Ft/Fn, may contain |
* of macros (which, as in the case of Ft/Fo and Ft/Fn, may contain |
Line 1536 termp_ft_pre(DECL_ARGS) |
|
Line 1530 termp_ft_pre(DECL_ARGS) |
|
static int |
static int |
termp_fn_pre(DECL_ARGS) |
termp_fn_pre(DECL_ARGS) |
{ |
{ |
const struct mdoc_node *nn; |
int pretty; |
|
|
|
pretty = MDOC_SYNPRETTY & n->flags; |
|
|
synopsis_pre(p, n); |
synopsis_pre(p, n); |
|
|
|
if (NULL == (n = n->child)) |
|
return(0); |
|
|
|
assert(MDOC_TEXT == n->type); |
term_fontpush(p, TERMFONT_BOLD); |
term_fontpush(p, TERMFONT_BOLD); |
term_word(p, n->child->string); |
term_word(p, n->string); |
term_fontpop(p); |
term_fontpop(p); |
|
|
p->flags |= TERMP_NOSPACE; |
p->flags |= TERMP_NOSPACE; |
term_word(p, "("); |
term_word(p, "("); |
p->flags |= TERMP_NOSPACE; |
p->flags |= TERMP_NOSPACE; |
|
|
for (nn = n->child->next; nn; nn = nn->next) { |
for (n = n->next; n; n = n->next) { |
|
assert(MDOC_TEXT == n->type); |
term_fontpush(p, TERMFONT_UNDER); |
term_fontpush(p, TERMFONT_UNDER); |
term_word(p, nn->string); |
term_word(p, n->string); |
term_fontpop(p); |
term_fontpop(p); |
|
|
if (nn->next) { |
if (n->next) { |
p->flags |= TERMP_NOSPACE; |
p->flags |= TERMP_NOSPACE; |
term_word(p, ","); |
term_word(p, ","); |
} |
} |
Line 1562 termp_fn_pre(DECL_ARGS) |
|
Line 1563 termp_fn_pre(DECL_ARGS) |
|
p->flags |= TERMP_NOSPACE; |
p->flags |= TERMP_NOSPACE; |
term_word(p, ")"); |
term_word(p, ")"); |
|
|
if (MDOC_SYNPRETTY & n->flags) { |
if (pretty) { |
p->flags |= TERMP_NOSPACE; |
p->flags |= TERMP_NOSPACE; |
term_word(p, ";"); |
term_word(p, ";"); |
} |
} |