[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.98 and 1.101

version 1.98, 2017/01/10 13:47:00 version 1.101, 2017/01/11 17:39:53
Line 79  static int   pre_bf(DECL_ARGS);
Line 79  static int   pre_bf(DECL_ARGS);
 static  int       pre_bk(DECL_ARGS);  static  int       pre_bk(DECL_ARGS);
 static  int       pre_bl(DECL_ARGS);  static  int       pre_bl(DECL_ARGS);
 static  int       pre_br(DECL_ARGS);  static  int       pre_br(DECL_ARGS);
 static  int       pre_bx(DECL_ARGS);  
 static  int       pre_dl(DECL_ARGS);  static  int       pre_dl(DECL_ARGS);
 static  int       pre_en(DECL_ARGS);  static  int       pre_en(DECL_ARGS);
 static  int       pre_enc(DECL_ARGS);  static  int       pre_enc(DECL_ARGS);
Line 103  static int   pre_no(DECL_ARGS);
Line 102  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);
 static  int       pre_sy(DECL_ARGS);  static  int       pre_sy(DECL_ARGS);
 static  void      pre_syn(const struct roff_node *);  static  void      pre_syn(const struct roff_node *);
 static  int       pre_vt(DECL_ARGS);  static  int       pre_vt(DECL_ARGS);
 static  int       pre_ux(DECL_ARGS);  
 static  int       pre_xr(DECL_ARGS);  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);
Line 158  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_rv, NULL, NULL, NULL }, /* Rv */          { NULL, pre_ex, NULL, NULL, NULL }, /* 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 182  static const struct manact manacts[MDOC_MAX + 1] = {
Line 179  static const struct manact manacts[MDOC_MAX + 1] = {
         { NULL, pre_bf, post_bf, NULL, NULL }, /* Bf */          { NULL, pre_bf, post_bf, NULL, NULL }, /* Bf */
         { cond_body, pre_enc, post_enc, "[", "]" }, /* Bo */          { cond_body, pre_enc, post_enc, "[", "]" }, /* Bo */
         { cond_body, pre_enc, post_enc, "[", "]" }, /* Bq */          { cond_body, pre_enc, post_enc, "[", "]" }, /* Bq */
         { NULL, pre_ux, NULL, "BSD/OS", NULL }, /* Bsx */          { NULL, NULL, NULL, NULL, NULL }, /* Bsx */
         { NULL, pre_bx, NULL, NULL, NULL }, /* Bx */          { NULL, NULL, NULL, NULL, NULL }, /* Bx */
         { NULL, pre_skip, NULL, NULL, NULL }, /* Db */          { NULL, pre_skip, NULL, NULL, NULL }, /* Db */
         { NULL, NULL, NULL, NULL, NULL }, /* Dc */          { NULL, NULL, NULL, NULL, NULL }, /* Dc */
         { cond_body, pre_enc, post_enc, "\\(Lq", "\\(Rq" }, /* Do */          { cond_body, pre_enc, post_enc, "\\(Lq", "\\(Rq" }, /* Do */
