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

Diff for /mandoc/Attic/termact.c between version 1.1 and 1.2

version 1.1, 2009/02/21 19:05:28 version 1.2, 2009/02/21 21:00:06
Line 56  static int    arg_getattr(int, size_t, 
Line 56  static int    arg_getattr(int, size_t, 
         const struct mdoc_meta *meta, \          const struct mdoc_meta *meta, \
         const struct mdoc_node *node          const struct mdoc_node *node
   
 #define DECL_PREPOST(name, suffix) \  #define DECL_PRE(name) \
 static int                name##_##suffix(DECL_ARGS)  static  int               name##_pre(DECL_ARGS)
   #define DECL_POST(name) \
   static  void              name##_post(DECL_ARGS)
   
 #define DECL_PRE(name)    DECL_PREPOST(name, pre)  
 #define DECL_POST(name)   DECL_PREPOST(name, post)  
   
 DECL_PRE(termp_aq);  DECL_PRE(termp_aq);
 DECL_PRE(termp_ar);  DECL_PRE(termp_ar);
 DECL_PRE(termp_d1);  DECL_PRE(termp_d1);
Line 216  termp_dq_pre(DECL_ARGS)
Line 215  termp_dq_pre(DECL_ARGS)
   
   
 /* ARGSUSED */  /* ARGSUSED */
 static int  static void
 termp_dq_post(DECL_ARGS)  termp_dq_post(DECL_ARGS)
 {  {
   
         if (MDOC_BODY != node->type)          if (MDOC_BODY != node->type)
                 return(1);                  return;
   
         p->flags |= TERMP_NOSPACE;          p->flags |= TERMP_NOSPACE;
         word(p, "''");          word(p, "''");
         return(1);  
 }  }
   
   
 /* ARGSUSED */  /* ARGSUSED */
 static int  static void
 termp_it_post(DECL_ARGS)  termp_it_post(DECL_ARGS)
 {  {
         const struct mdoc_node *n, *it;          const struct mdoc_node *n, *it;
Line 251  termp_it_post(DECL_ARGS)
Line 249  termp_it_post(DECL_ARGS)
         case (MDOC_HEAD):          case (MDOC_HEAD):
                 break;                  break;
         default:          default:
                 return(1);                  return;
         }          }
   
         it = node->parent;          it = node->parent;
Line 283  termp_it_post(DECL_ARGS)
Line 281  termp_it_post(DECL_ARGS)
                         p->flags &= ~TERMP_NOLPAD;                          p->flags &= ~TERMP_NOLPAD;
                 }                  }
         }          }
   
         return(1);  
 }  }
   
   
Line 362  termp_it_pre(DECL_ARGS)
Line 358  termp_it_pre(DECL_ARGS)
   
   
 /* ARGSUSED */  /* ARGSUSED */
 static int  static void
 termp_nm_post(DECL_ARGS)  termp_nm_post(DECL_ARGS)
 {  {
   
         p->flags &= ~ttypes[TTYPE_PROG];          p->flags &= ~ttypes[TTYPE_PROG];
         return(1);  
 }  }
   
   
 /* ARGSUSED */  /* ARGSUSED */
 static int  static void
 termp_fl_post(DECL_ARGS)  termp_fl_post(DECL_ARGS)
 {  {
   
         p->flags &= ~ttypes[TTYPE_CMD_FLAG];          p->flags &= ~ttypes[TTYPE_CMD_FLAG];
         return(1);  
 }  }
   
   
Line 426  termp_pp_pre(DECL_ARGS)
Line 420  termp_pp_pre(DECL_ARGS)
   
   
 /* ARGSUSED */  /* ARGSUSED */
 static int  static void
 termp_ar_post(DECL_ARGS)  termp_ar_post(DECL_ARGS)
 {  {
   
         p->flags &= ~ttypes[TTYPE_CMD_ARG];          p->flags &= ~ttypes[TTYPE_CMD_ARG];
         return(1);  
 }  }
   
   
