[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.66 and 1.67

version 1.66, 2014/07/04 16:12:08 version 1.67, 2014/07/30 00:19:16
Line 83  static int   pre_en(DECL_ARGS);
Line 83  static int   pre_en(DECL_ARGS);
 static  int       pre_enc(DECL_ARGS);  static  int       pre_enc(DECL_ARGS);
 static  int       pre_em(DECL_ARGS);  static  int       pre_em(DECL_ARGS);
 static  int       pre_es(DECL_ARGS);  static  int       pre_es(DECL_ARGS);
   static  int       pre_ex(DECL_ARGS);
 static  int       pre_fa(DECL_ARGS);  static  int       pre_fa(DECL_ARGS);
 static  int       pre_fd(DECL_ARGS);  static  int       pre_fd(DECL_ARGS);
 static  int       pre_fl(DECL_ARGS);  static  int       pre_fl(DECL_ARGS);
Line 99  static int   pre_no(DECL_ARGS);
Line 100  static int   pre_no(DECL_ARGS);
 static  int       pre_ns(DECL_ARGS);  static  int       pre_ns(DECL_ARGS);
 static  int       pre_pp(DECL_ARGS);  static  int       pre_pp(DECL_ARGS);
 static  int       pre_rs(DECL_ARGS);  static  int       pre_rs(DECL_ARGS);
   static  int       pre_rv(DECL_ARGS);
 static  int       pre_sm(DECL_ARGS);  static  int       pre_sm(DECL_ARGS);
 static  int       pre_sp(DECL_ARGS);  static  int       pre_sp(DECL_ARGS);
 static  int       pre_sect(DECL_ARGS);  static  int       pre_sect(DECL_ARGS);
Line 139  static const struct manact manacts[MDOC_MAX + 1] = {
Line 141  static const struct manact manacts[MDOC_MAX + 1] = {
         { NULL, pre_li, post_font, NULL, NULL }, /* Dv */          { NULL, pre_li, post_font, NULL, NULL }, /* Dv */
         { NULL, pre_li, post_font, NULL, NULL }, /* Er */          { NULL, pre_li, post_font, NULL, NULL }, /* Er */
         { NULL, pre_li, post_font, NULL, NULL }, /* Ev */          { NULL, pre_li, post_font, NULL, NULL }, /* Ev */
         { NULL, pre_enc, post_enc, "The \\fB",          { NULL, pre_ex, NULL, NULL, NULL }, /* Ex */
             "\\fP\nutility exits 0 on success, and >0 if an error occurs."  
             }, /* Ex */  
         { NULL, pre_fa, post_fa, NULL, NULL }, /* Fa */          { NULL, pre_fa, post_fa, NULL, NULL }, /* Fa */
         { NULL, pre_fd, post_fd, NULL, NULL }, /* Fd */          { NULL, pre_fd, post_fd, NULL, NULL }, /* Fd */
         { NULL, pre_fl, post_fl, NULL, NULL }, /* Fl */          { NULL, pre_fl, post_fl, NULL, NULL }, /* Fl */
Line 155  static const struct manact manacts[MDOC_MAX + 1] = {
Line 155  static const struct manact manacts[MDOC_MAX + 1] = {
         { cond_body, pre_enc, post_enc, "[", "]" }, /* Op */          { cond_body, pre_enc, post_enc, "[", "]" }, /* Op */
         { NULL, pre_ft, post_font, NULL, NULL }, /* Ot */          { NULL, pre_ft, post_font, NULL, NULL }, /* Ot */
         { NULL, pre_em, post_font, NULL, NULL }, /* Pa */          { NULL, pre_em, post_font, NULL, NULL }, /* Pa */
         { NULL, pre_enc, post_enc, "The \\fB",          { NULL, pre_rv, NULL, NULL, NULL }, /* Rv */
                 "\\fP\nfunction returns the value 0 if successful;\n"  
                 "otherwise the value -1 is returned and the global\n"  
                 "variable \\fIerrno\\fP is set to indicate the error."  
                 }, /* Rv */  
         { NULL, NULL, NULL, NULL, NULL }, /* St */          { NULL, NULL, NULL, NULL, NULL }, /* St */
         { NULL, pre_em, post_font, NULL, NULL }, /* Va */          { NULL, pre_em, post_font, NULL, NULL }, /* Va */
         { NULL, pre_vt, post_vt, NULL, NULL }, /* Vt */          { NULL, pre_vt, post_vt, NULL, NULL }, /* Vt */
Line 673  post_enc(DECL_ARGS)
Line 669  post_enc(DECL_ARGS)
         print_word(suffix);          print_word(suffix);
 }  }
   
   static int
   pre_ex(DECL_ARGS)
   {
           int      nchild;
   
           outflags |= MMAN_br | MMAN_nl;
   
           print_word("The");
   
           nchild = n->nchild;
           for (n = n->child; n; n = n->next) {
                   font_push('B');
                   print_word(n->string);
                   font_pop();
   
                   if (n->next == NULL)
                           continue;
   
                   if (nchild > 2) {
                           outflags &= ~MMAN_spc;
                           print_word(",");
                   }
                   if (n->next->next == NULL)
                           print_word("and");
           }
   
           if (nchild > 1)
                   print_word("utilities exit\\~0");
           else
                   print_word("utility exits\\~0");
   
           print_word("on success, and\\~>0 if an error occurs.");
           outflags |= MMAN_nl;
           return(0);
   }
   
 static void  static void
 post_font(DECL_ARGS)  post_font(DECL_ARGS)
 {  {
Line 1511  post_nm(DECL_ARGS)
Line 1543  post_nm(DECL_ARGS)
         case MDOC_HEAD:          case MDOC_HEAD:
                 /* FALLTHROUGH */                  /* FALLTHROUGH */
         case MDOC_ELEM:          case MDOC_ELEM:
                 font_pop();                  if (n->child != NULL || meta->name != NULL)
                           font_pop();
                 break;                  break;
         default:          default:
                 break;                  break;
Line 1561  pre_rs(DECL_ARGS)
Line 1594  pre_rs(DECL_ARGS)
                 outflags &= ~MMAN_br;                  outflags &= ~MMAN_br;
         }          }
         return(1);          return(1);
   }
   
   static int
   pre_rv(DECL_ARGS)
   {
           int      nchild;
   
           outflags |= MMAN_br | MMAN_nl;
   
           nchild = n->nchild;
           if (nchild > 0) {
                   print_word("The");
   
                   for (n = n->child; n; n = n->next) {
                           font_push('B');
                           print_word(n->string);
                           font_pop();
   
                           outflags &= ~MMAN_spc;
                           print_word("()");
   
                           if (n->next == NULL)
                                   continue;
   
                           if (nchild > 2) {
                                   outflags &= ~MMAN_spc;
                                   print_word(",");
                           }
                           if (n->next->next == NULL)
                                   print_word("and");
                   }
   
                   if (nchild > 1)
                           print_word("functions return");
                   else
                           print_word("function returns");
   
                   print_word("the value\\~0 if successful;");
           } else
                   print_word("Upon successful completion, "
                       "the value\\~0 is returned;");
   
           print_word("otherwise the value\\~\\-1 is returned"
               " and the global variable");
   
           font_push('I');
           print_word("errno");
           font_pop();
   
           print_word("is set to indicate the error.");
           outflags |= MMAN_nl;
           return(0);
 }  }
   
 static int  static int

Legend:
Removed from v.1.66  
changed lines
  Added in v.1.67

CVSweb