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

Diff for /mandoc/term.c between version 1.14 and 1.16

version 1.14, 2009/02/24 14:52:55 version 1.16, 2009/02/24 16:16:45
Line 103  DECL_POST(name);
Line 103  DECL_POST(name);
 DECL_PREPOST(termp_aq);  DECL_PREPOST(termp_aq);
 DECL_PREPOST(termp_ar);  DECL_PREPOST(termp_ar);
 DECL_PREPOST(termp_bd);  DECL_PREPOST(termp_bd);
   DECL_PREPOST(termp_bq);
 DECL_PREPOST(termp_cd);  DECL_PREPOST(termp_cd);
 DECL_PREPOST(termp_cm);  DECL_PREPOST(termp_cm);
 DECL_PREPOST(termp_d1);  DECL_PREPOST(termp_d1);
Line 112  DECL_PREPOST(termp_fa);
Line 113  DECL_PREPOST(termp_fa);
 DECL_PREPOST(termp_fd);  DECL_PREPOST(termp_fd);
 DECL_PREPOST(termp_fl);  DECL_PREPOST(termp_fl);
 DECL_PREPOST(termp_fn);  DECL_PREPOST(termp_fn);
   DECL_PREPOST(termp_fo);
 DECL_PREPOST(termp_ft);  DECL_PREPOST(termp_ft);
 DECL_PREPOST(termp_ic);  DECL_PREPOST(termp_ic);
 DECL_PREPOST(termp_in);  DECL_PREPOST(termp_in);
Line 120  DECL_PREPOST(termp_nm);
Line 122  DECL_PREPOST(termp_nm);
 DECL_PREPOST(termp_op);  DECL_PREPOST(termp_op);
 DECL_PREPOST(termp_pa);  DECL_PREPOST(termp_pa);
 DECL_PREPOST(termp_pf);  DECL_PREPOST(termp_pf);
 DECL_PREPOST(termp_qo);  DECL_PREPOST(termp_pq);
 DECL_PREPOST(termp_qq);  DECL_PREPOST(termp_qq);
 DECL_PREPOST(termp_sh);  DECL_PREPOST(termp_sh);
 DECL_PREPOST(termp_ss);  DECL_PREPOST(termp_ss);
Line 130  DECL_PREPOST(termp_va);
Line 132  DECL_PREPOST(termp_va);
 DECL_PREPOST(termp_vt);  DECL_PREPOST(termp_vt);
   
 DECL_PRE(termp_at);  DECL_PRE(termp_at);
   DECL_PRE(termp_bsx);
 DECL_PRE(termp_bx);  DECL_PRE(termp_bx);
 DECL_PRE(termp_ex);  DECL_PRE(termp_ex);
   DECL_PRE(termp_fx);
 DECL_PRE(termp_nd);  DECL_PRE(termp_nd);
 DECL_PRE(termp_ns);  DECL_PRE(termp_ns);
 DECL_PRE(termp_nx);  DECL_PRE(termp_nx);
Line 140  DECL_PRE(termp_pp);
Line 144  DECL_PRE(termp_pp);
 DECL_PRE(termp_rv);  DECL_PRE(termp_rv);
 DECL_PRE(termp_st);  DECL_PRE(termp_st);
 DECL_PRE(termp_ud);  DECL_PRE(termp_ud);
   DECL_PRE(termp_ux);
 DECL_PRE(termp_xr);  DECL_PRE(termp_xr);
   
 DECL_POST(termp_bl);  DECL_POST(termp_bl);
