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

Diff for /mandoc/mdoc_man.c between version 1.70 and 1.74

version 1.70, 2014/08/21 12:57:17 version 1.74, 2014/11/19 22:00:37
Line 46  static  void   font_push(char);
Line 46  static  void   font_push(char);
 static  void      font_pop(void);  static  void      font_pop(void);
 static  void      mid_it(void);  static  void      mid_it(void);
 static  void      post__t(DECL_ARGS);  static  void      post__t(DECL_ARGS);
   static  void      post_aq(DECL_ARGS);
 static  void      post_bd(DECL_ARGS);  static  void      post_bd(DECL_ARGS);
 static  void      post_bf(DECL_ARGS);  static  void      post_bf(DECL_ARGS);
 static  void      post_bk(DECL_ARGS);  static  void      post_bk(DECL_ARGS);
Line 72  static void   post_vt(DECL_ARGS);
Line 73  static void   post_vt(DECL_ARGS);
 static  int       pre__t(DECL_ARGS);  static  int       pre__t(DECL_ARGS);
 static  int       pre_an(DECL_ARGS);  static  int       pre_an(DECL_ARGS);
 static  int       pre_ap(DECL_ARGS);  static  int       pre_ap(DECL_ARGS);
   static  int       pre_aq(DECL_ARGS);
 static  int       pre_bd(DECL_ARGS);  static  int       pre_bd(DECL_ARGS);
 static  int       pre_bf(DECL_ARGS);  static  int       pre_bf(DECL_ARGS);
 static  int       pre_bk(DECL_ARGS);  static  int       pre_bk(DECL_ARGS);
Line 112  static int   pre_xr(DECL_ARGS);
Line 114  static int   pre_xr(DECL_ARGS);
 static  void      print_word(const char *);  static  void      print_word(const char *);
 static  void      print_line(const char *, int);  static  void      print_line(const char *, int);
 static  void      print_block(const char *, int);  static  void      print_block(const char *, int);
 static  void      print_offs(const char *);  static  void      print_offs(const char *, int);
 static  void      print_width(const char *,  static  void      print_width(const char *,
                                 const struct mdoc_node *, size_t);                                  const struct mdoc_node *, size_t);
 static  void      print_count(int *);  static  void      print_count(int *);