Line 466  termp_nd_pre(DECL_ARGS)
Line 459  termp_nd_pre(DECL_ARGS)
   
   
 /* ARGSUSED */  /* ARGSUSED */
 static int  static void
 termp_bl_post(DECL_ARGS)  termp_bl_post(DECL_ARGS)
 {  {
   
         switch (node->type) {          if (MDOC_BLOCK == node->type)
         case (MDOC_BLOCK):  
                 newln(p);                  newln(p);
                 break;  
         default:  
                 break;  
         }  
         return(1);  
 }  }
   
   
 /* ARGSUSED */  /* ARGSUSED */
 static int  static void
 termp_op_post(DECL_ARGS)  termp_op_post(DECL_ARGS)
 {  {
   
         switch (node->type) {          if (MDOC_BODY != node->type)
         case (MDOC_BODY):                  return;
                 p->flags |= TERMP_NOSPACE;          p->flags |= TERMP_NOSPACE;
                 word(p, "\\]");          word(p, "\\(rB");
                 break;  
         default:  
                 break;  
         }  
         return(1);  
 }  }
   
   
 /* ARGSUSED */  /* ARGSUSED */
 static int  static void
 termp_sh_post(DECL_ARGS)  termp_sh_post(DECL_ARGS)
 {  {
   
Line 515  termp_sh_post(DECL_ARGS)
Line 497  termp_sh_post(DECL_ARGS)
         default:          default:
                 break;                  break;
         }          }
         return(1);  
 }  }
   
   
Line 536  termp_xr_pre(DECL_ARGS)
Line 517  termp_xr_pre(DECL_ARGS)
   
         assert(MDOC_TEXT == n->type);          assert(MDOC_TEXT == n->type);
         p->flags |= TERMP_NOSPACE;          p->flags |= TERMP_NOSPACE;
         word(p, "\\(");          word(p, "(");
         p->flags |= TERMP_NOSPACE;          p->flags |= TERMP_NOSPACE;
         word(p, n->data.text.string);          word(p, n->data.text.string);
         p->flags |= TERMP_NOSPACE;          p->flags |= TERMP_NOSPACE;
         word(p, "\\)");          word(p, ")");
   
         return(0);          return(0);
 }  }
Line 573  termp_op_pre(DECL_ARGS)
Line 554  termp_op_pre(DECL_ARGS)
   
         switch (node->type) {          switch (node->type) {
         case (MDOC_BODY):          case (MDOC_BODY):
                 word(p, "\\[");                  word(p, "\\(lB");
                 p->flags |= TERMP_NOSPACE;                  p->flags |= TERMP_NOSPACE;
                 break;                  break;
         default:          default:
Line 619  termp_d1_pre(DECL_ARGS)
Line 600  termp_d1_pre(DECL_ARGS)
   
   
 /* ARGSUSED */  /* ARGSUSED */
 static int  static void
 termp_d1_post(DECL_ARGS)  termp_d1_post(DECL_ARGS)
 {  {
   
         if (MDOC_BODY != node->type)          if (MDOC_BODY != node->type)
                 return(1);                  return;
         newln(p);          newln(p);
         p->offset -= 4;          p->offset -= 4;
         return(1);  
 }  }
   
   
Line 645  termp_aq_pre(DECL_ARGS)
Line 625  termp_aq_pre(DECL_ARGS)
   
   
 /* ARGSUSED */  /* ARGSUSED */
 static int  static void
 termp_aq_post(DECL_ARGS)  termp_aq_post(DECL_ARGS)
 {  {
   
         if (MDOC_BODY != node->type)          if (MDOC_BODY != node->type)
                 return(1);                  return;
         p->flags |= TERMP_NOSPACE;          p->flags |= TERMP_NOSPACE;
         word(p, "\\>");          word(p, "\\>");
         return(1);  
 }  }
   
   

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

CVSweb