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

Diff for /mandoc/mdoc_term.c between version 1.36 and 1.38

version 1.36, 2009/07/12 20:30:35 version 1.38, 2009/07/13 07:23:07
Line 147  static int   termp_ft_pre(DECL_ARGS);
Line 147  static int   termp_ft_pre(DECL_ARGS);
 static  int       termp_ic_pre(DECL_ARGS);  static  int       termp_ic_pre(DECL_ARGS);
 static  int       termp_in_pre(DECL_ARGS);  static  int       termp_in_pre(DECL_ARGS);
 static  int       termp_it_pre(DECL_ARGS);  static  int       termp_it_pre(DECL_ARGS);
 static  int       termp_lb_pre(DECL_ARGS);  
 static  int       termp_lk_pre(DECL_ARGS);  static  int       termp_lk_pre(DECL_ARGS);
 static  int       termp_ms_pre(DECL_ARGS);  static  int       termp_ms_pre(DECL_ARGS);
 static  int       termp_mt_pre(DECL_ARGS);  static  int       termp_mt_pre(DECL_ARGS);
Line 281  static const struct termact termacts[MDOC_MAX] = {
Line 280  static const struct termact termacts[MDOC_MAX] = {
         { NULL, NULL }, /* Hf */          { NULL, NULL }, /* Hf */
         { NULL, NULL }, /* Fr */          { NULL, NULL }, /* Fr */
         { termp_ud_pre, NULL }, /* Ud */          { termp_ud_pre, NULL }, /* Ud */
         { termp_lb_pre, termp_lb_post }, /* Lb */          { NULL, termp_lb_post }, /* Lb */
         { termp_pp_pre, NULL }, /* Lp */          { termp_pp_pre, NULL }, /* Lp */
         { termp_lk_pre, NULL }, /* Lk */          { termp_lk_pre, NULL }, /* Lk */
         { termp_mt_pre, NULL }, /* Mt */          { termp_mt_pre, NULL }, /* Mt */
Line 572  arg_listtype(const struct mdoc_node *n)
Line 571  arg_listtype(const struct mdoc_node *n)
                         /* FALLTHROUGH */                          /* FALLTHROUGH */
                 case (MDOC_Column):                  case (MDOC_Column):
                         /* FALLTHROUGH */                          /* FALLTHROUGH */
                   case (MDOC_Hang):
                           /* FALLTHROUGH */
                 case (MDOC_Ohang):                  case (MDOC_Ohang):
                         return(n->args->argv[i].arg);                          return(n->args->argv[i].arg);
                 default:                  default:
                         break;                          break;
                 }                  }
   
         /* FIXME: mandated by parser. */          return(-1);
   
         errx(1, "list type not supported");  
         /* NOTREACHED */  
 }  }
   
   
Line 727  termp_it_pre(DECL_ARGS)
Line 725  termp_it_pre(DECL_ARGS)
         (void)arg_getattrs(keys, vals, 3, bl);          (void)arg_getattrs(keys, vals, 3, bl);
   
         type = arg_listtype(bl);          type = arg_listtype(bl);
           assert(-1 != type);
   
         /* Calculate real width and offset. */          /* Calculate real width and offset. */
   
