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

Diff for /mandoc/main.c between version 1.2 and 1.4

version 1.2, 2009/03/19 16:18:36 version 1.4, 2009/03/19 18:30:26
Line 28 
Line 28 
   
 #include "mdoc.h"  #include "mdoc.h"
   
   #ifdef __linux__
   extern  int               getsubopt(char **, char * const *, char **);
   # ifndef __dead
   #  define __dead __attribute__((__noreturn__))
   # endif
   #endif
   
 #define WARN_WALL         0x03          /* All-warnings mask. */  #define WARN_WALL         0x03          /* All-warnings mask. */
 #define WARN_WCOMPAT     (1 << 0)       /* Compatibility warnings. */  #define WARN_WCOMPAT     (1 << 0)       /* Compatibility warnings. */
 #define WARN_WSYNTAX     (1 << 1)       /* Syntax warnings. */  #define WARN_WSYNTAX     (1 << 1)       /* Syntax warnings. */
Line 158  main(int argc, char *argv[])
Line 165  main(int argc, char *argv[])
   
         mdoc = mdoc_alloc(&wflags, fflags, &cb);          mdoc = mdoc_alloc(&wflags, fflags, &cb);
   
         while (*argv) {          /*
                 if ( ! file(&line, &linesz, &buf, &bufsz, *argv, mdoc))           * Loop around available files.
                         break;           */
                 if (outrun && ! (*outrun)(outdata, mdoc))  
                         break;  
   
                 /* Reset the parser for another file. */          if (NULL == *argv) {
                 mdoc_reset(mdoc);                  c = fdesc(&line, &linesz, &buf, &bufsz,
                 argv++;                                  "stdin", STDIN_FILENO, mdoc);
                   rc = 0;
                   if (c && NULL == outrun)
                           rc = 1;
                   else if (c && outrun && (*outrun)(outdata, mdoc))
                           rc = 1;
           } else {
                   while (*argv) {
                           c = file(&line, &linesz, &buf,
                                           &bufsz, *argv, mdoc);
                           if ( ! c)
                                   break;
                           if (outrun && ! (*outrun)(outdata, mdoc))
                                   break;
                           /* Reset the parser for another file. */
                           mdoc_reset(mdoc);
                           argv++;
                   }
                   rc = NULL == *argv;
         }          }
   
         rc = NULL == *argv;  
   
         if (buf)          if (buf)
                 free(buf);                  free(buf);

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.4

CVSweb