[BACK]Return to man_term.c CVS log [TXT][DIR] Up to [cvsweb.bsd.lv] / mandoc

Diff for /mandoc/man_term.c between version 1.46 and 1.51

version 1.46, 2009/10/27 08:49:44 version 1.51, 2009/11/10 12:03:30
Line 18 
Line 18 
   
 #include <assert.h>  #include <assert.h>
 #include <ctype.h>  #include <ctype.h>
 #include <err.h>  
 #include <stdio.h>  #include <stdio.h>
 #include <stdlib.h>  #include <stdlib.h>
 #include <string.h>  #include <string.h>
Line 86  static int    pre_BI(DECL_ARGS);
Line 85  static int    pre_BI(DECL_ARGS);
 static  int               pre_HP(DECL_ARGS);  static  int               pre_HP(DECL_ARGS);
 static  int               pre_I(DECL_ARGS);  static  int               pre_I(DECL_ARGS);
 static  int               pre_IP(DECL_ARGS);  static  int               pre_IP(DECL_ARGS);
 static  int               pre_IR(DECL_ARGS);  
 static  int               pre_PP(DECL_ARGS);  static  int               pre_PP(DECL_ARGS);
 static  int               pre_RB(DECL_ARGS);  static  int               pre_RB(DECL_ARGS);
 static  int               pre_RI(DECL_ARGS);  static  int               pre_RI(DECL_ARGS);
Line 131  static const struct termact termacts[MAN_MAX] = {
Line 129  static const struct termact termacts[MAN_MAX] = {
         { NULL, NULL }, /* R */          { NULL, NULL }, /* R */
         { pre_B, post_B }, /* B */          { pre_B, post_B }, /* B */
         { pre_I, post_I }, /* I */          { pre_I, post_I }, /* I */
         { pre_IR, NULL }, /* IR */          { pre_RI, NULL }, /* IR */
         { pre_RI, NULL }, /* RI */          { pre_RI, NULL }, /* RI */
         { NULL, NULL }, /* na */          { NULL, NULL }, /* na */
         { pre_I, post_i }, /* i */          { pre_I, post_i }, /* i */
Line 300  pre_nf(DECL_ARGS)
Line 298  pre_nf(DECL_ARGS)
   
 /* ARGSUSED */  /* ARGSUSED */
 static int  static int
 pre_IR(DECL_ARGS)  
 {  
         const struct man_node *nn;  
         int              i;  
   
         for (i = 0, nn = n->child; nn; nn = nn->next, i++) {  
                 if ( ! (i % 2))  
                         p->under++;  
                 if (i > 0)  
                         p->flags |= TERMP_NOSPACE;  
                 print_man_node(p, mt, nn, m);  
                 if ( ! (i % 2))  
                         p->under--;  
         }  
         return(0);  
 }  
   
   
 /* ARGSUSED */  
 static int  
 pre_RB(DECL_ARGS)  pre_RB(DECL_ARGS)
 {  {
         const struct man_node *nn;          const struct man_node *nn;
Line 353  pre_RI(DECL_ARGS)
Line 331  pre_RI(DECL_ARGS)
         int              i;          int              i;
   
         for (i = 0, nn = n->child; nn; nn = nn->next, i++) {          for (i = 0, nn = n->child; nn; nn = nn->next, i++) {
                 if ( ! (i % 2))                  if (i % 2 && MAN_RI == n->tok)
                         p->under++;                          p->under++;
                   else if ( ! (i % 2) && MAN_RI != n->tok)
                           p->under++;
   
                 if (i > 0)                  if (i > 0)
                         p->flags |= TERMP_NOSPACE;                          p->flags |= TERMP_NOSPACE;
                 print_man_node(p, mt, nn, m);                  print_man_node(p, mt, nn, m);
                 if ( ! (i % 2))  
                   if (i % 2 && MAN_RI == n->tok)
                         p->under--;                          p->under--;
                   else if ( ! (i % 2) && MAN_RI != n->tok)
                           p->under--;
         }          }
         return(0);          return(0);
 }  }
Line 892  print_man_node(DECL_ARGS)
Line 876  print_man_node(DECL_ARGS)
         if (c && n->child)          if (c && n->child)
                 print_man_body(p, mt, n->child, m);                  print_man_body(p, mt, n->child, m);
   
         if (MAN_TEXT != n->type)          if (MAN_TEXT != n->type) {
                 if (termacts[n->tok].post)                  if (termacts[n->tok].post)
                         (*termacts[n->tok].post)(p, mt, n, m);                          (*termacts[n->tok].post)(p, mt, n, m);
   
                   /* Reset metafont upon exit from macro. */
                   p->metafont = 0;
           }
 }  }
   
   
Line 913  static void
Line 901  static void
 print_man_foot(struct termp *p, const struct man_meta *meta)  print_man_foot(struct termp *p, const struct man_meta *meta)
 {  {
         char            buf[DATESIZ];          char            buf[DATESIZ];
   
           p->metafont = 0;
   
         time2a(meta->date, buf, DATESIZ);          time2a(meta->date, buf, DATESIZ);
   

Legend:
Removed from v.1.46  
changed lines
  Added in v.1.51

CVSweb