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

Diff for /mandoc/mdoc_term.c between version 1.91 and 1.92

version 1.91, 2009/10/18 13:34:17 version 1.92, 2009/10/18 19:03:37
Line 23 
Line 23 
 #include <stdlib.h>  #include <stdlib.h>
 #include <string.h>  #include <string.h>
   
   #include "out.h"
 #include "term.h"  #include "term.h"
 #include "mdoc.h"  #include "mdoc.h"
 #include "chars.h"  #include "chars.h"
Line 475  print_head(DECL_ARGS)
Line 476  print_head(DECL_ARGS)
 static size_t  static size_t
 arg2height(const struct mdoc_node *n)  arg2height(const struct mdoc_node *n)
 {  {
         int              r;          struct roffsu    su;
   
         assert(MDOC_TEXT == n->type);          assert(MDOC_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(term_vspan(&su));
                 return(1);  
   
         return((size_t)r);  
 }  }
   
   
 static size_t  static size_t
 arg2width(const struct mdoc_argv *arg, int pos)  arg2width(const struct mdoc_argv *arg, int pos)
 {  {
         int              r;          struct roffsu    su;
   
         assert(arg->value[pos]);          assert(arg->value[pos]);
         if ('\0' == arg->value[pos][0])          if ( ! a2roffsu(arg->value[pos], &su, SCALE_MAX))
                 return(2);                  SCALE_HS_INIT(&su, strlen(arg->value[pos]) + 2);
   
         if ((r = a2width(arg->value[pos])) >= 0)          return(term_hspan(&su));
                 return((size_t)r);  
   
         return(strlen(arg->value[pos]) + 2);  
 }  }
   
   
Line 548  arg_listtype(const struct mdoc_node *n)
Line 545  arg_listtype(const struct mdoc_node *n)
 static size_t  static size_t
 arg2offs(const struct mdoc_argv *arg)  arg2offs(const struct mdoc_argv *arg)
 {  {
         int              r;          struct roffsu    su;
   
         if ('\0' == arg->value[0][0])          if ('\0' == arg->value[0][0])
                 return(0);                  return(0);
Line 558  arg2offs(const struct mdoc_argv *arg)
Line 555  arg2offs(const struct mdoc_argv *arg)
                 return(INDENT + 1);                  return(INDENT + 1);
         else if (0 == strcmp(arg->value[0], "indent-two"))          else if (0 == strcmp(arg->value[0], "indent-two"))
                 return((INDENT + 1) * 2);                  return((INDENT + 1) * 2);
         else if ((r = a2width(arg->value[0])) >= 0)          else if ( ! a2roffsu(arg->value[0], &su, SCALE_MAX))
                 return((size_t)r);                  SCALE_HS_INIT(&su, strlen(arg->value[0]));
   
         return(strlen(arg->value[0]));          return(term_hspan(&su));
 }  }
   
   

Legend:
Removed from v.1.91  
changed lines
  Added in v.1.92

CVSweb