Line 203  const struct termact __termacts[MDOC_MAX] = {
Line 208  const struct termact __termacts[MDOC_MAX] = {
         { termp_at_pre, NULL }, /* At */          { termp_at_pre, NULL }, /* At */
         { NULL, NULL }, /* Bc */          { NULL, NULL }, /* Bc */
         { NULL, NULL }, /* Bf */          { NULL, NULL }, /* Bf */
         { NULL, NULL }, /* Bo */          { termp_bq_pre, termp_bq_post }, /* Bo */
         { NULL, NULL }, /* Bq */          { termp_bq_pre, termp_bq_post }, /* Bq */
         { NULL, NULL }, /* Bsx */          { termp_bsx_pre, NULL }, /* Bsx */
         { termp_bx_pre, NULL }, /* Bx */          { termp_bx_pre, NULL }, /* Bx */
         { NULL, NULL }, /* Db */          { NULL, NULL }, /* Db */
         { NULL, NULL }, /* Dc */          { NULL, NULL }, /* Dc */
         { NULL, NULL }, /* Do */          { termp_dq_pre, termp_dq_post }, /* Do */
         { termp_dq_pre, termp_dq_post }, /* Dq */          { termp_dq_pre, termp_dq_post }, /* Dq */
         { NULL, NULL }, /* Ec */          { NULL, NULL }, /* Ec */
         { NULL, NULL }, /* Ef */          { NULL, NULL }, /* Ef */
         { termp_em_pre, termp_em_post }, /* Em */          { termp_em_pre, termp_em_post }, /* Em */
         { NULL, NULL }, /* Eo */          { NULL, NULL }, /* Eo */
         { NULL, NULL }, /* Fx */          { termp_fx_pre, NULL }, /* Fx */
         { NULL, NULL }, /* Ms */          { NULL, NULL }, /* Ms */
         { NULL, NULL }, /* No */          { NULL, NULL }, /* No */
         { termp_ns_pre, NULL }, /* Ns */          { termp_ns_pre, NULL }, /* Ns */
Line 223  const struct termact __termacts[MDOC_MAX] = {
Line 228  const struct termact __termacts[MDOC_MAX] = {
         { termp_ox_pre, NULL }, /* Ox */          { termp_ox_pre, NULL }, /* Ox */
         { NULL, NULL }, /* Pc */          { NULL, NULL }, /* Pc */
         { termp_pf_pre, termp_pf_post }, /* Pf */          { termp_pf_pre, termp_pf_post }, /* Pf */
         { NULL, NULL }, /* Po */          { termp_pq_pre, termp_pq_post }, /* Po */
         { NULL, NULL }, /* Pq */          { termp_pq_pre, termp_pq_post }, /* Pq */
         { NULL, NULL }, /* Qc */          { NULL, NULL }, /* Qc */
         { NULL, NULL }, /* Ql */          { termp_sq_pre, termp_sq_post }, /* Ql */
         { termp_qo_pre, termp_qo_post }, /* Qo */          { termp_qq_pre, termp_qq_post }, /* Qo */
         { termp_qq_pre, termp_qq_post }, /* Qq */          { termp_qq_pre, termp_qq_post }, /* Qq */
         { NULL, NULL }, /* Re */          { NULL, NULL }, /* Re */
         { NULL, NULL }, /* Rs */          { NULL, NULL }, /* Rs */
         { NULL, NULL }, /* Sc */          { NULL, NULL }, /* Sc */
         { NULL, NULL }, /* So */          { termp_sq_pre, termp_sq_post }, /* So */
         { termp_sq_pre, termp_sq_post }, /* Sq */          { termp_sq_pre, termp_sq_post }, /* Sq */
         { NULL, NULL }, /* Sm */          { NULL, NULL }, /* Sm */
         { termp_sx_pre, termp_sx_post }, /* Sx */          { termp_sx_pre, termp_sx_post }, /* Sx */
         { NULL, NULL }, /* Sy */          { NULL, NULL }, /* Sy */
         { NULL, NULL }, /* Tn */          { NULL, NULL }, /* Tn */
         { NULL, NULL }, /* Ux */          { termp_ux_pre, NULL }, /* Ux */
         { NULL, NULL }, /* Xc */          { NULL, NULL }, /* Xc */
         { NULL, NULL }, /* Xo */          { NULL, NULL }, /* Xo */
         { NULL, NULL }, /* Fo */          { termp_fo_pre, termp_fo_post }, /* Fo */
         { NULL, NULL }, /* Fc */          { NULL, NULL }, /* Fc */
         { NULL, NULL }, /* Oo */          { termp_op_pre, termp_op_post }, /* Oo */
         { NULL, NULL }, /* Oc */          { NULL, NULL }, /* Oc */
         { NULL, NULL }, /* Bk */          { NULL, NULL }, /* Bk */
         { NULL, NULL }, /* Ek */          { NULL, NULL }, /* Ek */
Line 895  termp_fn_pre(DECL_ARGS)
Line 900  termp_fn_pre(DECL_ARGS)
         word(p, node->child->data.text.string);          word(p, node->child->data.text.string);
         p->flags &= ~ttypes[TTYPE_FUNC_NAME];          p->flags &= ~ttypes[TTYPE_FUNC_NAME];
   
         p->flags |= TERMP_NOSPACE;  
         word(p, "(");          word(p, "(");
   
         p->flags |= TERMP_NOSPACE;          p->flags |= TERMP_NOSPACE;
Line 904  termp_fn_pre(DECL_ARGS)
Line 908  termp_fn_pre(DECL_ARGS)
                 p->flags |= ttypes[TTYPE_FUNC_ARG];                  p->flags |= ttypes[TTYPE_FUNC_ARG];
                 word(p, n->data.text.string);                  word(p, n->data.text.string);
                 p->flags &= ~ttypes[TTYPE_FUNC_ARG];                  p->flags &= ~ttypes[TTYPE_FUNC_ARG];
                 if ((n->next))                  if (n->next)
                         word(p, ",");                          word(p, ",");
         }          }
   
         p->flags |= TERMP_NOSPACE;  
         word(p, ")");          word(p, ")");
   
         if (SEC_SYNOPSIS == node->sec)          if (SEC_SYNOPSIS == node->sec)
Line 952  termp_sx_post(DECL_ARGS)
Line 955  termp_sx_post(DECL_ARGS)
 static int  static int
 termp_fa_pre(DECL_ARGS)  termp_fa_pre(DECL_ARGS)
 {  {
           struct mdoc_node *n;
   
         p->flags |= ttypes[TTYPE_FUNC_ARG];          if (node->parent->tok != MDOC_Fo) {
         return(1);                  p->flags |= ttypes[TTYPE_FUNC_ARG];
                   return(1);
           }
   
           for (n = node->child; n; n = n->next) {
                   assert(MDOC_TEXT == n->type);
   
                   p->flags |= ttypes[TTYPE_FUNC_ARG];
                   word(p, n->data.text.string);
                   p->flags &= ~ttypes[TTYPE_FUNC_ARG];
   
                   if (n->next)
                           word(p, ",");
           }
   
           if (node->next && node->next->tok == MDOC_Fa)
                   word(p, ",");
   
           return(0);
 }  }
   
   
Line 1078  termp_qq_post(DECL_ARGS)
Line 1100  termp_qq_post(DECL_ARGS)
   
 /* ARGSUSED */  /* ARGSUSED */
 static int  static int
   termp_bsx_pre(DECL_ARGS)
   {
   
           word(p, "BSDI BSD/OS");
           return(1);
   }
   
   
   /* ARGSUSED */
   static int
 termp_bx_pre(DECL_ARGS)  termp_bx_pre(DECL_ARGS)
 {  {
   
Line 1098  termp_ox_pre(DECL_ARGS)
Line 1130  termp_ox_pre(DECL_ARGS)
   
 /* ARGSUSED */  /* ARGSUSED */
 static int  static int
   termp_ux_pre(DECL_ARGS)
   {
   
           word(p, "UNIX");
           return(1);
   }
   
   
   /* ARGSUSED */
   static int
   termp_fx_pre(DECL_ARGS)
   {
   
           word(p, "FreeBSD");
           return(1);
   }
   
   
   /* ARGSUSED */
   static int
 termp_nx_pre(DECL_ARGS)  termp_nx_pre(DECL_ARGS)
 {  {
   
Line 1208  termp_pa_post(DECL_ARGS)
Line 1260  termp_pa_post(DECL_ARGS)
   
 /* ARGSUSED */  /* ARGSUSED */
 static int  static int
 termp_qo_pre(DECL_ARGS)  
 {  
   
         if (MDOC_BODY != node->type)  
                 return(1);  
         word(p, "\"");  
         p->flags |= TERMP_NOSPACE;  
         return(1);  
 }  
   
   
 /* ARGSUSED */  
 static void  
 termp_qo_post(DECL_ARGS)  
 {  
   
         if (MDOC_BODY != node->type)  
                 return;  
         p->flags |= TERMP_NOSPACE;  
         word(p, "\"");  
 }  
   
   
 /* ARGSUSED */  
 static int  
 termp_em_pre(DECL_ARGS)  termp_em_pre(DECL_ARGS)
 {  {
   
Line 1341  termp_at_pre(DECL_ARGS)
Line 1368  termp_at_pre(DECL_ARGS)
         word(p, mdoc_att2a(c));          word(p, mdoc_att2a(c));
         return(0);          return(0);
 }  }
   
   
   /* ARGSUSED */
   static int
   termp_bq_pre(DECL_ARGS)
   {
   
           if (MDOC_BODY != node->type)
                   return(1);
           word(p, "[");
           p->flags |= TERMP_NOSPACE;
           return(1);
   }
   
   
   /* ARGSUSED */
   static void
   termp_bq_post(DECL_ARGS)
   {
   
           if (MDOC_BODY != node->type)
                   return;
           word(p, "]");
   }
   
   
   /* ARGSUSED */
   static int
   termp_pq_pre(DECL_ARGS)
   {
   
           if (MDOC_BODY != node->type)
                   return(1);
           word(p, "(");
           p->flags |= TERMP_NOSPACE;
           return(1);
   }
   
   
   /* ARGSUSED */
   static void
   termp_pq_post(DECL_ARGS)
   {
   
           if (MDOC_BODY != node->type)
                   return;
           word(p, ")");
   }
   
   
   /* ARGSUSED */
   static int
   termp_fo_pre(DECL_ARGS)
   {
           const struct mdoc_node *n;
   
           if (MDOC_BODY == node->type) {
                   word(p, "(");
                   p->flags |= TERMP_NOSPACE;
                   return(1);
           } else if (MDOC_HEAD != node->type)
                   return(1);
   
           p->flags |= ttypes[TTYPE_FUNC_NAME];
           for (n = node->child; n; n = n->next) {
                   assert(MDOC_TEXT == n->type);
                   word(p, n->data.text.string);
           }
           p->flags &= ~ttypes[TTYPE_FUNC_NAME];
   
           return(0);
   }
   
   
   /* ARGSUSED */
   static void
   termp_fo_post(DECL_ARGS)
   {
   
           if (MDOC_BODY != node->type)
                   return;
           word(p, ")");
           word(p, ";");
           newln(p);
   }
   
   

Legend:
Removed from v.1.14  
changed lines
  Added in v.1.16

CVSweb