=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/mandoc/man_term.c,v retrieving revision 1.88 retrieving revision 1.89 diff -c -r1.88 -r1.89 *** src/usr.bin/mandoc/man_term.c 2012/07/29 12:35:05 1.88 --- src/usr.bin/mandoc/man_term.c 2012/11/17 00:25:20 1.89 *************** *** 1,4 **** ! /* $Id: man_term.c,v 1.88 2012/07/29 12:35:05 schwarze Exp $ */ /* * Copyright (c) 2008-2012 Kristaps Dzonsons * Copyright (c) 2010, 2011, 2012 Ingo Schwarze --- 1,4 ---- ! /* $Id: man_term.c,v 1.89 2012/11/17 00:25:20 schwarze Exp $ */ /* * Copyright (c) 2008-2012 Kristaps Dzonsons * Copyright (c) 2010, 2011, 2012 Ingo Schwarze *************** *** 44,50 **** #define DECL_ARGS struct termp *p, \ struct mtermp *mt, \ const struct man_node *n, \ ! const struct man_meta *m struct termact { int (*pre)(DECL_ARGS); --- 44,50 ---- #define DECL_ARGS struct termp *p, \ struct mtermp *mt, \ const struct man_node *n, \ ! const struct man_meta *meta struct termact { int (*pre)(DECL_ARGS); *************** *** 134,140 **** { struct termp *p; const struct man_node *n; ! const struct man_meta *m; struct mtermp mt; p = (struct termp *)arg; --- 134,140 ---- { struct termp *p; const struct man_node *n; ! const struct man_meta *meta; struct mtermp mt; p = (struct termp *)arg; *************** *** 150,158 **** p->symtab = mchars_alloc(); n = man_node(man); ! m = man_meta(man); ! term_begin(p, print_man_head, print_man_foot, m); p->flags |= TERMP_NOSPACE; memset(&mt, 0, sizeof(struct mtermp)); --- 150,158 ---- p->symtab = mchars_alloc(); n = man_node(man); ! meta = man_meta(man); ! term_begin(p, print_man_head, print_man_foot, meta); p->flags |= TERMP_NOSPACE; memset(&mt, 0, sizeof(struct mtermp)); *************** *** 162,168 **** mt.pardist = 1; if (n->child) ! print_man_nodelist(p, &mt, n->child, m); term_end(p); } --- 162,168 ---- mt.pardist = 1; if (n->child) ! print_man_nodelist(p, &mt, n->child, meta); term_end(p); } *************** *** 323,329 **** term_fontrepl(p, font[i]); if (savelit && NULL == nn->next) mt->fl |= MANT_LITERAL; ! print_man_node(p, mt, nn, m); if (nn->next) p->flags |= TERMP_NOSPACE; } --- 323,329 ---- term_fontrepl(p, font[i]); if (savelit && NULL == nn->next) mt->fl |= MANT_LITERAL; ! print_man_node(p, mt, nn, meta); if (nn->next) p->flags |= TERMP_NOSPACE; } *************** *** 640,646 **** mt->fl &= ~MANT_LITERAL; if (n->child) ! print_man_node(p, mt, n->child, m); if (savelit) mt->fl |= MANT_LITERAL; --- 640,646 ---- mt->fl &= ~MANT_LITERAL; if (n->child) ! print_man_node(p, mt, n->child, meta); if (savelit) mt->fl |= MANT_LITERAL; *************** *** 725,731 **** /* Don't print same-line elements. */ for (nn = n->child; nn; nn = nn->next) if (nn->line > n->line) ! print_man_node(p, mt, nn, m); if (savelit) mt->fl |= MANT_LITERAL; --- 725,731 ---- /* Don't print same-line elements. */ for (nn = n->child; nn; nn = nn->next) if (nn->line > n->line) ! print_man_node(p, mt, nn, meta); if (savelit) mt->fl |= MANT_LITERAL; *************** *** 978,990 **** c = 1; if (termacts[n->tok].pre) ! c = (*termacts[n->tok].pre)(p, mt, n, m); if (c && n->child) ! print_man_nodelist(p, mt, n->child, m); if (termacts[n->tok].post) ! (*termacts[n->tok].post)(p, mt, n, m); if ( ! (MAN_NOTEXT & termacts[n->tok].flags)) term_fontrepl(p, TERMFONT_NONE); --- 978,990 ---- c = 1; if (termacts[n->tok].pre) ! c = (*termacts[n->tok].pre)(p, mt, n, meta); if (c && n->child) ! print_man_nodelist(p, mt, n->child, meta); if (termacts[n->tok].post) ! (*termacts[n->tok].post)(p, mt, n, meta); if ( ! (MAN_NOTEXT & termacts[n->tok].flags)) term_fontrepl(p, TERMFONT_NONE); *************** *** 1022,1031 **** print_man_nodelist(DECL_ARGS) { ! print_man_node(p, mt, n, m); if ( ! n->next) return; ! print_man_nodelist(p, mt, n->next, m); } --- 1022,1031 ---- print_man_nodelist(DECL_ARGS) { ! print_man_node(p, mt, n, meta); if ( ! n->next) return; ! print_man_nodelist(p, mt, n->next, meta); } *************** *** 1100,1120 **** { char buf[BUFSIZ], title[BUFSIZ]; size_t buflen, titlen; ! const struct man_meta *m; ! m = (const struct man_meta *)arg; ! assert(m->title); ! assert(m->msec); ! if (m->vol) ! strlcpy(buf, m->vol, BUFSIZ); else buf[0] = '\0'; buflen = term_strlen(p, buf); /* Top left corner: manual title and section. */ ! snprintf(title, BUFSIZ, "%s(%s)", m->title, m->msec); titlen = term_strlen(p, title); p->flags |= TERMP_NOBREAK | TERMP_NOSPACE; --- 1100,1120 ---- { char buf[BUFSIZ], title[BUFSIZ]; size_t buflen, titlen; ! const struct man_meta *meta; ! meta = (const struct man_meta *)arg; ! assert(meta->title); ! assert(meta->msec); ! if (meta->vol) ! strlcpy(buf, meta->vol, BUFSIZ); else buf[0] = '\0'; buflen = term_strlen(p, buf); /* Top left corner: manual title and section. */ ! snprintf(title, BUFSIZ, "%s(%s)", meta->title, meta->msec); titlen = term_strlen(p, title); p->flags |= TERMP_NOBREAK | TERMP_NOSPACE;