version 1.188, 2017/01/10 13:47:00 |
version 1.193, 2017/05/04 17:48:28 |
|
|
/* $Id$ */ |
/* $Id$ */ |
/* |
/* |
* Copyright (c) 2008-2012 Kristaps Dzonsons <kristaps@bsd.lv> |
* Copyright (c) 2008-2012 Kristaps Dzonsons <kristaps@bsd.lv> |
* Copyright (c) 2010-2015 Ingo Schwarze <schwarze@openbsd.org> |
* Copyright (c) 2010-2015, 2017 Ingo Schwarze <schwarze@openbsd.org> |
* |
* |
* Permission to use, copy, modify, and distribute this software for any |
* Permission to use, copy, modify, and distribute this software for any |
* purpose with or without fee is hereby granted, provided that the above |
* purpose with or without fee is hereby granted, provided that the above |
Line 95 static void post_SS(DECL_ARGS); |
|
Line 95 static void post_SS(DECL_ARGS); |
|
static void post_TP(DECL_ARGS); |
static void post_TP(DECL_ARGS); |
static void post_UR(DECL_ARGS); |
static void post_UR(DECL_ARGS); |
|
|
static const struct termact termacts[MAN_MAX] = { |
static const struct termact __termacts[MAN_MAX - MAN_TH] = { |
{ pre_sp, NULL, MAN_NOTEXT }, /* br */ |
|
{ NULL, NULL, 0 }, /* TH */ |
{ NULL, NULL, 0 }, /* TH */ |
{ pre_SH, post_SH, 0 }, /* SH */ |
{ pre_SH, post_SH, 0 }, /* SH */ |
{ pre_SS, post_SS, 0 }, /* SS */ |
{ pre_SS, post_SS, 0 }, /* SS */ |
Line 135 static const struct termact termacts[MAN_MAX] = { |
|
Line 134 static const struct termact termacts[MAN_MAX] = { |
|
{ NULL, NULL, 0 }, /* UE */ |
{ NULL, NULL, 0 }, /* UE */ |
{ pre_ll, NULL, MAN_NOTEXT }, /* ll */ |
{ pre_ll, NULL, MAN_NOTEXT }, /* ll */ |
}; |
}; |
|
static const struct termact *termacts = __termacts - MAN_TH; |
|
|
|
|
void |
void |
Line 143 terminal_man(void *arg, const struct roff_man *man) |
|
Line 143 terminal_man(void *arg, const struct roff_man *man) |
|
struct termp *p; |
struct termp *p; |
struct roff_node *n; |
struct roff_node *n; |
struct mtermp mt; |
struct mtermp mt; |
|
size_t save_defindent; |
|
|
p = (struct termp *)arg; |
p = (struct termp *)arg; |
p->overstep = 0; |
p->overstep = 0; |
Line 170 terminal_man(void *arg, const struct roff_man *man) |
|
Line 171 terminal_man(void *arg, const struct roff_man *man) |
|
n = n->next; |
n = n->next; |
} |
} |
} else { |
} else { |
|
save_defindent = p->defindent; |
if (p->defindent == 0) |
if (p->defindent == 0) |
p->defindent = 7; |
p->defindent = 7; |
term_begin(p, print_man_head, print_man_foot, &man->meta); |
term_begin(p, print_man_head, print_man_foot, &man->meta); |
Line 177 terminal_man(void *arg, const struct roff_man *man) |
|
Line 179 terminal_man(void *arg, const struct roff_man *man) |
|
if (n != NULL) |
if (n != NULL) |
print_man_nodelist(p, &mt, n, &man->meta); |
print_man_nodelist(p, &mt, n, &man->meta); |
term_end(p); |
term_end(p); |
|
p->defindent = save_defindent; |
} |
} |
} |
} |
|
|
Line 454 pre_sp(DECL_ARGS) |
|
Line 457 pre_sp(DECL_ARGS) |
|
} |
} |
} |
} |
|
|
if (n->tok == MAN_br) |
if (n->tok == ROFF_br) |
len = 0; |
len = 0; |
else if (n->child == NULL) |
else if (n->child == NULL) |
len = 1; |
len = 1; |
Line 819 pre_SH(DECL_ARGS) |
|
Line 822 pre_SH(DECL_ARGS) |
|
|
|
do { |
do { |
n = n->prev; |
n = n->prev; |
} while (n != NULL && termacts[n->tok].flags & MAN_NOTEXT); |
} while (n != NULL && n->tok != TOKEN_NONE && |
|
termacts[n->tok].flags & MAN_NOTEXT); |
if (n == NULL || (n->tok == MAN_SH && n->body->child == NULL)) |
if (n == NULL || (n->tok == MAN_SH && n->body->child == NULL)) |
break; |
break; |
|
|
Line 982 print_man_node(DECL_ARGS) |
|
Line 986 print_man_node(DECL_ARGS) |
|
break; |
break; |
} |
} |
|
|
|
if (n->tok < ROFF_MAX) { |
|
switch (n->tok) { |
|
case ROFF_br: |
|
pre_sp(p, mt, n, meta); |
|
break; |
|
default: |
|
abort(); |
|
} |
|
return; |
|
} |
|
|
|
assert(n->tok >= MAN_TH && n->tok <= MAN_MAX); |
if ( ! (MAN_NOTEXT & termacts[n->tok].flags)) |
if ( ! (MAN_NOTEXT & termacts[n->tok].flags)) |
term_fontrepl(p, TERMFONT_NONE); |
term_fontrepl(p, TERMFONT_NONE); |
|
|