-/* $Id: man_term.c,v 1.97 2011/01/12 15:23:25 kristaps Exp $ */
+/* $Id: man_term.c,v 1.105 2011/03/22 10:13:01 kristaps Exp $ */
/*
- * Copyright (c) 2008, 2009, 2010 Kristaps Dzonsons <kristaps@bsd.lv>
+ * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010, 2011 Ingo Schwarze <schwarze@openbsd.org>
*
* Permission to use, copy, modify, and distribute this software for any
#include "out.h"
#include "man.h"
#include "term.h"
-#include "chars.h"
#include "main.h"
#define INDENT 7
{ pre_I, NULL, 0 }, /* I */
{ pre_alternate, NULL, 0 }, /* IR */
{ pre_alternate, NULL, 0 }, /* RI */
- { NULL, NULL, MAN_NOTEXT }, /* na */
+ { pre_ign, NULL, MAN_NOTEXT }, /* na */
{ pre_sp, NULL, MAN_NOTEXT }, /* sp */
{ pre_literal, NULL, 0 }, /* nf */
{ pre_literal, NULL, 0 }, /* fi */
{
term_newln(p);
+ if (n->body && n->body->child && MAN_TBL == n->body->child->type)
+ return;
+
if (NULL == n->prev)
return;
else
mt->fl &= ~MANT_LITERAL;
- return(1);
+ return(0);
}
/* ARGSUSED */
*/
if ('\0' == *n->string) {
term_vspace(p);
- break;
+ return;
} else if (' ' == *n->string && MAN_LINE & n->flags)
term_newln(p);
p->rmargin = rm;
p->maxrmargin = rmax;
}
+
+ if (MAN_EOS & n->flags)
+ p->flags |= TERMP_SENTENCE;
+ return;
+ case (MAN_EQN):
+ term_word(p, n->eqn->data);
return;
case (MAN_TBL):
/*
static void
print_man_foot(struct termp *p, const void *arg)
{
- char buf[DATESIZ];
const struct man_meta *meta;
meta = (const struct man_meta *)arg;
term_fontrepl(p, TERMFONT_NONE);
- if (meta->rawdate)
- strlcpy(buf, meta->rawdate, DATESIZ);
- else
- time2a(meta->date, buf, DATESIZ);
-
term_vspace(p);
term_vspace(p);
term_vspace(p);
p->flags |= TERMP_NOSPACE | TERMP_NOBREAK;
- p->rmargin = p->maxrmargin - term_strlen(p, buf);
+ p->rmargin = p->maxrmargin - term_strlen(p, meta->date);
p->offset = 0;
/* term_strlen() can return zero. */
p->rmargin = p->maxrmargin;
p->flags &= ~TERMP_NOBREAK;
- term_word(p, buf);
+ term_word(p, meta->date);
term_flushln(p);
}