From dbcb21471c73a93f9436d4a342a5cc07d74fbf47 Mon Sep 17 00:00:00 2001 From: Kristaps Dzonsons Date: Wed, 9 Jun 2010 08:07:13 +0000 Subject: Have the standard manpage header and footer print on every page of -Tps output. This is more tricky than you may think: we can't just call the header function out-of-state (i.e., before a flushln has occured) because we'd clobber our current state. Thus, we call at the beginning and dump the output into an auxiliary buffer. For the record, I don't think there's any other clean way to do this. The only other Way That Works is to copy-aside *all* termp state, zero it, and do the necessary headf/footf. This is just as complex, as memory needs to be alloc'd and free'd per margin. Unfortunately, this prohibits page numbering (the margin is only printed once), so I'll probably end up re-writing this down the line. --- man_term.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'man_term.c') diff --git a/man_term.c b/man_term.c index a7a1a652..bde3aa07 100644 --- a/man_term.c +++ b/man_term.c @@ -1,4 +1,4 @@ -/* $Id: man_term.c,v 1.73 2010/06/07 20:57:09 kristaps Exp $ */ +/* $Id: man_term.c,v 1.74 2010/06/09 08:07:13 kristaps Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons * @@ -73,9 +73,9 @@ struct termact { static int a2width(const struct man_node *); static int a2height(const struct man_node *); -static void print_man_head(struct termp *, const void *); static void print_man_nodelist(DECL_ARGS); static void print_man_node(DECL_ARGS); +static void print_man_head(struct termp *, const void *); static void print_man_foot(struct termp *, const void *); static void print_bvspace(struct termp *, const struct man_node *); -- cgit v1.2.3-56-ge451