[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.39 and 1.44

version 1.39, 2009/10/18 13:34:16 version 1.44, 2009/10/24 05:45:05
Line 23 
Line 23 
 #include <stdlib.h>  #include <stdlib.h>
 #include <string.h>  #include <string.h>
   
   #include "out.h"
 #include "man.h"  #include "man.h"
 #include "term.h"  #include "term.h"
 #include "chars.h"  #include "chars.h"
Line 31 
Line 32 
 #define INDENT            7  #define INDENT            7
 #define HALFINDENT        3  #define HALFINDENT        3
   
   /* FIXME: have PD set the default vspace width. */
   
 struct  mtermp {  struct  mtermp {
         int               fl;          int               fl;
 #define MANT_LITERAL     (1 << 0)  #define MANT_LITERAL     (1 << 0)
Line 140  static const struct termact termacts[MAN_MAX] = {
Line 143  static const struct termact termacts[MAN_MAX] = {
         { pre_RS, post_RS }, /* RS */          { pre_RS, post_RS }, /* RS */
         { pre_ign, NULL }, /* DT */          { pre_ign, NULL }, /* DT */
         { pre_ign, NULL }, /* UC */          { pre_ign, NULL }, /* UC */
           { pre_ign, NULL }, /* PD */
 };  };
   
   
Line 183  terminal_man(void *arg, const struct man *man)
Line 187  terminal_man(void *arg, const struct man *man)
 static int  static int
 arg2height(const struct man_node *n)  arg2height(const struct man_node *n)
 {  {
         int             r;          struct roffsu    su;
   
         assert(MAN_TEXT == n->type);          assert(MAN_TEXT == n->type);
         assert(n->string);          assert(n->string);
           if ( ! a2roffsu(n->string, &su, SCALE_VS))
                   SCALE_VS_INIT(&su, strlen(n->string));
   
         if ((r = a2height(n->string)) < 0)          return((int)term_vspan(&su));
                 return(1);  
   
         return(r);  
 }  }
   
   
 static int  static int
 arg2width(const struct man_node *n)  arg2width(const struct man_node *n)
 {  {
           struct roffsu    su;
   
         assert(MAN_TEXT == n->type);          assert(MAN_TEXT == n->type);
         assert(n->string);          assert(n->string);
         return(a2width(n->string));          if ( ! a2roffsu(n->string, &su, SCALE_BU))
                   return(-1);
   
           return((int)term_hspan(&su));
 }  }
   
   
Line 905  print_body(DECL_ARGS)
Line 912  print_body(DECL_ARGS)
 static void  static void
 print_foot(struct termp *p, const struct man_meta *meta)  print_foot(struct termp *p, const struct man_meta *meta)
 {  {
         struct tm       *tm;          char            buf[DATESIZ];
         char             buf[BUFSIZ];  
   
         tm = localtime(&meta->date);          time2a(meta->date, buf, DATESIZ);
   
         if (0 == strftime(buf, p->rmargin, "%B %d, %Y", tm))  
                 (void)strlcpy(buf, "(invalid date)", BUFSIZ);  
   
         term_vspace(p);          term_vspace(p);
   

Legend:
Removed from v.1.39  
changed lines
  Added in v.1.44

CVSweb