version 1.51, 2013/06/02 18:16:57 |
version 1.55, 2013/12/24 22:08:50 |
Line 442 print_offs(const char *v) |
|
Line 442 print_offs(const char *v) |
|
if (Bl_stack_len) |
if (Bl_stack_len) |
sz += Bl_stack[Bl_stack_len - 1]; |
sz += Bl_stack[Bl_stack_len - 1]; |
|
|
snprintf(buf, sizeof(buf), "%ldn", sz); |
snprintf(buf, sizeof(buf), "%zun", sz); |
print_word(buf); |
print_word(buf); |
outflags |= MMAN_nl; |
outflags |= MMAN_nl; |
} |
} |
Line 495 print_width(const char *v, const struct mdoc_node *chi |
|
Line 495 print_width(const char *v, const struct mdoc_node *chi |
|
remain = sz + 2; |
remain = sz + 2; |
} |
} |
if (numeric) { |
if (numeric) { |
snprintf(buf, sizeof(buf), "%ldn", sz + 2); |
snprintf(buf, sizeof(buf), "%zun", sz + 2); |
print_word(buf); |
print_word(buf); |
} else |
} else |
print_word(v); |
print_word(v); |
Line 553 man_mdoc(void *arg, const struct mdoc *mdoc) |
|
Line 553 man_mdoc(void *arg, const struct mdoc *mdoc) |
|
static void |
static void |
print_node(DECL_ARGS) |
print_node(DECL_ARGS) |
{ |
{ |
const struct mdoc_node *prev, *sub; |
const struct mdoc_node *sub; |
const struct manact *act; |
const struct manact *act; |
int cond, do_sub; |
int cond, do_sub; |
|
|
Line 561 print_node(DECL_ARGS) |
|
Line 561 print_node(DECL_ARGS) |
|
* Break the line if we were parsed subsequent the current node. |
* Break the line if we were parsed subsequent the current node. |
* This makes the page structure be more consistent. |
* This makes the page structure be more consistent. |
*/ |
*/ |
prev = n->prev ? n->prev : n->parent; |
if (MMAN_spc & outflags && MDOC_LINE & n->flags) |
if (MMAN_spc & outflags && prev && prev->line < n->line) |
|
outflags |= MMAN_nl; |
outflags |= MMAN_nl; |
|
|
act = NULL; |
act = NULL; |
|
|
pre_sect(DECL_ARGS) |
pre_sect(DECL_ARGS) |
{ |
{ |
|
|
switch (n->type) { |
if (MDOC_HEAD == n->type) { |
case (MDOC_HEAD): |
|
outflags |= MMAN_sp; |
outflags |= MMAN_sp; |
print_block(manacts[n->tok].prefix, 0); |
print_block(manacts[n->tok].prefix, 0); |
print_word(""); |
print_word(""); |
putchar('\"'); |
putchar('\"'); |
outflags &= ~MMAN_spc; |
outflags &= ~MMAN_spc; |
break; |
|
case (MDOC_BODY): |
|
if (MDOC_Sh == n->tok) { |
|
if (MDOC_SYNPRETTY & n->flags) |
|
outflags |= MMAN_Bk; |
|
else |
|
outflags &= ~MMAN_Bk; |
|
} |
|
break; |
|
default: |
|
break; |
|
} |
} |
return(1); |
return(1); |
} |
} |
|
|
post_bk(DECL_ARGS) |
post_bk(DECL_ARGS) |
{ |
{ |
|
|
if (MDOC_BODY == n->type && ! (MDOC_SYNPRETTY & n->flags)) |
if (MDOC_BODY == n->type) |
outflags &= ~MMAN_Bk; |
outflags &= ~MMAN_Bk; |
} |
} |
|
|
Line 1104 pre_fn(DECL_ARGS) |
|
Line 1091 pre_fn(DECL_ARGS) |
|
if (NULL == n) |
if (NULL == n) |
return(0); |
return(0); |
|
|
|
if (MDOC_SYNPRETTY & n->flags) |
|
print_block(".HP 4n", MMAN_nl); |
|
|
font_push('B'); |
font_push('B'); |
print_node(meta, n); |
print_node(meta, n); |
font_pop(); |
font_pop(); |
Line 1124 post_fn(DECL_ARGS) |
|
Line 1114 post_fn(DECL_ARGS) |
|
print_word(")"); |
print_word(")"); |
if (MDOC_SYNPRETTY & n->flags) { |
if (MDOC_SYNPRETTY & n->flags) { |
print_word(";"); |
print_word(";"); |
outflags |= MMAN_br; |
outflags |= MMAN_PP; |
} |
} |
} |
} |
|
|
|
|
|
|
/* Restore the indentation of the enclosing list. */ |
/* Restore the indentation of the enclosing list. */ |
print_line(".RS", MMAN_Bk_susp); |
print_line(".RS", MMAN_Bk_susp); |
snprintf(buf, sizeof(buf), "%ldn", Bl_stack[Bl_stack_len - 1]); |
snprintf(buf, sizeof(buf), "%zun", Bl_stack[Bl_stack_len - 1]); |
print_word(buf); |
print_word(buf); |
|
|
/* Remeber to close out this .RS block later. */ |
/* Remeber to close out this .RS block later. */ |
Line 1409 pre_nm(DECL_ARGS) |
|
Line 1399 pre_nm(DECL_ARGS) |
|
{ |
{ |
char *name; |
char *name; |
|
|
if (MDOC_BLOCK == n->type) |
if (MDOC_BLOCK == n->type) { |
|
outflags |= MMAN_Bk; |
pre_syn(n); |
pre_syn(n); |
|
} |
if (MDOC_ELEM != n->type && MDOC_HEAD != n->type) |
if (MDOC_ELEM != n->type && MDOC_HEAD != n->type) |
return(1); |
return(1); |
name = n->child ? n->child->string : meta->name; |
name = n->child ? n->child->string : meta->name; |
Line 1420 pre_nm(DECL_ARGS) |
|
Line 1412 pre_nm(DECL_ARGS) |
|
if (NULL == n->parent->prev) |
if (NULL == n->parent->prev) |
outflags |= MMAN_sp; |
outflags |= MMAN_sp; |
print_block(".HP", 0); |
print_block(".HP", 0); |
printf(" %ldn", strlen(name) + 1); |
printf(" %zun", strlen(name) + 1); |
outflags |= MMAN_nl; |
outflags |= MMAN_nl; |
} |
} |
font_push('B'); |
font_push('B'); |
|
|
post_nm(DECL_ARGS) |
post_nm(DECL_ARGS) |
{ |
{ |
|
|
if (MDOC_ELEM != n->type && MDOC_HEAD != n->type) |
switch (n->type) { |
return; |
case (MDOC_BLOCK): |
font_pop(); |
outflags &= ~MMAN_Bk; |
|
break; |
|
case (MDOC_HEAD): |
|
/* FALLTHROUGH */ |
|
case (MDOC_ELEM): |
|
font_pop(); |
|
break; |
|
default: |
|
break; |
|
} |
} |
} |
|
|
static int |
static int |