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

Diff for /mandoc/main.c between version 1.45 and 1.50

version 1.45, 2009/10/13 10:21:24 version 1.50, 2009/10/26 15:44:51
Line 27 
Line 27 
   
 #include "mdoc.h"  #include "mdoc.h"
 #include "man.h"  #include "man.h"
   #include "main.h"
   
 #define UNCONST(a)      ((void *)(uintptr_t)(const void *)(a))  #define UNCONST(a)      ((void *)(uintptr_t)(const void *)(a))
   
Line 34 
Line 35 
   
 #ifdef __linux__  #ifdef __linux__
 extern  int               getsubopt(char **, char * const *, char **);  extern  int               getsubopt(char **, char * const *, char **);
   extern  size_t            strlcat(char *, const char *, size_t);
 # ifndef __dead  # ifndef __dead
 #  define __dead __attribute__((__noreturn__))  #  define __dead __attribute__((__noreturn__))
 # endif  # endif
Line 87  struct curparse {
Line 89  struct curparse {
         out_man           outman;          out_man           outman;
         out_free          outfree;          out_free          outfree;
         void             *outdata;          void             *outdata;
         char             *outopts;          char              outopts[BUFSIZ];
 };  };
   
 extern  void             *html_alloc(char *);  
 extern  void              html_mdoc(void *, const struct mdoc *);  
 extern  void              html_man(void *, const struct man *);  
 extern  void              html_free(void *);  
 extern  void             *ascii_alloc(void);  
 extern  void              tree_mdoc(void *, const struct mdoc *);  
 extern  void              tree_man(void *, const struct man *);  
 extern  void              terminal_mdoc(void *, const struct mdoc *);  
 extern  void              terminal_man(void *, const struct man *);  
 extern  void              terminal_free(void *);  
   
 static  int               foptions(int *, char *);  static  int               foptions(int *, char *);
 static  int               toptions(enum outt *, char *);  static  int               toptions(enum outt *, char *);
 static  int               moptions(enum intt *, char *);  static  int               moptions(enum intt *, char *);
Line 134  main(int argc, char *argv[])
Line 125  main(int argc, char *argv[])
         curp.outtype = OUTT_ASCII;          curp.outtype = OUTT_ASCII;
   
         /* LINTED */          /* LINTED */
         while (-1 != (c = getopt(argc, argv, "f:m:o:T:VW:")))          while (-1 != (c = getopt(argc, argv, "f:m:O:T:VW:")))
                 switch (c) {                  switch (c) {
                 case ('f'):                  case ('f'):
                         if ( ! foptions(&curp.fflags, optarg))                          if ( ! foptions(&curp.fflags, optarg))
Line 144  main(int argc, char *argv[])
Line 135  main(int argc, char *argv[])
                         if ( ! moptions(&curp.inttype, optarg))                          if ( ! moptions(&curp.inttype, optarg))
                                 return(EXIT_FAILURE);                                  return(EXIT_FAILURE);
                         break;                          break;
                 case ('o'):                  case ('O'):
                         curp.outopts = optarg;                          (void)strlcat(curp.outopts, optarg, BUFSIZ);
                           (void)strlcat(curp.outopts, ",", BUFSIZ);
                         break;                          break;
                 case ('T'):                  case ('T'):
                         if ( ! toptions(&curp.outtype, optarg))                          if ( ! toptions(&curp.outtype, optarg))
Line 231  usage(void)
Line 223  usage(void)
 {  {
   
         (void)fprintf(stderr, "usage: %s [-V] [-foption...] "          (void)fprintf(stderr, "usage: %s [-V] [-foption...] "
                         "[-mformat] [-Toutput] [-Werr...]\n",                          "[-mformat] [-Ooption] [-Toutput] "
                         __progname);                          "[-Werr...]\n", __progname);
         exit(EXIT_FAILURE);          exit(EXIT_FAILURE);
 }  }
   
Line 579  static int
Line 571  static int
 foptions(int *fflags, char *arg)  foptions(int *fflags, char *arg)
 {  {
         char            *v, *o;          char            *v, *o;
         const char      *toks[7];          const char      *toks[8];
   
         toks[0] = "ign-scope";          toks[0] = "ign-scope";
         toks[1] = "no-ign-escape";          toks[1] = "no-ign-escape";
Line 587  foptions(int *fflags, char *arg)
Line 579  foptions(int *fflags, char *arg)
         toks[3] = "no-ign-chars";          toks[3] = "no-ign-chars";
         toks[4] = "ign-errors";          toks[4] = "ign-errors";
         toks[5] = "strict";          toks[5] = "strict";
         toks[6] = NULL;          toks[6] = "ign-escape";
           toks[7] = NULL;
   
         while (*arg) {          while (*arg) {
                 o = arg;                  o = arg;
Line 610  foptions(int *fflags, char *arg)
Line 603  foptions(int *fflags, char *arg)
                 case (5):                  case (5):
                         *fflags |= NO_IGN_ESCAPE |                          *fflags |= NO_IGN_ESCAPE |
                                    NO_IGN_MACRO | NO_IGN_CHARS;                                     NO_IGN_MACRO | NO_IGN_CHARS;
                           break;
                   case (6):
                           *fflags &= ~NO_IGN_ESCAPE;
                         break;                          break;
                 default:                  default:
                         warnx("bad argument: -f%s", o);                          warnx("bad argument: -f%s", o);

Legend:
Removed from v.1.45  
changed lines
  Added in v.1.50

CVSweb