version 1.113, 2017/05/05 15:17:32 |
version 1.119, 2017/06/08 12:54:58 |
Line 101 static int pre_in(DECL_ARGS); |
|
Line 101 static int pre_in(DECL_ARGS); |
|
static int pre_it(DECL_ARGS); |
static int pre_it(DECL_ARGS); |
static int pre_lk(DECL_ARGS); |
static int pre_lk(DECL_ARGS); |
static int pre_li(DECL_ARGS); |
static int pre_li(DECL_ARGS); |
static void pre_ll(DECL_ARGS); |
|
static int pre_nm(DECL_ARGS); |
static int pre_nm(DECL_ARGS); |
static int pre_no(DECL_ARGS); |
static int pre_no(DECL_ARGS); |
static int pre_ns(DECL_ARGS); |
static int pre_ns(DECL_ARGS); |
|
static void pre_onearg(DECL_ARGS); |
static int pre_pp(DECL_ARGS); |
static int pre_pp(DECL_ARGS); |
static int pre_rs(DECL_ARGS); |
static int pre_rs(DECL_ARGS); |
static int pre_sm(DECL_ARGS); |
static int pre_sm(DECL_ARGS); |
Line 112 static void pre_sp(DECL_ARGS); |
|
Line 112 static void pre_sp(DECL_ARGS); |
|
static int pre_sect(DECL_ARGS); |
static int pre_sect(DECL_ARGS); |
static int pre_sy(DECL_ARGS); |
static int pre_sy(DECL_ARGS); |
static void pre_syn(const struct roff_node *); |
static void pre_syn(const struct roff_node *); |
|
static void pre_ta(DECL_ARGS); |
static int pre_vt(DECL_ARGS); |
static int pre_vt(DECL_ARGS); |
static int pre_xr(DECL_ARGS); |
static int pre_xr(DECL_ARGS); |
static void print_word(const char *); |
static void print_word(const char *); |
Line 125 static void print_node(DECL_ARGS); |
|
Line 126 static void print_node(DECL_ARGS); |
|
|
|
static const void_fp roff_manacts[ROFF_MAX] = { |
static const void_fp roff_manacts[ROFF_MAX] = { |
pre_br, |
pre_br, |
|
pre_onearg, |
pre_ft, |
pre_ft, |
pre_ll, |
pre_onearg, |
|
pre_onearg, |
pre_sp, |
pre_sp, |
|
pre_ta, |
|
pre_onearg, |
}; |
}; |
|
|
static const struct manact __manacts[MDOC_MAX - MDOC_Dd] = { |
static const struct manact __manacts[MDOC_MAX - MDOC_Dd] = { |
|
|
print_line(const char *s, int newflags) |
print_line(const char *s, int newflags) |
{ |
{ |
|
|
outflags &= ~MMAN_br; |
|
outflags |= MMAN_nl; |
outflags |= MMAN_nl; |
print_word(s); |
print_word(s); |
outflags |= newflags; |
outflags |= newflags; |
Line 472 print_offs(const char *v, int keywords) |
|
Line 476 print_offs(const char *v, int keywords) |
|
{ |
{ |
char buf[24]; |
char buf[24]; |
struct roffsu su; |
struct roffsu su; |
|
const char *end; |
int sz; |
int sz; |
|
|
print_line(".RS", MMAN_Bk_susp); |
print_line(".RS", MMAN_Bk_susp); |
Line 483 print_offs(const char *v, int keywords) |
|
Line 488 print_offs(const char *v, int keywords) |
|
sz = 6; |
sz = 6; |
else if (keywords && !strcmp(v, "indent-two")) |
else if (keywords && !strcmp(v, "indent-two")) |
sz = 12; |
sz = 12; |
else if (a2roffsu(v, &su, SCALE_EN) > 1) { |
else { |
if (SCALE_EN == su.unit) |
end = a2roffsu(v, &su, SCALE_EN); |
|
if (end == NULL || *end != '\0') |
|
sz = man_strlen(v); |
|
else if (SCALE_EN == su.unit) |
sz = su.scale; |
sz = su.scale; |
else { |
else { |
/* |
/* |
Line 498 print_offs(const char *v, int keywords) |
|
Line 506 print_offs(const char *v, int keywords) |
|
outflags |= MMAN_nl; |
outflags |= MMAN_nl; |
return; |
return; |
} |
} |
} else |
} |
sz = man_strlen(v); |
|
|
|
/* |
/* |
* We are inside an enclosing list. |
* We are inside an enclosing list. |
Line 521 print_width(const struct mdoc_bl *bl, const struct rof |
|
Line 528 print_width(const struct mdoc_bl *bl, const struct rof |
|
{ |
{ |
char buf[24]; |
char buf[24]; |
struct roffsu su; |
struct roffsu su; |
|
const char *end; |
int numeric, remain, sz, chsz; |
int numeric, remain, sz, chsz; |
|
|
numeric = 1; |
numeric = 1; |
Line 529 print_width(const struct mdoc_bl *bl, const struct rof |
|
Line 537 print_width(const struct mdoc_bl *bl, const struct rof |
|
/* Convert the width into a number (of characters). */ |
/* Convert the width into a number (of characters). */ |
if (bl->width == NULL) |
if (bl->width == NULL) |
sz = (bl->type == LIST_hang) ? 6 : 0; |
sz = (bl->type == LIST_hang) ? 6 : 0; |
else if (a2roffsu(bl->width, &su, SCALE_MAX) > 1) { |
else { |
if (SCALE_EN == su.unit) |
end = a2roffsu(bl->width, &su, SCALE_MAX); |
|
if (end == NULL || *end != '\0') |
|
sz = man_strlen(bl->width); |
|
else if (SCALE_EN == su.unit) |
sz = su.scale; |
sz = su.scale; |
else { |
else { |
sz = 0; |
sz = 0; |
numeric = 0; |
numeric = 0; |
} |
} |
} else |
} |
sz = man_strlen(bl->width); |
|
|
|
/* XXX Rough estimation, might have multiple parts. */ |
/* XXX Rough estimation, might have multiple parts. */ |
if (bl->type == LIST_enum) |
if (bl->type == LIST_enum) |
Line 1525 post_lb(DECL_ARGS) |
|
Line 1535 post_lb(DECL_ARGS) |
|
static int |
static int |
pre_lk(DECL_ARGS) |
pre_lk(DECL_ARGS) |
{ |
{ |
const struct roff_node *link, *descr; |
const struct roff_node *link, *descr, *punct; |
int display; |
int display; |
|
|
if ((link = n->child) == NULL) |
if ((link = n->child) == NULL) |
return 0; |
return 0; |
|
|
|
/* Find beginning of trailing punctuation. */ |
|
punct = n->last; |
|
while (punct != link && punct->flags & NODE_DELIMC) |
|
punct = punct->prev; |
|
punct = punct->next; |
|
|
/* Link text. */ |
/* Link text. */ |
if ((descr = link->next) != NULL && !(descr->flags & NODE_DELIMC)) { |
if ((descr = link->next) != NULL && descr != punct) { |
font_push('I'); |
font_push('I'); |
while (descr != NULL && !(descr->flags & NODE_DELIMC)) { |
while (descr != punct) { |
print_word(descr->string); |
print_word(descr->string); |
descr = descr->next; |
descr = descr->next; |
} |
} |
Line 1554 pre_lk(DECL_ARGS) |
|
Line 1570 pre_lk(DECL_ARGS) |
|
font_pop(); |
font_pop(); |
|
|
/* Trailing punctuation. */ |
/* Trailing punctuation. */ |
while (descr != NULL) { |
while (punct != NULL) { |
print_word(descr->string); |
print_word(punct->string); |
descr = descr->next; |
punct = punct->next; |
} |
} |
if (display) |
if (display) |
print_line(".RE", MMAN_nl); |
print_line(".RE", MMAN_nl); |
Line 1564 pre_lk(DECL_ARGS) |
|
Line 1580 pre_lk(DECL_ARGS) |
|
} |
} |
|
|
static void |
static void |
pre_ll(DECL_ARGS) |
pre_onearg(DECL_ARGS) |
{ |
{ |
print_line(".ll", 0); |
outflags |= MMAN_nl; |
|
print_word("."); |
|
outflags &= ~MMAN_spc; |
|
print_word(roff_name[n->tok]); |
if (n->child != NULL) |
if (n->child != NULL) |
print_word(n->child->string); |
print_word(n->child->string); |
outflags |= MMAN_nl; |
outflags |= MMAN_nl; |
|
if (n->tok == ROFF_ce) |
|
for (n = n->child->next; n != NULL; n = n->next) |
|
print_node(meta, n); |
} |
} |
|
|
static int |
static int |
Line 1713 pre_sy(DECL_ARGS) |
|
Line 1735 pre_sy(DECL_ARGS) |
|
|
|
font_push('B'); |
font_push('B'); |
return 1; |
return 1; |
|
} |
|
|
|
static void |
|
pre_ta(DECL_ARGS) |
|
{ |
|
print_line(".ta", 0); |
|
for (n = n->child; n != NULL; n = n->next) |
|
print_word(n->string); |
|
outflags |= MMAN_nl; |
} |
} |
|
|
static int |
static int |