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

Diff for /mandoc/main.c between version 1.99 and 1.102

version 1.99, 2010/07/20 14:56:42 version 1.102, 2010/08/08 14:45:59
Line 37 
Line 37 
 #include "man.h"  #include "man.h"
 #include "roff.h"  #include "roff.h"
   
   #ifndef MAP_FILE
   #define MAP_FILE        0
   #endif
   
 #define UNCONST(a)      ((void *)(uintptr_t)(const void *)(a))  #define UNCONST(a)      ((void *)(uintptr_t)(const void *)(a))
   
 /* FIXME: Intel's compiler?  LLVM?  pcc?  */  /* FIXME: Intel's compiler?  LLVM?  pcc?  */
Line 68  enum outt {
Line 72  enum outt {
         OUTT_HTML,          OUTT_HTML,
         OUTT_XHTML,          OUTT_XHTML,
         OUTT_LINT,          OUTT_LINT,
         OUTT_PS          OUTT_PS,
           OUTT_PDF
 };  };
   
 struct  curparse {  struct  curparse {
Line 461  fdesc(struct curparse *curp)
Line 466  fdesc(struct curparse *curp)
         struct buf       ln, blk;          struct buf       ln, blk;
         int              i, pos, lnn, lnn_start, with_mmap, of;          int              i, pos, lnn, lnn_start, with_mmap, of;
         enum rofferr     re;          enum rofferr     re;
           unsigned char    c;
         struct man      *man;          struct man      *man;
         struct mdoc     *mdoc;          struct mdoc     *mdoc;
         struct roff     *roff;          struct roff     *roff;
Line 503  fdesc(struct curparse *curp)
Line 509  fdesc(struct curparse *curp)
                          * writers: use special characters.                           * writers: use special characters.
                          */                           */
   
                         if ( ! isgraph((u_char)blk.buf[i]) &&                          c = (unsigned char) blk.buf[i];
                                         ! isblank((u_char)blk.buf[i])) {                          if ( ! (isascii(c) && (isgraph(c) || isblank(c)))) {
                                 if ( ! mmsg(MANDOCERR_BADCHAR, curp,                                  if ( ! mmsg(MANDOCERR_BADCHAR, curp,
                                                 lnn_start, pos,                                                  lnn_start, pos,
                                                 "ignoring byte"))                                                  "ignoring byte"))
Line 630  fdesc(struct curparse *curp)
Line 636  fdesc(struct curparse *curp)
                         curp->outdata = ascii_alloc(curp->outopts);                          curp->outdata = ascii_alloc(curp->outopts);
                         curp->outfree = ascii_free;                          curp->outfree = ascii_free;
                         break;                          break;
                   case (OUTT_PDF):
                           curp->outdata = pdf_alloc(curp->outopts);
                           curp->outfree = pspdf_free;
                           break;
                 case (OUTT_PS):                  case (OUTT_PS):
                         curp->outdata = ps_alloc(curp->outopts);                          curp->outdata = ps_alloc(curp->outopts);
                         curp->outfree = ps_free;                          curp->outfree = pspdf_free;
                         break;                          break;
                 default:                  default:
                         break;                          break;
Line 650  fdesc(struct curparse *curp)
Line 660  fdesc(struct curparse *curp)
                         curp->outman = tree_man;                          curp->outman = tree_man;
                         curp->outmdoc = tree_mdoc;                          curp->outmdoc = tree_mdoc;
                         break;                          break;
                   case (OUTT_PDF):
                           /* FALLTHROUGH */
                 case (OUTT_ASCII):                  case (OUTT_ASCII):
                         /* FALLTHROUGH */                          /* FALLTHROUGH */
                 case (OUTT_PS):                  case (OUTT_PS):
Line 784  toptions(struct curparse *curp, char *arg)
Line 796  toptions(struct curparse *curp, char *arg)
                 curp->outtype = OUTT_XHTML;                  curp->outtype = OUTT_XHTML;
         else if (0 == strcmp(arg, "ps"))          else if (0 == strcmp(arg, "ps"))
                 curp->outtype = OUTT_PS;                  curp->outtype = OUTT_PS;
           else if (0 == strcmp(arg, "pdf"))
                   curp->outtype = OUTT_PDF;
         else {          else {
                 fprintf(stderr, "%s: Bad argument\n", arg);                  fprintf(stderr, "%s: Bad argument\n", arg);
                 return(0);                  return(0);

Legend:
Removed from v.1.99  
changed lines
  Added in v.1.102

CVSweb