[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.2 and 1.5

version 1.2, 2009/03/26 14:44:41 version 1.5, 2009/04/12 19:19:57
Line 321  static int   arg_listtype(const struct mdoc_node *);
Line 321  static int   arg_listtype(const struct mdoc_node *);
 static  int       fmt_block_vspace(struct termp *,  static  int       fmt_block_vspace(struct termp *,
                         const struct mdoc_node *,                          const struct mdoc_node *,
                         const struct mdoc_node *);                          const struct mdoc_node *);
 static  int       print_node(DECL_ARGS);  static  void      print_node(DECL_ARGS);
 static  int       print_head(struct termp *,  static  void      print_head(struct termp *,
                         const struct mdoc_meta *);                          const struct mdoc_meta *);
 static  int       print_body(DECL_ARGS);  static  void      print_body(DECL_ARGS);
 static  int       print_foot(struct termp *,  static  void      print_foot(struct termp *,
                         const struct mdoc_meta *);                          const struct mdoc_meta *);
 static  void      sanity(const struct mdoc_node *);  static  void      sanity(const struct mdoc_node *);
   
Line 334  int
Line 334  int
 mdoc_run(struct termp *p, const struct mdoc *m)  mdoc_run(struct termp *p, const struct mdoc *m)
 {  {
   
         if ( ! print_head(p, mdoc_meta(m)))          print_head(p, mdoc_meta(m));
                 return(0);          print_body(p, NULL, mdoc_meta(m), mdoc_node(m));
         if ( ! print_body(p, NULL, mdoc_meta(m), mdoc_node(m)))          print_foot(p, mdoc_meta(m));
                 return(0);          return(1);
         return(print_foot(p, mdoc_meta(m)));  
 }  }
   
   
 static int  static void
 print_body(DECL_ARGS)  print_body(DECL_ARGS)
 {  {
   
         if ( ! print_node(p, pair, meta, node))          print_node(p, pair, meta, node);
                 return(0);  
         if ( ! node->next)          if ( ! node->next)
                 return(1);                  return;
         return(print_body(p, pair, meta, node->next));          print_body(p, pair, meta, node->next);
 }  }
   
   
 static int  static void
 print_node(DECL_ARGS)  print_node(DECL_ARGS)
 {  {
         int              dochild;          int              dochild;
Line 396  print_node(DECL_ARGS)
Line 394  print_node(DECL_ARGS)
         if (MDOC_TEXT != node->type)          if (MDOC_TEXT != node->type)
                 if (termacts[node->tok].post)                  if (termacts[node->tok].post)
                         (*termacts[node->tok].post)(p, &npair, meta, node);                          (*termacts[node->tok].post)(p, &npair, meta, node);
   
         return(1);  
 }  }
   
   
 static int  static void
 print_foot(struct termp *p, const struct mdoc_meta *meta)  print_foot(struct termp *p, const struct mdoc_meta *meta)
 {  {
         struct tm       *tm;          struct tm       *tm;
Line 449  print_foot(struct termp *p, const struct mdoc_meta *me
Line 445  print_foot(struct termp *p, const struct mdoc_meta *me
   
         free(buf);          free(buf);
         free(os);          free(os);
   
         return(1);  
 }  }
   
   
 static int  static void
 print_head(struct termp *p, const struct mdoc_meta *meta)  print_head(struct termp *p, const struct mdoc_meta *meta)
 {  {
         char            *buf, *title;          char            *buf, *title;
Line 520  print_head(struct termp *p, const struct mdoc_meta *me
Line 514  print_head(struct termp *p, const struct mdoc_meta *me
   
         free(title);          free(title);
         free(buf);          free(buf);
   
         return(1);  
 }  }
   
   
Line 1435  static int
Line 1427  static int
 termp_d1_pre(DECL_ARGS)  termp_d1_pre(DECL_ARGS)
 {  {
   
         if (MDOC_BODY != node->type)          if (MDOC_BLOCK != node->type)
                 return(1);                  return(1);
         term_newln(p);          term_newln(p);
         p->offset += (pair->offset = INDENT);          p->offset += (pair->offset = INDENT);
Line 1448  static void
Line 1440  static void
 termp_d1_post(DECL_ARGS)  termp_d1_post(DECL_ARGS)
 {  {
   
         if (MDOC_BODY != node->type)          if (MDOC_BLOCK != node->type)
                 return;                  return;
         term_newln(p);          term_newln(p);
         p->offset -= pair->offset;          p->offset -= pair->offset;
Line 1850  termp_ss_pre(DECL_ARGS)
Line 1842  termp_ss_pre(DECL_ARGS)
                 break;                  break;
         case (MDOC_HEAD):          case (MDOC_HEAD):
                 TERMPAIR_SETFLAG(p, pair, ttypes[TTYPE_SSECTION]);                  TERMPAIR_SETFLAG(p, pair, ttypes[TTYPE_SSECTION]);
                 p->offset = INDENT / 2;                  p->offset = HALFINDENT;
                 break;                  break;
         default:          default:
                 break;                  break;

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.5

CVSweb