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

Diff for /mandoc/term.c between version 1.146 and 1.149

version 1.146, 2010/06/08 15:00:17 version 1.149, 2010/06/25 18:53:14
Line 1 
Line 1 
 /*      $Id$ */  /*      $Id$ */
 /*  /*
  * Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>   * Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@bsd.lv>
  *   *
  * Permission to use, copy, modify, and distribute this software for any   * Permission to use, copy, modify, and distribute this software for any
  * purpose with or without fee is hereby granted, provided that the above   * purpose with or without fee is hereby granted, provided that the above
Line 87  term_alloc(enum termenc enc)
Line 87  term_alloc(enum termenc enc)
                 exit(EXIT_FAILURE);                  exit(EXIT_FAILURE);
         }          }
   
         p->tabwidth = 5;  
         p->enc = enc;          p->enc = enc;
         p->defrmargin = 78;  
         return(p);          return(p);
 }  }
   
Line 603  encode(struct termp *p, const char *word, size_t sz)
Line 601  encode(struct termp *p, const char *word, size_t sz)
          * character by character.           * character by character.
          */           */
   
         if (TERMTYPE_PS == p->type) {          if (TERMFONT_NONE == (f = term_fonttop(p))) {
                 buffera(p, word, sz);                  buffera(p, word, sz);
                 return;                  return;
         } else if (TERMFONT_NONE == (f = term_fonttop(p))) {  
                 buffera(p, word, sz);  
                 return;  
         }          }
   
         for (i = 0; i < (int)sz; i++) {          for (i = 0; i < (int)sz; i++) {
Line 629  encode(struct termp *p, const char *word, size_t sz)
Line 624  encode(struct termp *p, const char *word, size_t sz)
   
   
 size_t  size_t
 term_vspan(const struct roffsu *su)  term_len(const struct termp *p, size_t sz)
 {  {
   
           return((*p->width)(p, ' ') * sz);
   }
   
   
   size_t
   term_strlen(const struct termp *p, const char *cp)
   {
           size_t           sz;
   
           for (sz = 0; *cp; cp++)
                   sz += (*p->width)(p, *cp);
   
           return(sz);
   }
   
   
   size_t
   term_vspan(const struct termp *p, const struct roffsu *su)
   {
         double           r;          double           r;
   
         switch (su->unit) {          switch (su->unit) {
Line 665  term_vspan(const struct roffsu *su)
Line 680  term_vspan(const struct roffsu *su)
   
   
 size_t  size_t
 term_hspan(const struct roffsu *su)  term_hspan(const struct termp *p, const struct roffsu *su)
 {  {
         double           r;          double           r;
   

Legend:
Removed from v.1.146  
changed lines
  Added in v.1.149

CVSweb