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

Diff for /mandoc/term_ps.c between version 1.68 and 1.71

version 1.68, 2014/10/28 17:36:19 version 1.71, 2014/12/19 17:12:04
Line 27 
Line 27 
 #include <string.h>  #include <string.h>
 #include <unistd.h>  #include <unistd.h>
   
 #include "mandoc.h"  
 #include "mandoc_aux.h"  #include "mandoc_aux.h"
 #include "out.h"  #include "out.h"
 #include "main.h"  
 #include "term.h"  #include "term.h"
   #include "main.h"
   
 /* These work the buffer used by the header and footer. */  /* These work the buffer used by the header and footer. */
 #define PS_BUFSLOP        128  #define PS_BUFSLOP        128
Line 541  pspdf_alloc(const struct mchars *mchars, char *outopts
Line 540  pspdf_alloc(const struct mchars *mchars, char *outopts
         p = mandoc_calloc(1, sizeof(struct termp));          p = mandoc_calloc(1, sizeof(struct termp));
         p->symtab = mchars;          p->symtab = mchars;
         p->enc = TERMENC_ASCII;          p->enc = TERMENC_ASCII;
           p->fontq = mandoc_reallocarray(NULL,
               (p->fontsz = 8), sizeof(enum termfont));
           p->fontq[0] = p->fontl = TERMFONT_NONE;
         p->ps = mandoc_calloc(1, sizeof(struct termp_ps));          p->ps = mandoc_calloc(1, sizeof(struct termp_ps));
   
         p->advance = ps_advance;          p->advance = ps_advance;
Line 635  ps_setwidth(struct termp *p, int iop, size_t width)
Line 637  ps_setwidth(struct termp *p, int iop, size_t width)
         size_t   lastwidth;          size_t   lastwidth;
   
         lastwidth = p->ps->width;          lastwidth = p->ps->width;
         if (0 < iop)          if (iop > 0)
                 p->ps->width += width;                  p->ps->width += width;
         else if (0 > iop)          else if (iop == 0)
                   p->ps->width = width ? width : p->ps->lastwidth;
           else if (p->ps->width > width)
                 p->ps->width -= width;                  p->ps->width -= width;
         else          else
                 p->ps->width = width ? width : p->ps->lastwidth;                  p->ps->width = 0;
         p->ps->lastwidth = lastwidth;          p->ps->lastwidth = lastwidth;
 }  }
   

Legend:
Removed from v.1.68  
changed lines
  Added in v.1.71

CVSweb