summaryrefslogtreecommitdiffstats
path: root/man_term.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2009-08-13 12:15:58 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2009-08-13 12:15:58 +0000
commitfb03acbc5fea24978190703b547b408b3fa45664 (patch)
tree324beea82a1a03548cd8704eaf8cc753b83d4ee9 /man_term.c
parent1aa6cc37dcc72475cfe4c2a003d11b606284f790 (diff)
downloadmandoc-fb03acbc5fea24978190703b547b408b3fa45664.tar.gz
Added full `HP' libman macro support.
Diffstat (limited to 'man_term.c')
-rw-r--r--man_term.c37
1 files changed, 35 insertions, 2 deletions
diff --git a/man_term.c b/man_term.c
index b9660797..504f8a7c 100644
--- a/man_term.c
+++ b/man_term.c
@@ -66,6 +66,7 @@ static int pre_sp(DECL_ARGS);
static void post_B(DECL_ARGS);
static void post_I(DECL_ARGS);
+static void post_HP(DECL_ARGS);
static void post_SH(DECL_ARGS);
static void post_SS(DECL_ARGS);
static void post_i(DECL_ARGS);
@@ -80,7 +81,7 @@ static const struct termact termacts[MAN_MAX] = {
{ pre_PP, NULL }, /* PP */
{ pre_PP, NULL }, /* P */
{ pre_IP, NULL }, /* IP */
- { pre_HP, NULL }, /* HP */
+ { pre_HP, post_HP }, /* HP */
{ NULL, NULL }, /* SM */
{ pre_B, post_B }, /* SB */
{ pre_BI, NULL }, /* BI */
@@ -407,12 +408,44 @@ static int
pre_HP(DECL_ARGS)
{
- /* TODO */
+ switch (n->type) {
+ case (MAN_BLOCK):
+ fmt_block_vspace(p, n);
+ break;
+ case (MAN_BODY):
+ p->flags |= TERMP_NOBREAK;
+ p->flags |= TERMP_TWOSPACE;
+ p->offset = INDENT;
+ p->rmargin = INDENT * 2;
+ break;
+ default:
+ return(0);
+ }
+
return(1);
}
/* ARGSUSED */
+static void
+post_HP(DECL_ARGS)
+{
+
+ switch (n->type) {
+ case (MAN_BODY):
+ term_flushln(p);
+ p->flags &= ~TERMP_NOBREAK;
+ p->flags &= ~TERMP_TWOSPACE;
+ p->offset = INDENT;
+ p->rmargin = p->maxrmargin;
+ break;
+ default:
+ break;
+ }
+}
+
+
+/* ARGSUSED */
static int
pre_PP(DECL_ARGS)
{