version 1.39, 2009/10/18 13:34:16 |
version 1.42, 2009/10/21 03:31:49 |
|
|
#include <stdlib.h> |
#include <stdlib.h> |
#include <string.h> |
#include <string.h> |
|
|
|
#include "out.h" |
#include "man.h" |
#include "man.h" |
#include "term.h" |
#include "term.h" |
#include "chars.h" |
#include "chars.h" |
Line 183 terminal_man(void *arg, const struct man *man) |
|
Line 184 terminal_man(void *arg, const struct man *man) |
|
static int |
static int |
arg2height(const struct man_node *n) |
arg2height(const struct man_node *n) |
{ |
{ |
int r; |
struct roffsu su; |
|
|
assert(MAN_TEXT == n->type); |
assert(MAN_TEXT == n->type); |
assert(n->string); |
assert(n->string); |
|
if ( ! a2roffsu(n->string, &su, SCALE_VS)) |
|
SCALE_VS_INIT(&su, strlen(n->string)); |
|
|
if ((r = a2height(n->string)) < 0) |
return((int)term_vspan(&su)); |
return(1); |
|
|
|
return(r); |
|
} |
} |
|
|
|
|
static int |
static int |
arg2width(const struct man_node *n) |
arg2width(const struct man_node *n) |
{ |
{ |
|
struct roffsu su; |
|
|
assert(MAN_TEXT == n->type); |
assert(MAN_TEXT == n->type); |
assert(n->string); |
assert(n->string); |
return(a2width(n->string)); |
if ( ! a2roffsu(n->string, &su, SCALE_BU)) |
|
return(-1); |
|
|
|
return((int)term_hspan(&su)); |
} |
} |
|
|
|
|
Line 910 print_foot(struct termp *p, const struct man_meta *met |
|
Line 914 print_foot(struct termp *p, const struct man_meta *met |
|
|
|
tm = localtime(&meta->date); |
tm = localtime(&meta->date); |
|
|
if (0 == strftime(buf, p->rmargin, "%B %d, %Y", tm)) |
if (0 == strftime(buf, p->rmargin, "%B %e, %Y", tm)) |
(void)strlcpy(buf, "(invalid date)", BUFSIZ); |
(void)strlcpy(buf, "(invalid date)", BUFSIZ); |
|
|
term_vspace(p); |
term_vspace(p); |