Line 192  static const struct manact manacts[MDOC_MAX + 1] = {
Line 189  static const struct manact manacts[MDOC_MAX + 1] = {
         { NULL, NULL, NULL, NULL, NULL }, /* Ef */          { NULL, NULL, NULL, NULL, NULL }, /* Ef */
         { NULL, pre_em, post_font, NULL, NULL }, /* Em */          { NULL, pre_em, post_font, NULL, NULL }, /* Em */
         { cond_body, pre_eo, post_eo, NULL, NULL }, /* Eo */          { cond_body, pre_eo, post_eo, NULL, NULL }, /* Eo */
         { NULL, pre_ux, NULL, "FreeBSD", NULL }, /* Fx */          { NULL, NULL, NULL, NULL, NULL }, /* Fx */
         { NULL, pre_sy, post_font, NULL, NULL }, /* Ms */          { NULL, pre_sy, post_font, NULL, NULL }, /* Ms */
         { NULL, pre_no, NULL, NULL, NULL }, /* No */          { NULL, pre_no, NULL, NULL, NULL }, /* No */
         { NULL, pre_ns, NULL, NULL, NULL }, /* Ns */          { NULL, pre_ns, NULL, NULL, NULL }, /* Ns */
         { NULL, pre_ux, NULL, "NetBSD", NULL }, /* Nx */          { NULL, NULL, NULL, NULL, NULL }, /* Nx */
         { NULL, pre_ux, NULL, "OpenBSD", NULL }, /* Ox */          { NULL, NULL, NULL, NULL, NULL }, /* Ox */
         { NULL, NULL, NULL, NULL, NULL }, /* Pc */          { NULL, NULL, NULL, NULL, NULL }, /* Pc */
         { NULL, NULL, post_pf, NULL, NULL }, /* Pf */          { NULL, NULL, post_pf, NULL, NULL }, /* Pf */
         { cond_body, pre_enc, post_enc, "(", ")" }, /* Po */          { cond_body, pre_enc, post_enc, "(", ")" }, /* Po */
Line 215  static const struct manact manacts[MDOC_MAX + 1] = {
Line 212  static const struct manact manacts[MDOC_MAX + 1] = {
         { NULL, pre_em, post_font, NULL, NULL }, /* Sx */          { NULL, pre_em, post_font, NULL, NULL }, /* Sx */
         { NULL, pre_sy, post_font, NULL, NULL }, /* Sy */          { NULL, pre_sy, post_font, NULL, NULL }, /* Sy */
         { NULL, pre_li, post_font, NULL, NULL }, /* Tn */          { NULL, pre_li, post_font, NULL, NULL }, /* Tn */
         { NULL, pre_ux, NULL, "UNIX", NULL }, /* Ux */          { NULL, NULL, NULL, NULL, NULL }, /* Ux */
         { NULL, NULL, NULL, NULL, NULL }, /* Xc */          { NULL, NULL, NULL, NULL, NULL }, /* Xc */
         { NULL, NULL, NULL, NULL, NULL }, /* Xo */          { NULL, NULL, NULL, NULL, NULL }, /* Xo */
         { NULL, pre_fo, post_fo, NULL, NULL }, /* Fo */          { NULL, pre_fo, post_fo, NULL, NULL }, /* Fo */
Line 224  static const struct manact manacts[MDOC_MAX + 1] = {
Line 221  static const struct manact manacts[MDOC_MAX + 1] = {
         { NULL, NULL, NULL, NULL, NULL }, /* Oc */          { NULL, NULL, NULL, NULL, NULL }, /* Oc */
         { NULL, pre_bk, post_bk, NULL, NULL }, /* Bk */          { NULL, pre_bk, post_bk, NULL, NULL }, /* Bk */
         { NULL, NULL, NULL, NULL, NULL }, /* Ek */          { NULL, NULL, NULL, NULL, NULL }, /* Ek */
         { NULL, pre_ux, NULL, "is currently in beta test.", NULL }, /* Bt */          { NULL, NULL, NULL, NULL, NULL }, /* Bt */
         { NULL, NULL, NULL, NULL, NULL }, /* Hf */          { NULL, NULL, NULL, NULL, NULL }, /* Hf */
         { NULL, pre_em, post_font, NULL, NULL }, /* Fr */          { NULL, pre_em, post_font, NULL, NULL }, /* Fr */
         { NULL, pre_ux, NULL, "currently under development.", NULL }, /* Ud */          { NULL, NULL, NULL, NULL, NULL }, /* Ud */
         { NULL, NULL, post_lb, NULL, NULL }, /* Lb */          { NULL, NULL, post_lb, NULL, NULL }, /* Lb */
         { NULL, pre_pp, NULL, NULL, NULL }, /* Lp */          { NULL, pre_pp, NULL, NULL, NULL }, /* Lp */
         { NULL, pre_lk, NULL, NULL, NULL }, /* Lk */          { NULL, pre_lk, NULL, NULL, NULL }, /* Lk */
Line 238  static const struct manact manacts[MDOC_MAX + 1] = {
Line 235  static const struct manact manacts[MDOC_MAX + 1] = {
         { NULL, NULL, post_percent, NULL, NULL }, /* %C */          { NULL, NULL, post_percent, NULL, NULL }, /* %C */
         { NULL, pre_skip, NULL, NULL, NULL }, /* Es */          { NULL, pre_skip, NULL, NULL, NULL }, /* Es */
         { cond_body, pre_en, post_en, NULL, NULL }, /* En */          { cond_body, pre_en, post_en, NULL, NULL }, /* En */
         { NULL, pre_ux, NULL, "DragonFly", NULL }, /* Dx */          { NULL, NULL, NULL, NULL, NULL }, /* Dx */
         { NULL, NULL, post_percent, NULL, NULL }, /* %Q */          { NULL, NULL, post_percent, NULL, NULL }, /* %Q */
         { NULL, pre_br, NULL, NULL, NULL }, /* br */          { NULL, pre_br, NULL, NULL, NULL }, /* br */
         { NULL, pre_sp, post_sp, NULL, NULL }, /* sp */          { NULL, pre_sp, post_sp, NULL, NULL }, /* sp */
Line 601  print_node(DECL_ARGS)
Line 598  print_node(DECL_ARGS)
                         printf("\\&");                          printf("\\&");
                         outflags &= ~MMAN_spc;                          outflags &= ~MMAN_spc;
                 }                  }
                 if (outflags & MMAN_Sm && ! (n->flags & NODE_DELIMC))                  if (n->flags & NODE_DELIMC)
                           outflags &= ~(MMAN_spc | MMAN_spc_force);
                   else if (outflags & MMAN_Sm)
                         outflags |= MMAN_spc_force;                          outflags |= MMAN_spc_force;
                 print_word(n->string);                  print_word(n->string);
                 if (outflags & MMAN_Sm && ! (n->flags & NODE_DELIMO))                  if (n->flags & NODE_DELIMO)
                           outflags &= ~(MMAN_spc | MMAN_spc_force);
                   else if (outflags & MMAN_Sm)
                         outflags |= MMAN_spc;                          outflags |= MMAN_spc;
         } else {          } else {
                 /*                  /*
Line 685  post_enc(DECL_ARGS)
Line 686  post_enc(DECL_ARGS)
 static int  static int
 pre_ex(DECL_ARGS)  pre_ex(DECL_ARGS)
 {  {
         struct roff_node *nch;  
   
         outflags |= MMAN_br | MMAN_nl;          outflags |= MMAN_br | MMAN_nl;
           return 1;
         print_word("The");  
   
         for (nch = n->child; nch != NULL; nch = nch->next) {  
                 font_push('B');  
                 print_word(nch->string);  
                 font_pop();  
   
                 if (nch->next == NULL)  
                         continue;  
   
                 if (nch->prev != NULL || nch->next->next != NULL) {  
                         outflags &= ~MMAN_spc;  
                         print_word(",");  
                 }  
                 if (nch->next->next == NULL)  
                         print_word("and");  
         }  
   
         if (n->child != NULL && n->child->next != NULL)  
                 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
Line 1054  pre_br(DECL_ARGS)
Line 1027  pre_br(DECL_ARGS)
 }  }
   
 static int  static int
 pre_bx(DECL_ARGS)  
 {  
   
         n = n->child;  
         if (n) {  
                 print_word(n->string);  
                 outflags &= ~MMAN_spc;  
                 n = n->next;  
         }  
         print_word("BSD");  
         if (NULL == n)  
                 return 0;  
         outflags &= ~MMAN_spc;  
         print_word("-");  
         outflags &= ~MMAN_spc;  
         print_word(n->string);  
         return 0;  
 }  
   
 static int  
 pre_dl(DECL_ARGS)  pre_dl(DECL_ARGS)
 {  {
   
Line 1646  pre_rs(DECL_ARGS)
Line 1599  pre_rs(DECL_ARGS)
 }  }
   
 static int  static int
 pre_rv(DECL_ARGS)  
 {  
         struct roff_node *nch;  
   
         outflags |= MMAN_br | MMAN_nl;  
   
         if (n->child != NULL) {  
                 print_word("The");  
   
                 for (nch = n->child; nch != NULL; nch = nch->next) {  
                         font_push('B');  
                         print_word(nch->string);  
                         font_pop();  
   
                         outflags &= ~MMAN_spc;  
                         print_word("()");  
   
                         if (nch->next == NULL)  
                                 continue;  
   
                         if (nch->prev != NULL || nch->next->next != NULL) {  
                                 outflags &= ~MMAN_spc;  
                                 print_word(",");  
                         }  
                         if (nch->next->next == NULL)  
                                 print_word("and");  
                 }  
   
                 if (n->child != NULL && n->child->next != NULL)  
                         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  
 pre_skip(DECL_ARGS)  pre_skip(DECL_ARGS)
 {  {
   
Line 1791  pre_xr(DECL_ARGS)
Line 1693  pre_xr(DECL_ARGS)
         print_node(meta, n);          print_node(meta, n);
         print_word(")");          print_word(")");
         return 0;          return 0;
 }  
   
 static int  
 pre_ux(DECL_ARGS)  
 {  
   
         print_word(manacts[n->tok].prefix);  
         if (NULL == n->child)  
                 return 0;  
         outflags &= ~MMAN_spc;  
         print_word("\\ ");  
         outflags &= ~MMAN_spc;  
         return 1;  
 }  }

Legend:
Removed from v.1.98  
changed lines
  Added in v.1.101

CVSweb