[BACK]Return to tree.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / mandoc

Diff for /src/usr.bin/mandoc/tree.c between version 1.27 and 1.28

version 1.27, 2014/11/28 05:51:29 version 1.28, 2015/02/03 18:37:39
Line 1 
Line 1 
 /*      $OpenBSD$ */  /*      $OpenBSD$ */
 /*  /*
  * Copyright (c) 2008, 2009, 2011, 2014 Kristaps Dzonsons <kristaps@bsd.lv>   * Copyright (c) 2008, 2009, 2011, 2014 Kristaps Dzonsons <kristaps@bsd.lv>
  * Copyright (c) 2013, 2014 Ingo Schwarze <schwarze@openbsd.org>   * Copyright (c) 2013, 2014, 2015 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
  * 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 38 
Line 38 
 tree_mdoc(void *arg, const struct mdoc *mdoc)  tree_mdoc(void *arg, const struct mdoc *mdoc)
 {  {
   
         print_mdoc(mdoc_node(mdoc), 0);          print_mdoc(mdoc_node(mdoc)->child, 0);
 }  }
   
 void  void
 tree_man(void *arg, const struct man *man)  tree_man(void *arg, const struct man *man)
 {  {
   
         print_man(man_node(man), 0);          print_man(man_node(man)->child, 0);
 }  }
   
 static void  static void
Line 56 
Line 56 
         size_t            argc;          size_t            argc;
         struct mdoc_argv *argv;          struct mdoc_argv *argv;
   
           if (n == NULL)
                   return;
   
         argv = NULL;          argv = NULL;
         argc = 0;          argc = 0;
         t = p = NULL;          t = p = NULL;
Line 140 
Line 143 
                 print_span(n->span, indent);                  print_span(n->span, indent);
         } else {          } else {
                 for (i = 0; i < indent; i++)                  for (i = 0; i < indent; i++)
                         putchar('\t');                          putchar(' ');
   
                 printf("%s (%s)", p, t);                  printf("%s (%s)", p, t);
   
Line 164 
Line 167 
         }          }
   
         if (n->eqn)          if (n->eqn)
                 print_box(n->eqn->root->first, indent + 1);                  print_box(n->eqn->root->first, indent + 4);
         if (n->child)          if (n->child)
                 print_mdoc(n->child, indent + 1);                  print_mdoc(n->child, indent +
                       (n->type == MDOC_BLOCK ? 2 : 4));
         if (n->next)          if (n->next)
                 print_mdoc(n->next, indent);                  print_mdoc(n->next, indent);
 }  }
Line 177 
Line 181 
         const char       *p, *t;          const char       *p, *t;
         int               i;          int               i;
   
           if (n == NULL)
                   return;
   
         t = p = NULL;          t = p = NULL;
   
         switch (n->type) {          switch (n->type) {
Line 239 
Line 246 
                 print_span(n->span, indent);                  print_span(n->span, indent);
         } else {          } else {
                 for (i = 0; i < indent; i++)                  for (i = 0; i < indent; i++)
                         putchar('\t');                          putchar(' ');
                 printf("%s (%s) ", p, t);                  printf("%s (%s) ", p, t);
                 if (MAN_LINE & n->flags)                  if (MAN_LINE & n->flags)
                         putchar('*');                          putchar('*');
Line 247 
Line 254 
         }          }
   
         if (n->eqn)          if (n->eqn)
                 print_box(n->eqn->root->first, indent + 1);                  print_box(n->eqn->root->first, indent + 4);
         if (n->child)          if (n->child)
                 print_man(n->child, indent + 1);                  print_man(n->child, indent +
                       (n->type == MAN_BLOCK ? 2 : 4));
         if (n->next)          if (n->next)
                 print_man(n->next, indent);                  print_man(n->next, indent);
 }  }
Line 268 
Line 276 
         if (NULL == ep)          if (NULL == ep)
                 return;                  return;
         for (i = 0; i < indent; i++)          for (i = 0; i < indent; i++)
                 putchar('\t');                  putchar(' ');
   
         t = NULL;          t = NULL;
         switch (ep->type) {          switch (ep->type) {
Line 316 
Line 324 
                 printf(" args=%zu", ep->args);                  printf(" args=%zu", ep->args);
         putchar('\n');          putchar('\n');
   
         print_box(ep->first, indent + 1);          print_box(ep->first, indent + 4);
         print_box(ep->next, indent);          print_box(ep->next, indent);
 }  }
   
Line 327 
Line 335 
         int              i;          int              i;
   
         for (i = 0; i < indent; i++)          for (i = 0; i < indent; i++)
                 putchar('\t');                  putchar(' ');
   
         switch (sp->pos) {          switch (sp->pos) {
         case TBL_SPAN_HORIZ:          case TBL_SPAN_HORIZ:

Legend:
Removed from v.1.27  
changed lines
  Added in v.1.28