version 1.179, 2015/04/06 22:06:23 |
version 1.182, 2015/04/19 14:00:19 |
Line 138 static const struct termact termacts[MAN_MAX] = { |
|
Line 138 static const struct termact termacts[MAN_MAX] = { |
|
|
|
|
|
void |
void |
terminal_man(void *arg, const struct man *man) |
terminal_man(void *arg, const struct roff_man *man) |
{ |
{ |
struct termp *p; |
struct termp *p; |
const struct roff_meta *meta; |
|
struct roff_node *n; |
struct roff_node *n; |
struct mtermp mt; |
struct mtermp mt; |
|
|
p = (struct termp *)arg; |
p = (struct termp *)arg; |
|
|
p->overstep = 0; |
p->overstep = 0; |
p->rmargin = p->maxrmargin = p->defrmargin; |
p->rmargin = p->maxrmargin = p->defrmargin; |
p->tabwidth = term_len(p, 5); |
p->tabwidth = term_len(p, 5); |
|
|
n = man_node(man)->child; |
|
meta = man_meta(man); |
|
|
|
memset(&mt, 0, sizeof(struct mtermp)); |
memset(&mt, 0, sizeof(struct mtermp)); |
|
|
mt.lmargin[mt.lmargincur] = term_len(p, p->defindent); |
mt.lmargin[mt.lmargincur] = term_len(p, p->defindent); |
mt.offset = term_len(p, p->defindent); |
mt.offset = term_len(p, p->defindent); |
mt.pardist = 1; |
mt.pardist = 1; |
|
|
|
n = man->first->child; |
if (p->synopsisonly) { |
if (p->synopsisonly) { |
while (n != NULL) { |
while (n != NULL) { |
if (n->tok == MAN_SH && |
if (n->tok == MAN_SH && |
Line 167 terminal_man(void *arg, const struct man *man) |
|
Line 162 terminal_man(void *arg, const struct man *man) |
|
!strcmp(n->child->child->string, "SYNOPSIS")) { |
!strcmp(n->child->child->string, "SYNOPSIS")) { |
if (n->child->next->child != NULL) |
if (n->child->next->child != NULL) |
print_man_nodelist(p, &mt, |
print_man_nodelist(p, &mt, |
n->child->next->child, meta); |
n->child->next->child, |
|
&man->meta); |
term_newln(p); |
term_newln(p); |
break; |
break; |
} |
} |
Line 176 terminal_man(void *arg, const struct man *man) |
|
Line 172 terminal_man(void *arg, const struct man *man) |
|
} else { |
} else { |
if (p->defindent == 0) |
if (p->defindent == 0) |
p->defindent = 7; |
p->defindent = 7; |
term_begin(p, print_man_head, print_man_foot, meta); |
term_begin(p, print_man_head, print_man_foot, &man->meta); |
p->flags |= TERMP_NOSPACE; |
p->flags |= TERMP_NOSPACE; |
if (n != NULL) |
if (n != NULL) |
print_man_nodelist(p, &mt, n, meta); |
print_man_nodelist(p, &mt, n, &man->meta); |
term_end(p); |
term_end(p); |
} |
} |
} |
} |
Line 760 pre_SS(DECL_ARGS) |
|
Line 756 pre_SS(DECL_ARGS) |
|
|
|
do { |
do { |
n = n->prev; |
n = n->prev; |
} while (n != NULL && n->tok != MAN_MAX && |
} while (n != NULL && n->tok != TOKEN_NONE && |
termacts[n->tok].flags & MAN_NOTEXT); |
termacts[n->tok].flags & MAN_NOTEXT); |
if (n == NULL || (n->tok == MAN_SS && n->body->child == NULL)) |
if (n == NULL || (n->tok == MAN_SS && n->body->child == NULL)) |
break; |
break; |