Line 753  termp_it_pre(DECL_ARGS)
Line 752  termp_it_pre(DECL_ARGS)
         /*          /*
          * List-type can override the width in the case of fixed-head           * List-type can override the width in the case of fixed-head
          * values (bullet, dash/hyphen, enum).  Tags need a non-zero           * values (bullet, dash/hyphen, enum).  Tags need a non-zero
          * offset.           * offset.  FIXME: double-check that correct.
          */           */
   
         switch (type) {          switch (type) {
Line 769  termp_it_pre(DECL_ARGS)
Line 768  termp_it_pre(DECL_ARGS)
                 if (width < 5)                  if (width < 5)
                         width = 5;                          width = 5;
                 break;                  break;
           case (MDOC_Hang):
                   /* FALLTHROUGH */
         case (MDOC_Tag):          case (MDOC_Tag):
                 if (0 == width)                  if (0 == width)
                         width = 10;                          width = 10;
Line 786  termp_it_pre(DECL_ARGS)
Line 787  termp_it_pre(DECL_ARGS)
         case (MDOC_Diag):          case (MDOC_Diag):
                 term_word(p, "\\ ");                  term_word(p, "\\ ");
                 /* FALLTHROUGH */                  /* FALLTHROUGH */
           case (MDOC_Hang):
                   /* FALLTHROUGH */
         case (MDOC_Inset):          case (MDOC_Inset):
                 if (MDOC_BODY == node->type)                  if (MDOC_BODY == node->type)
                         p->flags &= ~TERMP_NOSPACE;                          p->flags &= ~TERMP_NOSPACE;
Line 827  termp_it_pre(DECL_ARGS)
Line 830  termp_it_pre(DECL_ARGS)
                 /* FALLTHROUGH */                  /* FALLTHROUGH */
         case (MDOC_Hyphen):          case (MDOC_Hyphen):
                 /* FALLTHROUGH */                  /* FALLTHROUGH */
           case (MDOC_Hang):
                   /* FALLTHROUGH */
         case (MDOC_Tag):          case (MDOC_Tag):
                 if (MDOC_HEAD == node->type)                  if (MDOC_HEAD == node->type)
                         p->flags |= TERMP_NOBREAK;                          p->flags |= TERMP_NOBREAK;
                 else                  else
                         p->flags |= TERMP_NOLPAD;                          p->flags |= TERMP_NOLPAD;
   
                   if (MDOC_HEAD == node->type && MDOC_Hang == type)
                           p->flags |= TERMP_NONOBREAK;
   
                 if (MDOC_HEAD == node->type && MDOC_Tag == type)                  if (MDOC_HEAD == node->type && MDOC_Tag == type)
                         if (NULL == node->next ||                          if (NULL == node->next ||
                                         NULL == node->next->child)                                          NULL == node->next->child)
Line 873  termp_it_pre(DECL_ARGS)
Line 882  termp_it_pre(DECL_ARGS)
                 /* FALLTHROUGH */                  /* FALLTHROUGH */
         case (MDOC_Hyphen):          case (MDOC_Hyphen):
                 /* FALLTHROUGH */                  /* FALLTHROUGH */
           case (MDOC_Hang):
                   /* FALLTHROUGH */
         case (MDOC_Tag):          case (MDOC_Tag):
                 if (MDOC_HEAD == node->type)                  if (MDOC_HEAD == node->type)
                         p->rmargin = p->offset + width;                          p->rmargin = p->offset + width;
Line 955  termp_it_post(DECL_ARGS)
Line 966  termp_it_post(DECL_ARGS)
                 return;                  return;
   
         type = arg_listtype(node->parent->parent->parent);          type = arg_listtype(node->parent->parent->parent);
           assert(-1 != type);
   
         switch (type) {          switch (type) {
         case (MDOC_Diag):          case (MDOC_Diag):
Line 1279  termp_bt_pre(DECL_ARGS)
Line 1291  termp_bt_pre(DECL_ARGS)
 {  {
   
         term_word(p, "is currently in beta test.");          term_word(p, "is currently in beta test.");
         return(1);  
 }  
   
   
 /* ARGSUSED */  
 static int  
 termp_lb_pre(DECL_ARGS)  
 {  
         const char      *lb;  
   
         assert(node->child && MDOC_TEXT == node->child->type);  
         lb = mdoc_a2lib(node->child->string);  
         if (lb) {  
                 term_word(p, lb);  
                 return(0);  
         }  
         term_word(p, "library");  
         return(1);          return(1);
 }  }
   

Legend:
Removed from v.1.36  
changed lines
  Added in v.1.38

CVSweb