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

Diff for /mandoc/man_term.c between version 1.97 and 1.105

version 1.97, 2011/01/12 15:23:25 version 1.105, 2011/03/22 10:13:01
Line 1 
Line 1 
 /*      $Id$ */  /*      $Id$ */
 /*  /*
  * Copyright (c) 2008, 2009, 2010 Kristaps Dzonsons <kristaps@bsd.lv>   * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
  * Copyright (c) 2010, 2011 Ingo Schwarze <schwarze@openbsd.org>   * Copyright (c) 2010, 2011 Ingo Schwarze <schwarze@openbsd.org>
  *   *
  * Permission to use, copy, modify, and distribute this software for any   * Permission to use, copy, modify, and distribute this software for any
Line 31 
Line 31 
 #include "out.h"  #include "out.h"
 #include "man.h"  #include "man.h"
 #include "term.h"  #include "term.h"
 #include "chars.h"  
 #include "main.h"  #include "main.h"
   
 #define INDENT            7  #define INDENT            7
Line 126  static const struct termact termacts[MAN_MAX] = {
Line 125  static const struct termact termacts[MAN_MAX] = {
         { pre_I, NULL, 0 }, /* I */          { pre_I, NULL, 0 }, /* I */
         { pre_alternate, NULL, 0 }, /* IR */          { pre_alternate, NULL, 0 }, /* IR */
         { pre_alternate, NULL, 0 }, /* RI */          { pre_alternate, NULL, 0 }, /* RI */
         { NULL, NULL, MAN_NOTEXT }, /* na */          { pre_ign, NULL, MAN_NOTEXT }, /* na */
         { pre_sp, NULL, MAN_NOTEXT }, /* sp */          { pre_sp, NULL, MAN_NOTEXT }, /* sp */
         { pre_literal, NULL, 0 }, /* nf */          { pre_literal, NULL, 0 }, /* nf */
         { pre_literal, NULL, 0 }, /* fi */          { pre_literal, NULL, 0 }, /* fi */
Line 212  print_bvspace(struct termp *p, const struct man_node *
Line 211  print_bvspace(struct termp *p, const struct man_node *
 {  {
         term_newln(p);          term_newln(p);
   
           if (n->body && n->body->child && MAN_TBL == n->body->child->type)
                   return;
   
         if (NULL == n->prev)          if (NULL == n->prev)
                 return;                  return;
   
Line 255  pre_literal(DECL_ARGS)
Line 257  pre_literal(DECL_ARGS)
         else          else
                 mt->fl &= ~MANT_LITERAL;                  mt->fl &= ~MANT_LITERAL;
   
         return(1);          return(0);
 }  }
   
 /* ARGSUSED */  /* ARGSUSED */
Line 864  print_man_node(DECL_ARGS)
Line 866  print_man_node(DECL_ARGS)
                  */                   */
                 if ('\0' == *n->string) {                  if ('\0' == *n->string) {
                         term_vspace(p);                          term_vspace(p);
                         break;                          return;
                 } else if (' ' == *n->string && MAN_LINE & n->flags)                  } else if (' ' == *n->string && MAN_LINE & n->flags)
                         term_newln(p);                          term_newln(p);
   
Line 889  print_man_node(DECL_ARGS)
Line 891  print_man_node(DECL_ARGS)
                         p->rmargin = rm;                          p->rmargin = rm;
                         p->maxrmargin = rmax;                          p->maxrmargin = rmax;
                 }                  }
   
                   if (MAN_EOS & n->flags)
                           p->flags |= TERMP_SENTENCE;
                 return;                  return;
           case (MAN_EQN):
                   term_word(p, n->eqn->data);
                   return;
         case (MAN_TBL):          case (MAN_TBL):
                 /*                  /*
                  * Tables are preceded by a newline.  Then process a                   * Tables are preceded by a newline.  Then process a
Line 937  print_man_nodelist(DECL_ARGS)
Line 945  print_man_nodelist(DECL_ARGS)
 static void  static void
 print_man_foot(struct termp *p, const void *arg)  print_man_foot(struct termp *p, const void *arg)
 {  {
         char            buf[DATESIZ];  
         const struct man_meta *meta;          const struct man_meta *meta;
   
         meta = (const struct man_meta *)arg;          meta = (const struct man_meta *)arg;
   
         term_fontrepl(p, TERMFONT_NONE);          term_fontrepl(p, TERMFONT_NONE);
   
         if (meta->rawdate)  
                 strlcpy(buf, meta->rawdate, DATESIZ);  
         else  
                 time2a(meta->date, buf, DATESIZ);  
   
         term_vspace(p);          term_vspace(p);
         term_vspace(p);          term_vspace(p);
         term_vspace(p);          term_vspace(p);
   
         p->flags |= TERMP_NOSPACE | TERMP_NOBREAK;          p->flags |= TERMP_NOSPACE | TERMP_NOBREAK;
         p->rmargin = p->maxrmargin - term_strlen(p, buf);          p->rmargin = p->maxrmargin - term_strlen(p, meta->date);
         p->offset = 0;          p->offset = 0;
   
         /* term_strlen() can return zero. */          /* term_strlen() can return zero. */
Line 972  print_man_foot(struct termp *p, const void *arg)
Line 974  print_man_foot(struct termp *p, const void *arg)
         p->rmargin = p->maxrmargin;          p->rmargin = p->maxrmargin;
         p->flags &= ~TERMP_NOBREAK;          p->flags &= ~TERMP_NOBREAK;
   
         term_word(p, buf);          term_word(p, meta->date);
         term_flushln(p);          term_flushln(p);
 }  }
   

Legend:
Removed from v.1.97  
changed lines
  Added in v.1.105

CVSweb