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

Diff for /mandoc/html.c between version 1.185 and 1.188

version 1.185, 2015/01/21 20:33:25 version 1.188, 2015/10/06 18:32:19
Line 7 
Line 7 
  * purpose with or without fee is hereby granted, provided that the above   * purpose with or without fee is hereby granted, provided that the above
  * copyright notice and this permission notice appear in all copies.   * copyright notice and this permission notice appear in all copies.
  *   *
  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES   * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHORS DISCLAIM ALL WARRANTIES
  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF   * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR   * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR
  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES   * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN   * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF   * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
Line 32 
Line 32 
 #include "mandoc_aux.h"  #include "mandoc_aux.h"
 #include "out.h"  #include "out.h"
 #include "html.h"  #include "html.h"
   #include "manconf.h"
 #include "main.h"  #include "main.h"
   
 struct  htmldata {  struct  htmldata {
Line 129  static void  print_attr(struct html *, const char *, c
Line 130  static void  print_attr(struct html *, const char *, c
   
   
 void *  void *
 html_alloc(const struct mchars *mchars, char *outopts)  html_alloc(const struct mchars *mchars, const struct manoutput *outopts)
 {  {
         struct html     *h;          struct html     *h;
         const char      *toks[5];  
         char            *v;  
   
         toks[0] = "style";  
         toks[1] = "man";  
         toks[2] = "includes";  
         toks[3] = "fragment";  
         toks[4] = NULL;  
   
         h = mandoc_calloc(1, sizeof(struct html));          h = mandoc_calloc(1, sizeof(struct html));
   
         h->tags.head = NULL;          h->tags.head = NULL;
         h->symtab = mchars;          h->symtab = mchars;
   
         while (outopts && *outopts)          h->style = outopts->style;
                 switch (getsubopt(&outopts, UNCONST(toks), &v)) {          h->base_man = outopts->man;
                 case 0:          h->base_includes = outopts->includes;
                         h->style = v;          if (outopts->fragment)
                         break;                  h->oflags |= HTML_FRAGMENT;
                 case 1:  
                         h->base_man = v;  
                         break;  
                 case 2:  
                         h->base_includes = v;  
                         break;  
                 case 3:  
                         h->oflags |= HTML_FRAGMENT;  
                         break;  
                 default:  
                         break;  
                 }  
   
         return(h);          return h;
 }  }
   
 void  void
Line 243  print_metaf(struct html *h, enum mandoc_esc deco)
Line 224  print_metaf(struct html *h, enum mandoc_esc deco)
                 break;                  break;
         default:          default:
                 abort();                  abort();
                 /* NOTREACHED */  
         }          }
   
         if (h->metaf) {          if (h->metaf) {
Line 301  html_strlen(const char *cp)
Line 281  html_strlen(const char *cp)
                 cp++;                  cp++;
                 switch (mandoc_escape(&cp, NULL, NULL)) {                  switch (mandoc_escape(&cp, NULL, NULL)) {
                 case ESCAPE_ERROR:                  case ESCAPE_ERROR:
                         return(sz);                          return sz;
                 case ESCAPE_UNICODE:                  case ESCAPE_UNICODE:
                         /* FALLTHROUGH */                          /* FALLTHROUGH */
                 case ESCAPE_NUMBERED:                  case ESCAPE_NUMBERED:
Line 321  html_strlen(const char *cp)
Line 301  html_strlen(const char *cp)
                         break;                          break;
                 }                  }
         }          }
         return(sz);          return sz;
 }  }
   
 static int  static int
Line 350  print_escape(char c)
Line 330  print_escape(char c)
         case ASCII_BREAK:          case ASCII_BREAK:
                 break;                  break;
         default:          default:
                 return(0);                  return 0;
         }          }
         return(1);          return 1;
 }  }
   
 static int  static int
Line 452  print_encode(struct html *h, const char *p, int norecu
Line 432  print_encode(struct html *h, const char *p, int norecu
                         putchar(c);                          putchar(c);
         }          }
   
         return(nospace);          return nospace;
 }  }
   
 static void  static void
Line 514  print_otag(struct html *h, enum htmltag tag,
Line 494  print_otag(struct html *h, enum htmltag tag,
         if ((HTML_AUTOCLOSE | HTML_CLRLINE) & htmltags[tag].flags)          if ((HTML_AUTOCLOSE | HTML_CLRLINE) & htmltags[tag].flags)
                 putchar('\n');                  putchar('\n');
   
         return(t);          return t;
 }  }
   
 static void  static void

Legend:
Removed from v.1.185  
changed lines
  Added in v.1.188

CVSweb