version 1.135, 2012/11/17 00:26:33 |
version 1.138, 2013/11/11 00:37:55 |
|
|
/* $Id$ */ |
/* $Id$ */ |
/* |
/* |
* Copyright (c) 2008-2012 Kristaps Dzonsons <kristaps@bsd.lv> |
* Copyright (c) 2008-2012 Kristaps Dzonsons <kristaps@bsd.lv> |
* Copyright (c) 2010, 2011, 2012 Ingo Schwarze <schwarze@openbsd.org> |
* Copyright (c) 2010, 2011, 2012, 2013 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 78 static int pre_RS(DECL_ARGS); |
|
Line 78 static int pre_RS(DECL_ARGS); |
|
static int pre_SH(DECL_ARGS); |
static int pre_SH(DECL_ARGS); |
static int pre_SS(DECL_ARGS); |
static int pre_SS(DECL_ARGS); |
static int pre_TP(DECL_ARGS); |
static int pre_TP(DECL_ARGS); |
|
static int pre_UR(DECL_ARGS); |
static int pre_alternate(DECL_ARGS); |
static int pre_alternate(DECL_ARGS); |
static int pre_ft(DECL_ARGS); |
static int pre_ft(DECL_ARGS); |
static int pre_ign(DECL_ARGS); |
static int pre_ign(DECL_ARGS); |
Line 91 static void post_RS(DECL_ARGS); |
|
Line 92 static void post_RS(DECL_ARGS); |
|
static void post_SH(DECL_ARGS); |
static void post_SH(DECL_ARGS); |
static void post_SS(DECL_ARGS); |
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 const struct termact termacts[MAN_MAX] = { |
static const struct termact termacts[MAN_MAX] = { |
{ pre_sp, NULL, MAN_NOTEXT }, /* br */ |
{ pre_sp, NULL, MAN_NOTEXT }, /* br */ |
Line 129 static const struct termact termacts[MAN_MAX] = { |
|
Line 131 static const struct termact termacts[MAN_MAX] = { |
|
{ pre_OP, NULL, 0 }, /* OP */ |
{ pre_OP, NULL, 0 }, /* OP */ |
{ pre_literal, NULL, 0 }, /* EX */ |
{ pre_literal, NULL, 0 }, /* EX */ |
{ pre_literal, NULL, 0 }, /* EE */ |
{ pre_literal, NULL, 0 }, /* EE */ |
|
{ pre_UR, post_UR, 0 }, /* UR */ |
|
{ NULL, NULL, 0 }, /* UE */ |
}; |
}; |
|
|
|
|
Line 564 post_HP(DECL_ARGS) |
|
Line 568 post_HP(DECL_ARGS) |
|
|
|
switch (n->type) { |
switch (n->type) { |
case (MAN_BODY): |
case (MAN_BODY): |
term_flushln(p); |
term_newln(p); |
p->flags &= ~TERMP_NOBREAK; |
p->flags &= ~TERMP_NOBREAK; |
p->flags &= ~TERMP_TWOSPACE; |
p->flags &= ~TERMP_TWOSPACE; |
p->offset = mt->offset; |
p->offset = mt->offset; |
Line 675 post_IP(DECL_ARGS) |
|
Line 679 post_IP(DECL_ARGS) |
|
break; |
break; |
case (MAN_BODY): |
case (MAN_BODY): |
term_newln(p); |
term_newln(p); |
|
p->offset = mt->offset; |
break; |
break; |
default: |
default: |
break; |
break; |
Line 762 post_TP(DECL_ARGS) |
|
Line 767 post_TP(DECL_ARGS) |
|
break; |
break; |
case (MAN_BODY): |
case (MAN_BODY): |
term_newln(p); |
term_newln(p); |
|
p->offset = mt->offset; |
break; |
break; |
default: |
default: |
break; |
break; |
Line 939 post_RS(DECL_ARGS) |
|
Line 945 post_RS(DECL_ARGS) |
|
mt->lmargincur = mt->lmarginsz; |
mt->lmargincur = mt->lmarginsz; |
} |
} |
|
|
|
/* ARGSUSED */ |
|
static int |
|
pre_UR(DECL_ARGS) |
|
{ |
|
|
|
return (MAN_HEAD != n->type); |
|
} |
|
|
|
/* ARGSUSED */ |
static void |
static void |
|
post_UR(DECL_ARGS) |
|
{ |
|
|
|
if (MAN_BLOCK != n->type) |
|
return; |
|
|
|
term_word(p, "<"); |
|
p->flags |= TERMP_NOSPACE; |
|
|
|
if (NULL != n->child->child) |
|
print_man_node(p, mt, n->child->child, meta); |
|
|
|
p->flags |= TERMP_NOSPACE; |
|
term_word(p, ">"); |
|
} |
|
|
|
static void |
print_man_node(DECL_ARGS) |
print_man_node(DECL_ARGS) |
{ |
{ |
size_t rm, rmax; |
size_t rm, rmax; |
|
|
* more specific than this. |
* more specific than this. |
*/ |
*/ |
if (MANT_LITERAL & mt->fl && ! (TERMP_NOBREAK & p->flags) && |
if (MANT_LITERAL & mt->fl && ! (TERMP_NOBREAK & p->flags) && |
NULL != n->next && n->next->line > n->line) { |
(NULL == n->next || n->next->line > n->line)) { |
rm = p->rmargin; |
rm = p->rmargin; |
rmax = p->maxrmargin; |
rmax = p->maxrmargin; |
p->rmargin = p->maxrmargin = TERM_MAXMARGIN; |
p->rmargin = p->maxrmargin = TERM_MAXMARGIN; |