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

Diff for /mandoc/eqn_term.c between version 1.3 and 1.4

version 1.3, 2011/07/23 22:57:13 version 1.4, 2011/07/24 10:09:03
Line 27 
Line 27 
 #include "out.h"  #include "out.h"
 #include "term.h"  #include "term.h"
   
   static  const enum termfont fontmap[EQNFONT__MAX] = {
           TERMFONT_NONE, /* EQNFONT_NONE */
           TERMFONT_NONE, /* EQNFONT_ROMAN */
           TERMFONT_BOLD, /* EQNFONT_BOLD */
           TERMFONT_BOLD, /* EQNFONT_FAT */
           TERMFONT_UNDER /* EQNFONT_ITALIC */
   };
   
 static void     eqn_box(struct termp *, const struct eqn_box *);  static void     eqn_box(struct termp *, const struct eqn_box *);
 static void     eqn_box_post(struct termp *, const struct eqn_box *);  
 static void     eqn_box_pre(struct termp *, const struct eqn_box *);  
 static void     eqn_text(struct termp *, const struct eqn_box *);  
   
 void  void
 term_eqn(struct termp *p, const struct eqn *ep)  term_eqn(struct termp *p, const struct eqn *ep)
Line 38  term_eqn(struct termp *p, const struct eqn *ep)
Line 43  term_eqn(struct termp *p, const struct eqn *ep)
   
         p->flags |= TERMP_NONOSPACE;          p->flags |= TERMP_NONOSPACE;
         eqn_box(p, ep->root);          eqn_box(p, ep->root);
           term_word(p, " ");
         p->flags &= ~TERMP_NONOSPACE;          p->flags &= ~TERMP_NONOSPACE;
 }  }
   
Line 45  static void
Line 51  static void
 eqn_box(struct termp *p, const struct eqn_box *bp)  eqn_box(struct termp *p, const struct eqn_box *bp)
 {  {
   
         eqn_box_pre(p, bp);          if (EQNFONT_NONE != bp->font)
         eqn_text(p, bp);                  term_fontpush(p, fontmap[(int)bp->font]);
   
         if (bp->first)  
                 eqn_box(p, bp->first);  
   
         eqn_box_post(p, bp);  
   
         if (bp->next)  
                 eqn_box(p, bp->next);  
 }  
   
 static void  
 eqn_box_pre(struct termp *p, const struct eqn_box *bp)  
 {  
   
         if (bp->left)          if (bp->left)
                 term_word(p, bp->left);                  term_word(p, bp->left);
 }          if (EQN_SUBEXPR == bp->type)
                   term_word(p, "(");
   
 static void          if (bp->text)
 eqn_box_post(struct termp *p, const struct eqn_box *bp)                  term_word(p, bp->text);
 {  
   
           if (bp->first)
                   eqn_box(p, bp->first);
   
           if (EQN_SUBEXPR == bp->type)
                   term_word(p, ")");
         if (bp->right)          if (bp->right)
                 term_word(p, bp->right);                  term_word(p, bp->right);
 }          if (EQNFONT_NONE != bp->font)
                   term_fontpop(p);
   
 static void          if (bp->next)
 eqn_text(struct termp *p, const struct eqn_box *bp)                  eqn_box(p, bp->next);
 {  
   
         if (bp->text)  
                 term_word(p, bp->text);  
 }  }

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

CVSweb