Line 172  static const struct manact manacts[MDOC_MAX + 1] = {
Line 174  static const struct manact manacts[MDOC_MAX + 1] = {
         { NULL, pre__t, post__t, NULL, NULL }, /* %T */          { NULL, pre__t, post__t, NULL, NULL }, /* %T */
         { NULL, NULL, post_percent, NULL, NULL }, /* %V */          { NULL, NULL, post_percent, NULL, NULL }, /* %V */
         { NULL, NULL, NULL, NULL, NULL }, /* Ac */          { NULL, NULL, NULL, NULL, NULL }, /* Ac */
         { cond_body, pre_enc, post_enc, "<", ">" }, /* Ao */          { cond_body, pre_aq, post_aq, NULL, NULL }, /* Ao */
         { cond_body, pre_enc, post_enc, "<", ">" }, /* Aq */          { cond_body, pre_aq, post_aq, NULL, NULL }, /* Aq */
         { NULL, NULL, NULL, NULL, NULL }, /* At */          { NULL, NULL, NULL, NULL, NULL }, /* At */
         { NULL, NULL, NULL, NULL, NULL }, /* Bc */          { NULL, NULL, NULL, NULL, NULL }, /* Bc */
         { NULL, pre_bf, post_bf, NULL, NULL }, /* Bf */          { NULL, pre_bf, post_bf, NULL, NULL }, /* Bf */
Line 416  print_block(const char *s, int newflags)
Line 418  print_block(const char *s, int newflags)
 }  }
   
 static void  static void
 print_offs(const char *v)  print_offs(const char *v, int keywords)
 {  {
         char              buf[24];          char              buf[24];
         struct roffsu     su;          struct roffsu     su;
Line 425  print_offs(const char *v)
Line 427  print_offs(const char *v)
         print_line(".RS", MMAN_Bk_susp);          print_line(".RS", MMAN_Bk_susp);
   
         /* Convert v into a number (of characters). */          /* Convert v into a number (of characters). */
         if (NULL == v || '\0' == *v || 0 == strcmp(v, "left"))          if (NULL == v || '\0' == *v || (keywords && !strcmp(v, "left")))
                 sz = 0;                  sz = 0;
         else if (0 == strcmp(v, "indent"))          else if (keywords && !strcmp(v, "indent"))
                 sz = 6;                  sz = 6;
         else if (0 == strcmp(v, "indent-two"))          else if (keywords && !strcmp(v, "indent-two"))
                 sz = 12;                  sz = 12;
         else if (a2roffsu(v, &su, SCALE_MAX)) {          else if (a2roffsu(v, &su, SCALE_MAX)) {
                 if (SCALE_EN == su.unit)                  if (SCALE_EN == su.unit)
Line 594  print_node(DECL_ARGS)
Line 596  print_node(DECL_ARGS)
                         printf("\\&");                          printf("\\&");
                         outflags &= ~MMAN_spc;                          outflags &= ~MMAN_spc;
                 }                  }
                   if (outflags & MMAN_Sm && ! (n->flags & MDOC_DELIMC))
                           outflags |= MMAN_spc_force;
                 print_word(n->string);                  print_word(n->string);
                   if (outflags & MMAN_Sm && ! (n->flags & MDOC_DELIMO))
                           outflags |= MMAN_spc;
         } else {          } else {
                 /*                  /*
                  * Conditionally run the pre-node action handler for a                   * Conditionally run the pre-node action handler for a
Line 866  pre_ap(DECL_ARGS)
Line 872  pre_ap(DECL_ARGS)
 }  }
   
 static int  static int
   pre_aq(DECL_ARGS)
   {
   
           print_word(n->parent->prev != NULL &&
               n->parent->prev->tok == MDOC_An ?  "<" : "\\(la");
           outflags &= ~MMAN_spc;
           return(1);
   }
   
   static void
   post_aq(DECL_ARGS)
   {
   
           outflags &= ~(MMAN_spc | MMAN_nl);
           print_word(n->parent->prev != NULL &&
               n->parent->prev->tok == MDOC_An ?  ">" : "\\(ra");
   }
   
   static int
 pre_bd(DECL_ARGS)  pre_bd(DECL_ARGS)
 {  {
   
Line 876  pre_bd(DECL_ARGS)
Line 901  pre_bd(DECL_ARGS)
                 print_line(".nf", 0);                  print_line(".nf", 0);
         if (0 == n->norm->Bd.comp && NULL != n->parent->prev)          if (0 == n->norm->Bd.comp && NULL != n->parent->prev)
                 outflags |= MMAN_sp;                  outflags |= MMAN_sp;
         print_offs(n->norm->Bd.offs);          print_offs(n->norm->Bd.offs, 1);
         return(1);          return(1);
 }  }
   
Line 963  pre_bl(DECL_ARGS)
Line 988  pre_bl(DECL_ARGS)
          * just nest and do not add up their indentation.           * just nest and do not add up their indentation.
          */           */
         if (n->norm->Bl.offs) {          if (n->norm->Bl.offs) {
                 print_offs(n->norm->Bl.offs);                  print_offs(n->norm->Bl.offs, 0);
                 Bl_stack[Bl_stack_len++] = 0;                  Bl_stack[Bl_stack_len++] = 0;
         }          }
   
Line 1048  static int
Line 1073  static int
 pre_dl(DECL_ARGS)  pre_dl(DECL_ARGS)
 {  {
   
         print_offs("6n");          print_offs("6n", 0);
         return(1);          return(1);
 }  }
   
Line 1340  pre_it(DECL_ARGS)
Line 1365  pre_it(DECL_ARGS)
                         outflags |= MMAN_nl;                          outflags |= MMAN_nl;
                         font_push('B');                          font_push('B');
                         if (LIST_bullet == bln->norm->Bl.type)                          if (LIST_bullet == bln->norm->Bl.type)
                                 print_word("o");                                  print_word("\\(bu");
                         else                          else
                                 print_word("-");                                  print_word("-");
                         font_pop();                          font_pop();

Legend:
Removed from v.1.70  
changed lines
  Added in v.1.74

CVSweb