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

Diff for /mandoc/term.c between version 1.39 and 1.43

version 1.39, 2009/03/04 13:57:35 version 1.43, 2009/03/06 14:13:47
Line 166  DECL_PRE(termp_xr);
Line 166  DECL_PRE(termp_xr);
 DECL_POST(termp___);  DECL_POST(termp___);
 DECL_POST(termp_bl);  DECL_POST(termp_bl);
 DECL_POST(termp_bx);  DECL_POST(termp_bx);
   DECL_POST(termp_lb);
   
 const   struct termact __termacts[MDOC_MAX] = {  const   struct termact __termacts[MDOC_MAX] = {
         { NULL, NULL }, /* \" */          { NULL, NULL }, /* \" */
Line 274  const struct termact __termacts[MDOC_MAX] = {
Line 275  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 */
           { NULL, termp_lb_post }, /* lb */
 };  };
   
 const struct termact *termacts = __termacts;  const struct termact *termacts = __termacts;
Line 295  arg_width(const struct mdoc_arg *arg)
Line 297  arg_width(const struct mdoc_arg *arg)
         assert(len > 0);          assert(len > 0);
   
         for (i = 0; i < len - 1; i++)          for (i = 0; i < len - 1; i++)
                 if ( ! isdigit((int)(*arg->value)[i]))                  if ( ! isdigit((u_char)(*arg->value)[i]))
                         break;                          break;
   
         if (i == len - 1) {          if (i == len - 1) {
Line 536  termp_it_pre(DECL_ARGS)
Line 538  termp_it_pre(DECL_ARGS)
                         p->flags |= TERMP_NOBREAK;                          p->flags |= TERMP_NOBREAK;
                 else                  else
                         p->flags |= TERMP_NOLPAD;                          p->flags |= TERMP_NOLPAD;
                   if (MDOC_HEAD == node->type && MDOC_Tag == type)
                           if (NULL == node->next ||
                                           NULL == node->next->child)
                                   p->flags |= TERMP_NONOBREAK;
                 break;                  break;
         case (MDOC_Diag):          case (MDOC_Diag):
                 if (MDOC_HEAD == node->type)                  if (MDOC_HEAD == node->type)
Line 689  termp_ar_pre(DECL_ARGS)
Line 695  termp_ar_pre(DECL_ARGS)
 {  {
   
         TERMPAIR_SETFLAG(p, pair, ttypes[TTYPE_CMD_ARG]);          TERMPAIR_SETFLAG(p, pair, ttypes[TTYPE_CMD_ARG]);
         if (NULL == node->child) {  
                 word(p, "file");  
                 word(p, "...");  
         }  
         return(1);          return(1);
 }  }
   
Line 721  termp_pp_pre(DECL_ARGS)
Line 723  termp_pp_pre(DECL_ARGS)
 static int  static int
 termp_st_pre(DECL_ARGS)  termp_st_pre(DECL_ARGS)
 {  {
         const char      *tp;          const char      *cp;
   
         assert(1 == node->data.elem.argc);          /* XXX - if child isn't text? */
           if (node->child)
         tp = mdoc_st2a(node->data.elem.argv[0].arg);                  if ((cp = mdoc_a2st(node->child->data.text.string)))
         word(p, tp);                          word(p, cp);
           return(0);
         return(1);  
 }  }
   
   
Line 968  termp_bt_pre(DECL_ARGS)
Line 969  termp_bt_pre(DECL_ARGS)
   
   
 /* ARGSUSED */  /* ARGSUSED */
   static void
   termp_lb_post(DECL_ARGS)
   {
   
           newln(p);
   }
   
   
   /* ARGSUSED */
 static int  static int
 termp_ud_pre(DECL_ARGS)  termp_ud_pre(DECL_ARGS)
 {  {
Line 1009  termp_aq_pre(DECL_ARGS)
Line 1019  termp_aq_pre(DECL_ARGS)
   
         if (MDOC_BODY != node->type)          if (MDOC_BODY != node->type)
                 return(1);                  return(1);
         word(p, "<");          word(p, "\\(la");
         p->flags |= TERMP_NOSPACE;          p->flags |= TERMP_NOSPACE;
         return(1);          return(1);
 }  }
Line 1023  termp_aq_post(DECL_ARGS)
Line 1033  termp_aq_post(DECL_ARGS)
         if (MDOC_BODY != node->type)          if (MDOC_BODY != node->type)
                 return;                  return;
         p->flags |= TERMP_NOSPACE;          p->flags |= TERMP_NOSPACE;
         word(p, ">");          word(p, "\\(ra");
 }  }
   
   
Line 1480  termp_in_post(DECL_ARGS)
Line 1490  termp_in_post(DECL_ARGS)
 static int  static int
 termp_at_pre(DECL_ARGS)  termp_at_pre(DECL_ARGS)
 {  {
         enum mdoc_att    c;          const char      *att;
   
         c = ATT_DEFAULT;          att = NULL;
   
         if (node->child) {          if (node->child) {
                 assert(MDOC_TEXT == node->child->type);                  assert(MDOC_TEXT == node->child->type);
                 c = mdoc_atoatt(node->child->data.text.string);                  att = mdoc_a2att(node->child->data.text.string);
         }          }
   
         word(p, mdoc_att2a(c));          if (NULL == att)
                   att = "AT&T UNIX";
   
           word(p, att);
         return(0);          return(0);
 }  }
   
Line 1662  static int
Line 1676  static int
 termp__t_pre(DECL_ARGS)  termp__t_pre(DECL_ARGS)
 {  {
   
           /* FIXME: titles are underlined. */
         word(p, "\"");          word(p, "\"");
         p->flags |= TERMP_NOSPACE;          p->flags |= TERMP_NOSPACE;
         return(1);          return(1);
Line 1674  termp__t_post(DECL_ARGS)
Line 1689  termp__t_post(DECL_ARGS)
 {  {
   
         p->flags |= TERMP_NOSPACE;          p->flags |= TERMP_NOSPACE;
           /* FIXME: titles are underlined. */
         word(p, "\"");          word(p, "\"");
         word(p, node->next ? "," : ".");          word(p, node->next ? "," : ".");
 }  }

Legend:
Removed from v.1.39  
changed lines
  Added in v.1.43

CVSweb